What's the best memorystore to use for session management with node.js? Redis? I've previously just used noSQL databases as my "store" before and have yet to have any performance problems with them. Is redis just a meme?
Juan Smith
trips for truth
Joshua Thompson
How well did I implement prepared statements? Am I protected from SQL injections now?
Tyler Phillips
Redis is fast as fuck and very useful for caching.
Jose Moore
$result should be $r
Nathaniel Young
at what point do you see a performance gain? I've got two sites that average 10k+ users a day and all they are is dedicated boxes, never have any performance problems. I was just looking at redis in case they get any larger.
James Edwards
>be me >looking to hire web dev >contact web dev >tell him i want to buy the script which hes already sold to 3 other people >giveawayhopper.com/ >marvelousga.com/ >simplo.gg >tells me no he cant because it's unethical
seriously, what the fuck is up with web devs who actually give a shit about ethics, so what if a potential client wants you to clone a website, why do they give a shit so much? this fucking bothers me man...just take my fucking money and do what i want you to do
now have to go search for a poo in the loo web dev to do it
ps. how difficult is it to build a site similar to those i posted?
if any devs here can clone that script i'll gladly pay $100-$150 (that's how much the original creator vasco charged, hes not selling it any more)
Luke Kelly
Use prepared statements and parameterized queries. These are SQL statements that are sent to and parsed by the database server separately from any parameters. This way it is impossible for an attacker to inject malicious SQL.
You basically have two options to achieve this:
Using PDO (for any supported database driver): $stmt = $pdo->prepare('SELECT * FROM employees WHERE name = :name');
$stmt->execute(array('name' => $name));
foreach ($stmt as $row) { // do something with $row }
Using MySQLi (for MySQL): $stmt = $dbConnection->prepare('SELECT * FROM employees WHERE name = ?'); $stmt->bind_param('s', $name);
$stmt->execute();
$result = $stmt->get_result(); while ($row = $result->fetch_assoc()) { // do something with $row }
If you're connecting to a database other than MySQL, there is a driver-specific second option that you can refer to (e.g. pg_prepare() and pg_execute() for PostgreSQL). PDO is the universal option.
Landon Cox
trivial
the only part that will take any time is making it look visually distinct.
Easton Butler
>trivial
some people on reddit are quoting me $1000~ for something like this, fuck sakes
no wonder why people hire poo in the loo freelancers for this type of shit
Jose Hughes
the poo in loo will probably take your money and not deliver a working product,
you aren't paying for the difficulty for the engineer, you're paying for their hourly rate.
although people on reddit are probably bottom of the barrel retards
Daniel Harris
Depends on the site and how cacheable it is. Database is where most of the performance goes so any roundtrip to the DB avoided is a win, and if you can return cached responses without even connecting to the DB you're off to a good start.
10k over the span of a day isn't really in the area of needing a lot of caching although it can help with spikes.
If you have anonymous users it's probably easier to just enable nginx caching and set it to 5s or something.
Joseph Gray
they are logged in users, not anonymous.
James King
Just cache what you can that's the same for everyone.
Hudson Johnson
I am making a simple 10 or so page website, and for every page I am copy and pasting the header and the footer, and if I need to change either, I obviously need to go through every page and make the same change.
What is the sensible way of fixing this, I know it isn't right.
Andrew Moore
So xampp has PHP Version 5.6.28. Does that mean I don't have to do download a driver for PDO? Or do I still need to download a database-specific PDO driver?
Gavin Torres
what framework are you using? If you're doing MVC, there's a very easy way to do that. Just use a shared view or something like that.
Kevin Johnson
What language are you using?
Tyler Young
Oh sorry, It is just a HTML, CSS, JS site.
Owen Nguyen
basic concept is like this [header] [display] [footer]
You just swap out what's in display when the page is changed.
Tyler Stewart
The specifics will depend on what language you're using, but what you basically want to do is create a 'header' file for all your common header stuff (logo, nav, shopping cart, whatever) and a 'footer' file if you need one, and simply call those files at the top and bottom of each of your templates.
There are more automated ways to do this if you use a framework, but it sounds like a simple site so start simple and embrace includes.
I think what he's asking is for a templating engine for HTML. Like in PHP where you can create one header file and one footer file, then include it on the pages where needed..
--regular HTML/PHP Code for each page.
Carson Stewart
A JS templating engine would do the trick for a static site, I think.
Michael Gutierrez
Sounds like a JS templating engine is the way to go, no need to add another language that I am not familiar with into the mix.
Cheers for the stack link
Nathaniel Nguyen
OhHereWeGo.jpg
Jayden Scott
What do you suggest if server side languages aren't an option?
Ryan Morgan
Person asking about including 1 header and footer file in every page here, I saw some mention of Jade, a preprocessor, would that be easier and more "Compatible"?
Nathan Wood
You can make a simple sh/python/whatever "makefile" yourself to propagate your header and footer to your webpages when deploying. I ended up doing something like that a while ago iirc
Jack Cruz
tfw prototypes too hard to understand :c
Austin Miller
Single page application, loading content using ajax
Adrian Turner
And where will that content come from?
John Lee
From .html files poo.html = contents of poo loo.html = contents of loo
$('.poo-or-loo).load('poo.html');
Wyatt Thomas
My website is less than half the size of Sup Forums's javascript even when you load a 1024x1024 PNG
the fuck is up with that
Ryan Brooks
You forgot to load the botnet in yours, my friend
Jackson Taylor
Newjobfag here
Just finished my first day as a web developer
After orientation they parked me in front of a TV and had me watch six hours of Magento tutorials
Yee haw
Benjamin Reyes
I'm still writing my image board and just completed the thread rendering.
What do you think of the desgin? I don't want to totally copy Sup Forums but that simple old-era desgin is just comfy. The color scheme still sucks, I know.
Joseph Ortiz
What is it? Fake steam oauth? I'll do it for 5k
Parker Peterson
Oh fuck, of course. Yeah, do this
Lincoln King
My first day they had me build my computer and install their Windows stack with no documentation. I wrote their documentation on my first 3 days.
Magento though. There's a place by me that's been looking for Magento PHP devs for over 2 years. 60k too. I don't know SOAP though so I couldn't pass their test.
Brandon Roberts
Why are you using num_rows? Password verify works perfectly with glorious bcrypt.
Kayden Allen
do all modern browsers support flexbox?
Jonathan Hall
>caniuse.com search flexbox
Jordan Carter
Just use a static site generator like hugo or jekyll
Grayson Gray
Has anyone here actually done work remotely (not including Freelancer, Upwork, etc)? I'm trying to but I can't find shit. I've been applying for a year now and nothing, luckily I found something (shitty) locally that I can do for now.
Tyler Perry
>yank out a modal >snap some excel file on it for import to db >use some retarded ajax hack to push the file inside a c# ajax form to a jsonresult action so i can display an error because fuck scripts even though im using a script to throw the damn thing in. >shit works but when iterating i have to make up for every exception or the exception goes along iterating with what im iterating so it gets stuck on the first last good iteration thinking the next iteration is also throwing the first exception until the last iteration.
how do i git gud?
Colton Richardson
They are using a lot of shit but mostly reCaptcha and prettify and making is heavier.
You know these evil scripts are all cached in your browser, right?
Lucas Phillips
For argument's sake lets say I'm a Pajeet and I want to register with Adsense. Now, Adsense pays out lower cash to people outside the US, how do I register myself on adsense as a US citizen with a US address while overseas? Is there a service that does this?
Adam Adams
Marry an american whale.
But honestly, don't even try, it's complicated to do it correctly and you could lose a lot if you get caught.
Can you be my white American whale? Seriously, I'd only need someone to open the letter and send me the code so I can verify that as my address.
Camden Foster
I would say befriend an honest USA webdev or wherever pays well, just give them your websites to put ads on and give them a good split. If they jew you then you just take the sites offline or take out their ads.
Cameron Nguyen
Check out some type of PO box service. I'd imagine someone has set something like this up in fact I just google it.
You can bet google has all of those addresses logged and banned already. Google doesn't fuck around. None of the advertising servers fuck around, but Google's on another level.
Go look at any pajeet forum trying to do the same thing.
Jacob Smith
I should ad(:^)) that google does this thing where they will let you grind out ad revenue right until a few dollars before cashout then ban you. That way you worked for free and you can't do shit because you broke tos anyways.
Brody Barnes
How do I fix this bug:
I'm doing a bunch of async JS requests. When they are finished they concatenate their result to a HTML div. The problem is the requests take unpredictable amounts of time and the order gets fucked up often.
Levi Young
You using promises or what? Just check if something has a value before posting, if not then loop again.
Alexander Anderson
>just give them your websites to put ads on and give them a good split This wouldn't be necessary though. Last time I checked Google doesn't check if you're an American citizen or not, the only thing they confirm is your address by mailing you a unique code to be used for verification. Once you verify you've gotten the letter that address goes on file, then you can cashout through Western if you have the MTCN #.
As user said it's probably banned. I thought of this though.
Benjamin White
Callbacks, or promises.
James Ward
I need to interview web developers most of this month - i'm looking for people with Angular2 experience, which is a rare find in my city.
AngularJS seems to be a runner up, with general javascript/jquery coming up after that.
What is the best way to test these candidates ? I much prefer having them write a bit of code during the interview just to get a handle on how they work (its not so much of a test as a conversation, working together, 'open book' type thing).
Any ideas on something bite sized that can be worked on for people with experience in any of the above areas? (NG2, NG1, JS+JQ)
Just trying to cull the list.
Owen Fisher
It does use callbacks
but they all add the string they get to the same string in the callback
I think it would just be easier to give them IDs and sort it. I never got javascript async and this doesn't need to be that fast
Cameron Johnson
literally just use promises, dude. Chain each promise using .then()
Christian Jackson
Hire me senpai. You get the added bonus of having me work remotely so you won't see my ugly mug every day.
Ryan Butler
Make them invert a binary tree on a blackboard. Nah I don't know, I'm in no position to give advice to an interviewer but the only thing I care about js devs is that their code isn't tighty coupled to itself (like functions doing 10 different things and stuff like that).
Bentley Davis
Have them create a simple RESTful web service with HTTP. You can even start them out with a simple HTML form with a route already assigned.
If they can't do this or at least conceptually draw it out for you, then you don't want them. They won't be fit for web dev, even if they are just going to be doing fronted Angular stuff.
Google just wants you to call it AngularJS from now on.
Dominic Ortiz
So are you HR scum or what?
Nolan Lopez
But how should you protect a site from dumb spam bots?
I can't ban every IP that spams cause that would fuck up VPN people. Recaptcha is the only effective captcha all others get bypassed by neuronal networks.
Aiden Baker
question how would you traverse through an array with a recursive function without mutation in js
Noah Watson
Never really worked with Node.js before but how does one do worker threads in this language?
I have an async function that scrapes a website but it takes too long for an AJAX reply so I'm having to let it get executed in the background with a job object reference.
This is so that the client can poll the server for the job status.
Caleb Bell
Redis is perfect for any short-lived data, and it has a reputation for having a very nice codebase
Henry Bell
Finally got my first real project!! Very excited!
I'm making a webpage for a small business.
Please share any suggestions or inspiration here.
Share your wisdom web dev masters...
Jason Moore
Make a header.vue file. Then make a footer.vue file. Then use webpack+vue+vue-loader to inject those into the page. plus you also get a bonus of a full-spa app + routing and MVVM goodies
Samuel Cook
Don't use Nosql
Ethan Martin
Isn't this the exact use case for promises?
Lucas Young
The function I'm calling is a promise (async function).
The thing is that I don't care about waiting until it's done. That job.id will be sent back to the client through a HTTP response and the client should poll the server every x seconds for the job status.
Sebastian Green
Your idea sounds fine, what exactly is the issue?
You could use websockets if you're doing lots of requests I guess.
Nolan Cooper
The issue is that I'm just calling the promise (the scrape function) with no await/.then() call. I'm doing this because I just want the scraping to run in the background.
My IDE is nagging me that the promise returned is ignored. Apparently it's a code smell.
Nolan Peterson
Maybe just .catch the error and log if there's an error?
Ryan Bennett
Don't use Angular and
Gabriel Walker
Agreed. NoSQL is just a meme. It's used for all the wrong reasons, especially in web dev.
Jace Adams
i think i made a big mistake writing a pretty much static website in react for a small business
Cameron Morgan
is there a tried and tested php PDO library for sql queries? kinda hard to filter shit results on google
I read that React/Redux were the cool new things that everyone should be using instead of jquery from now on so I tried them full on (React/Redux/Router v3/Saga), but recently I read that SEO is crap with React and only google indexes React sites and I have no idea how to set up SSR and whatever else is necessary to fix it. Everything would've been much easier with just static html and jquery for some dynamic components.
React is overkill for projects that don't have a lot of state-based components. I doubt a local company has a lot of that.
Gavin Hall
BTW, if anyone can provide me with a good example of a business app.
Because right now I got a landing page, and that's pretty much it. I would like to see how these apps are commonly done. How they are using databases, etc.
Any link to a project (github or otherwise) is very highly appreciated.
Joseph Mitchell
just use express with jade, and $database_of_choice for the storage if you're wanting to learn javascript.
What are you actually trying to do?
Adrian Gonzalez
>just use express with jade, and $database_of_choice for the storage if you're wanting to learn javascript. >What are you actually trying to do? Getting experience is the goal. I am making an application for a small business that sells machinery to kitchens across the world.
There aren't any firm requisites. The page for the business has to be good, and it has to attract customers.
What I got is a landing page in static HTML and CSS - that's all. I'm setting up the server side with express, so far just rendering .html. No need to utilize templates ?
So chiefly I'm looking for inspiration and ideas. I really want to make this webpage good. Any primers greatly appreciated -- first job here!
Sebastian Davis
jade is a templating language, let's say we have a bunch of different machinery objects that each need their own webpage with a description. you can have a jade template that formats the information about objects into a webpage.
Are you going to be gathering user data (logins, etc.) or will it be a primarily informational site? If the latter, the most important thing will be styling the information in a pleasant way and making everything load quickly and efficiently.
Oliver Walker
I'm currently using mysqli, should I switch to PDO to support more databases?
mysqli is pretty comfy, prepared statements work well and fetching is fast enough.
Chase Gomez
This is my first project, so I want it done and done well. As of now, it's a landing page making a sale. It's got leads and offers and a contact section that sends an email.
This is all as of now. Please expand on user login...
So it's primarily informational. Should be simple, but portfolio worthy. Looking to expand it from here.
John Martin
React was created to solve some specific problems that probably don't exist in your application
>In a traditional JavaScript application, you need to look at what data changed and imperatively make changes to the DOM to keep it up-to-date. Even AngularJS, which provides a declarative interface via directives and data binding requires a linking function to manually update DOM nodes.
>React takes a different approach.
>When your component is first initialized, the render method is called, generating a lightweight representation of your view. From that representation, a string of markup is produced, and injected into the document. When your data changes, the render method is called again. In order to perform updates as efficiently as possible, we diff the return value from the previous call to render with the new one, and generate a minimal set of changes to be applied to the DOM.
If your state isn't constantly changing, react might not be the solution for your use case.
That is why I suggested a simple template for now. That way you can render the basic stuff easily and, as you add features, you can easily extend by creating new templates.
By logins I mean--is this an ecommerce site? Will people login and try to purchase things, will they put their data into a form and something will happen?
Brody Richardson
BTW: A page where the current storage of machinery is displayed would be great.
So I could my client/friend with a provide a monthly update on what he got stored.
So a simple database solution? Any suggestions welcome.
Jayden Perry
The reason a templating engine might be a better option for now is that it's simpler and you can add react if you want to introduce some significant complexity later on.
This will reduce your headaches and will allow you to make changes quickly and slowly build up things.
Bentley Williams
How will you get data to put into this? Will the data be entered manually or do they have some kind of database already?
If manually, you'll have to create an interface for your client to input data into the database. Then you will post that data to the backend and store it. Any database will work (ignore the memes), just learn one.
Will it be client facing, facing to the public, or internal only (requires a login or some kind of authentication?)
Levi Fisher
MySQLi is good, so if you like it, you can stick with it. But PDO seems better in some cases.