|
I am pretty sure someone will tell me I'm doing it wrong. On the client side I'm using markedjs to render markdown. The server sends raw markdown to the client and the client renders it on the page. However it isn't really a single page application or anything like that so in order to just avoid an additional request I'm including the raw markdown on the page. When `DOMContentLoaded` I grab the `innerHTML` of my content, run it through markedjs, and re-insert it into the same place I got it from. This works. But I'm getting weirdness in my code blocks like I'm seeing quite a few `>` `<` in there, and if I have an HTML code block it just seems to eliminate most of it. I suspect that's because when I insert raw markdown onto the page the page thinks that HTML code block is actually HTML. So I'm left to ask should I absolutely definitely not be putting raw markdown into my page, and if I did what's a more smarter way of doing it.
|
# ¿ Feb 19, 2018 09:06 |
|
|
# ¿ May 16, 2024 08:15 |
|
After typing out my question I knew the answer. Now I'm passing the markdown inside of a data attribute, then it's just a string and I'm able to convert it to HTML and insert it without any problems. I'm choosing not to render markdown on the server because markedjs has a pretty great code block implementation that allows me to do syntax highlighting. If I were to render the markdown and all of the syntax highlighting on the server I feel it would be an unnecessary use of bandwidth and cpu. Surely it would be convenient to parse markdown on the server. But I also have an editor function, so parsing markdown on the client side was something I had in place either way.
|
# ¿ Feb 19, 2018 09:26 |
|
nearlyfreespeech.net I wholeheartedly recommend them as a managed host if you're pretty proficient with ssh. They aren't super-duper user friendly on purpose, but do in fact do real easy ssl setup, as easy as 1 command. They are also extremely transparent with pricing. They primarily support php/cgi but I've been hosting a lot of more complex stuff in the form of node apps using daemons.
|
# ¿ Feb 23, 2018 15:05 |
|
ufarn posted:Is exporting a phpMyAdmin fairly straightforward for this? I don't really work with PHP that much beside self-hosted stuff. It comes with phpmyadmin and as many mariadb instances as you like. I never work with php so I can't be much help to you with your question, try their support system
|
# ¿ Feb 23, 2018 15:56 |
|
It feels like every web framework I've ever used handles a trailing slash in urls differently, it's odd because there really can only be three different ways of handling it but somehow they are all different. I pretend it isn't an issue.
|
# ¿ Feb 27, 2018 15:07 |
|
Man just use float. Most of the new CSS attributes are developed by people who don't know what they are doing.code:
|
# ¿ Feb 28, 2018 01:10 |
|
duz posted:I have our templating engine strip all white space on output because why not? The browser dev tools can still generate the tree view just fine. The prettify feature is being deprecated in pugjs. Which is ok, white space between elements can have weird effects
|
# ¿ Mar 10, 2018 09:43 |
|
Man you guys are living in the future with that tech.
|
# ¿ Mar 11, 2018 20:30 |
|
Stop it stop showing off!
|
# ¿ Mar 11, 2018 21:56 |
|
Love Stole the Day posted:Hello, I am trash and please tell me why my portfolio project is also pathetic, worthless, and not good enough to get an interview with tia https://wanderrful.github.io/korean-learning-app/ I can't get past question one but my instinct tells me it's using some kind of overly elaborate library for something otherwise simple. Oh, yeah it's using bootstrap, and therefore also jquery. Oh holy it's also using react. Well, at least you're demonstrating your ability to use it for the pros. Good lord, the webpage is approx 600 bytes, but the html/css hauls it up to more than half a meg. For what it's doing I don't like the size of it.
|
# ¿ Mar 12, 2018 12:59 |
|
I thought about making a website builder that is intentionally not meant for professional looking websites. But instead mimics Geocities neighbourhoods of old, and lets you sort of drag and drop elements that look like 90's era stuff. Webrings, animates gifs, stuff like that. Is there any market? It could advertise 5MB of free space on the top, it could be basically like old times again.
|
# ¿ Mar 12, 2018 20:40 |
|
I am having difficulty believing Wordpress is still king of this castle
|
# ¿ Mar 14, 2018 14:10 |
|
Gmaz posted:How do you write big applications for serverless? Or is essentially each function a microservice? That would finally force everyone to error check every single function call.
|
# ¿ Mar 19, 2018 18:40 |
|
Reminds me how I was trained by Ruby to make everything a class or a class instance. Then I tried to translate that to JavaScript and made my life a nightmare for a little while. Then I discovered how great it is not to use classes without there being a good reason.
|
# ¿ Mar 20, 2018 21:06 |
|
I'm running the job application gauntlet and I've been noticing a significant number of companies are hiring for Python backends, and JS frontends. Very few seem to be looking for Node backends. Which is too bad because that's where I focused. I have a lot of Ruby experience, I think it's clear Ruby lost to Python.
|
# ¿ Mar 24, 2018 19:15 |
|
melon cat posted:On the SEO talk- I'm going to vent a bit, here. Despite what anyone claims nobody has 100% "figured out" SEO (Google doesn't make this easy). It's constantly changing. But there are all of these "marketing and communications" companies out there that make dubious claims about "SEO optimization" and make bullshit claims about being able to make you #1 on Google Pagerank for the low, low cost of $800 a month or something. So people are just throwing money at these companies, many of which are run by complete hacks, with really mixed results. It's modern snake oil. Google just does whatever it wants if you need a guaranteed page rank you have to pay Google money, that's on purpose.
|
# ¿ Mar 25, 2018 20:29 |
|
http://www.youmightnotneedredux.info/
|
# ¿ Mar 26, 2018 01:58 |
|
huhu posted:Do you guys use PUT and DELETE for http request methods? Am I bad because I only use GET and POST? Also, why do I only get asked the difference between GET/POST in interviews? Well I mean. Those are the only real ones, plus OPTIONS and HEAD the others are artificial and are only possible by adding a hidden field or a query parameter, or request header. Unless you're using fetch I suppose. The whole thing is more ideological than practical but there are die hards out there. Supposed to do: code:
code:
code:
|
# ¿ Apr 3, 2018 23:12 |
|
What? No. I mean you need a page that displays a way to "Create product" and you need a page to "Edit product", those are routes that generally have to exist.
|
# ¿ Apr 4, 2018 11:45 |
|
k.Gmaz posted:Why would you not use e.g. a delete request to delete a resource, why make an additional get route for it? what's the difference.
|
# ¿ Apr 4, 2018 16:32 |
|
Edgar Allan Pwned posted:Here is the codepen for what I'm working on. You haven't set any `:hover` attribute.
|
# ¿ Jan 2, 2019 23:43 |
|
I was a big fan of skeleton for a while, but it has been ages since I've used any kind of css framework so I dunno if it has kept up
|
# ¿ Jan 4, 2019 16:00 |
|
Blog about tips and tricks you've learned along the way, without divulging any of the code as you're likely held under NDA.
|
# ¿ Jan 8, 2019 17:17 |
|
I've been working on a service that generates email addresses (incoming only) and another thing that lets you generate free forums and I'm 80% certain the first thing I'm going to do is block Europe.
|
# ¿ Jan 11, 2019 01:33 |
|
Do you really want to use html? If you want to just use javascript it's no problem with FormData and XMLHttpRequest... https://developer.mozilla.org/en-US/docs/Web/API/FormData/Using_FormData_Objects
|
# ¿ Jan 15, 2019 23:34 |
|
You really just want to set window.location.href to the file location and let their browser do what it does with the filetype. In most cases it'll download. I did something really hacky for a tampermonkey script I use to download images sometimes, it involves creating a link element setting the href to a data url, setting a "download" attribute to the filename I want and triggering a click event on it. But it's so incredibly hacky I'm ashamed of it so I won't post the code. I have no idea if it works anywhere other than firefox.
|
# ¿ Jan 16, 2019 01:42 |
|
my bony fealty posted:I am looking for a way to persist data between two separate front-end sites. Like a user completes one and clicks a button that directs them to the other, which is aware of what they entered in the first. Do different domains have access to the same local storage? I don't believe so. The way to do this is to maintain session, and, session information, server side. And have the server willing to communicate with both websites. The problem you will face server side is the same reason why clients don't support this by default, which is security. How do you ensure the person visiting the other domain is the same person? I think you need a server for each domain, and you need those servers to communicate with each other. Where you can make a request to the domain you are on, which handles the redirection, generating a session identifier for the other domain, so that you know it's the same user.
|
# ¿ Jan 16, 2019 22:43 |
|
GET /redirect-me-please Server takes a look at your existing session, stores it somewhere or sends it to the other server. Redirects you to /redirect-callback?sid=80801010101010. GET /redirect-callback?sid=80801010101010 Other server looks up your sid in storage, compares the storage date against a 6 second expiry, gathers your data together on its domain and generates your new session containing data from the other domain and redirects you to whatever you wanted them to land on. You can have as many query parameters defining this behaviour as you want but I don't think it can be any simpler than that. Even better would be using JWT, and signing it with asymmetric keys. So that you don't need a "magic key" that'll subvert your application, but instead a key from each server, which would be twice as hard to get.
|
# ¿ Jan 16, 2019 22:53 |
|
If you go the JWT route you won't need server side storage of the session which is even better really, because it's simpler as long as you understand how JWT works. You can just include all that data in the token itself and pass it to the other server as a query parameter. As long as the signature is valid you can trust the contents of the token and you're golden.
|
# ¿ Jan 16, 2019 23:08 |
|
HTTP is susceptible to man in the middle attacks at any step. ISP's even started injecting ads on websites they served, which pissed Google off as you can imagine. Entering anything on any form is completely exposed, as is what you view on the page and there's no way to know what you're seeing on the page is what you actually requested.
|
# ¿ Jan 17, 2019 21:35 |
|
I really never got around to making letsencrypt work either. As the certs expire seemingly daily and therefore you have to automate the certification process so that it can run all the drat time. Luckily my current webhost was nice enough to just have a script I could run that does it for me. Haven't had to think about it since. It was so nice to run that thing and it "just worked" you have no idea. Nolgthorn fucked around with this message at 00:11 on Jan 18, 2019 |
# ¿ Jan 18, 2019 00:08 |
|
Cugel the Clever posted:Like was said up-thread, you may not trust Google, but surely the EFF isn't out to destroy the internet? It depends whose financing it, who's in charge. What one person's opinion is regarding what destroys the internet is different from another. More important than that I think bad actors are drawn to whatever is the most powerful influencer at any given time, many of them have lots of money and can likely weasel their way in there. Maintaining a lot of competition is key. Currently if I decide I want to stop using one single thing, there's like 5 years of downtime while an alternative gets developed.
|
# ¿ Jan 18, 2019 11:25 |
|
This is the newest book on Amazon
|
# ¿ Jan 24, 2019 22:58 |
|
I use app because I copied and pasted it from a tutorial the first time I built one and suspect other people did too it's going to become the gold standard.
|
# ¿ Jan 25, 2019 18:41 |
|
Maybe I'm not understanding the issue. Being "logged in" isn't a concept generally on the server... your session might be getting stored in CouchDB but to retrieve that session you need to set a cookie in the user's browser that identifies it, and you need to get it again from CouchDB on every request.
|
# ¿ Jan 28, 2019 21:47 |
|
I like to set one or two things in a JWT including their user id, stick it in their cookies. Verify the signature when they make a request, look up the user by id, and bingo bango that's my user right there. I understand there's some insane people out there who think JWT isn't a good idea for session management but they are incorrect. Headless JWT is my personal favourite.
|
# ¿ Jan 28, 2019 21:55 |
|
I've found edge in a lot of cases works better than chrome or other competitors, it's got features and speed. I'm sure there are reasons for switching to webpack but it sure seems like it's going to delay their minimal 64-bit-only Windows Lite project. As webpack is still 32-bit.
|
# ¿ Feb 8, 2019 10:27 |
|
My understanding was edge was a rewrite from scratch, they ditched all backwards compatibility for ie stuffs
|
# ¿ Feb 8, 2019 12:14 |
|
Webpack, Webkit what's the difference, nobody knows that stuff mang. Practically identical things
|
# ¿ Feb 8, 2019 21:36 |
|
|
# ¿ May 16, 2024 08:15 |
|
Something like this will give you an email link and confuse bots.JavaScript code:
code:
|
# ¿ Feb 13, 2019 22:53 |