/wdg/ - Web Development General

Previous thread: >Beginner Roadmap and Overview
github.com/kamranahmedse/developer-roadmap
youtube.com/watch?v=UnTQVlqmDQ0

>Free beginner resources to get started
Get a good understanding of HTML, CSS and JavaScript.
developer.mozilla.org/en-US/docs/Learn - a good introduction to HTML/CSS/JS and Node.js or Django
freecodecamp.org - curriculum including HTML/CSS/JS, React, Node.js, Express, and MongoDB
javascript.info - curriculum providing a strong basis in JavaScript

>Further learning resources and documentation
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
hackr.io - crowdsourced collection of tutorials from across the web for learning languages and libraries (ignore sponsored stuff, look at upvotes)
learnxinyminutes.com - quick reference sheets for the syntax of many different languages (generally not sufficient on their own for learning something, but very helpful)
pastebin.com/gfBPg24A - Collection of PHP links.

>Asking questions
jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS
3v4l.org/ - Use this and post a link, if you need help with PHP/HackLang

Attached: 1520763440985.png (1280x720, 180K)

Other urls found in this thread:

artofmanliness.com/articles/how-to-quit-a-job-without-burning-bridges/
en.wikipedia.org/wiki/Non-compete_clause
auth.domain.com/as/authorization.oauth2?client_id=yuBv7hh7dpOQ&response_type=code&...
auth.domain.com.
jsfiddle.net/x7tzoj58/
twitter.com/SFWRedditVideos

first for, this is fucking boring.. I wish I could do something more fulfilling.

I'm got into coding recently and I plan to make a simple web SPA as my first project and then later make it an app for both android and IOS.

As I understand now, React is a good choice for my project. But since I plan to make a webpage and then "port" it as an app later, is my best option make the webpage first using ReactJS and then make the apps on React Native? Or do the whole stuff using React Native?

It depends.

React Native is not really similar to regular React and you would have to rewrite most of your code. Less if you know how to properly separate concerns between container and presentational components, but seeing that you're new then probably most of it.

this. I can't wait to die.

just make a progressive web app. you can even get an icon for normie phone users to click that mimics launching an app.

By default, React Native doesn't compile to webapp. There seems to be external tools for allowing that, but I'm not sure how good they are or exactly how they work. So you could try doing that if you want.

But if you want to write the web app first, and then port it to mobile with React Native later, you can reduce the amount of stuff you'll have to rewrite by separating your display code from your business logic. Because the JSX you write to generate HTML will be different from the JSX you write to create a mobile app UI. But any core code can stay the same since it's all written in JavaScript.

The second way is probably better as a learning experience, since you'll have to deal with the specifics of the web platform, which is good to know in general.

S O U L
C
R U S H I N G

how does one fix this
where do you get started with this

Attached: Screenshot_2019-05-28_21-14-40.png (1366x768, 70K)

better colorscheme and some formatter for php to make this readable?

it's only painful if you want it to be see

ggVG=
indented and use a better colorscheme

stop using frameworks
high level professional jobs are all about pure languages
up there on the pyramid, the performance and speed matters the most

Thanks!

>But if you want to write the web app first, and then port it to mobile with React Native later, you can reduce the amount of stuff you'll have to rewrite by separating your display code from your business logic. Because the JSX you write to generate HTML will be different from the JSX you write to create a mobile app UI. But any core code can stay the same since it's all written in JavaScript.
Yeah, I will be following this advice. Just to be sure, you are refering to Model–view–controller (MVC) architeture, right? I just learned how tthis works and this is probably the best way to go

Going to hand in my two weeks notice.

Oh boy.

Theres something called react-native-web now to do what you say. It's also pretty new so you'll probably have a shit time with it.

You can also consider using cordova or phonegap which just packages regular web code into mobile apps. And then you could use react or whatever you want in that and your code should be almost all reusable.

you don't see anything worng with the actual code in that pciture?

why

don't like your job anymore?

desu the code would be absolutely secondary for me, while the syntax highlighting and font looks like that

Yeah of course it's higher paying.
Why else would someone sit down and write COBOL for some boomer bankster or maintain some website that has to run on IE6 ?

I got an offer that pays 3 times as much.

I have no idea how to start this conversation.

>Hi, I'm here to hand in my two weeks notice

I guess that works

>3 times as much
woah nigga

artofmanliness.com/articles/how-to-quit-a-job-without-burning-bridges/

"I found a better offer."
Did you got your offer on Linkedin?

this , it's not readable with all that reddit spacing and long lines (without even line wrapping)

maybe you should try a real editor instead of vim (one with php tooling support)

not him, but what happens when the contract say you can't work for a competitor for at least 3 years?

Asspull, but I'm pretty sure that's not legal, they can put it in the contract, but you don't have to follow it, legally.

How many years of experience do you have

en.wikipedia.org/wiki/Non-compete_clause

>Just to be sure, you are refering to Model–view–controller (MVC) architeture, right?
There are various architectures that help you do this separation of concerns, but that's probably the most common one, so yeah, I would go with that.

the trick is to work remotely and trick your employers that you are some pro senior and ask for $5000 a month
anyone can do it, remote jobs are usually not complex huge projects like you would see if you worked in a company
its just some stupid shit like shops or whatever and your employer thinks that price you ask is legit

How do i get such a job though?

you look for companies that are looking for workers and offer remote jobs
if its remote then it cant be complex shit, no good company would allow their programmers to work on huge projects remotely, especially in the beginning, maybe after 5 years in office when you are high enough rank, maybe

And how do i trick employers that i'm a "pro senior"? I'd get fucked in an interview.

I see why they would do that, but effectively is a way to fuck over your employee tieing him up to it's current position, kind of fucked up.

>no good company would allow their programmers to work on huge projects remotely, especially in the beginning, maybe after 5 years in office when you are high enough rank, maybe
Total BS. I worked in webdev part time during uni and I could work from home anytime I wanted to. Worked on big projects too. Most employees worked from home atleast one day a week. All they wanted was you to let them know at the start of the week when you would be working from home. And obviously you have to be available in Slack/Discord/whatever, but that's pretty obvious.

I'm not going to say that company was great, but I wouldn't call it shit either.

>big projects

It is legal. They tried to make me sign a contract that said that when I got offered this job I told them I would sign the contract if they removed that portion. Then they said "oh no problem, that's just some boilerplate stuff our lawyer put in there". So they removed it. Moral of the story: always read your contract.

mother fuckers... thanks for the heads up

No, through Dice. Once I made my resume available I was getting constant calls

A little over 2. I kept jumping jobs for better titles and pay. After this I want to be a CTO somewhere.

Yeah, they said they pay greater than market average so I took a gamble and highballed at 150k. They accepted. I get to work from home too and I live in a really cheap town so it's going to be nice.

I wish I had read that. I basically just said I liked working there but another company reached out to me with an offer I couldn't refuse. I told him my plans for the two weeks to help ease the transition and that was it. No counter-offer or anything.

Congratulations user, I'm glad you made it.

write a code to find the last inserted row in table in mysql
no peeking on internet user? :)

Is it ok to write a trigger that fills in a new table with a string containing the fields and values inserted and the timestamp? Or I guess there's some built in function that tells you the last edit, like some kind of log or something.

I'm trying to understand how to scrape a site that requires login credentials (which I've exported to plain text in cookies.txt, a la Netscape), and I think it uses 'session cookies'. I've read many stack exchange links and both the man and info page for wget, but can't piece it together and I'm currently in way over my head. I could use some help forming a general plan.

I see on Firefox's 'network' tab within the developer thingy there's a bunch of GET requests that have encrypted cookie values. What am I looking for to pass to wget here? I believe I've found the server URL, but it's session-based too I beliebe (the URL depends on the host, is dynamic).

Hopefully some of this makes sense, I'm trying to logically order and clarify what is currently a confusing mess.

Attached: putin.jpg (269x187, 7K)

there's no correct answer. how's the data modeled? is there a timestamp? is there an auto increment id?

just inspect the headers in chrome devtools and compare what gets sent when logged in vs not logged in

pic related, where you should look in chrome.

then, when you've figured out the headers which send auth credentials, get postman and play around to see if it works

Attached: Screenshot 2019-05-28 at 23.21.38.png (996x605, 100K)

am i pleb for only ever using sublime text ? its pretty fast and smooth and light

>scraping a site
For what purpose?

it's alright. i use it too everyday.

based retard

i was just turned off by other alternatives that are essentially mini web browsers pretending to be text editors, written in javascript and whatnot
so obviously slower and clunkier than sublime
although i admit i never used IDEs, it seemed to me as overkill

also, would be a good idea to send all the headers with fake user-agent. Maybe the site has some code which inspects user agent etc and other headers for logged in users.. (most don't, big sites like amazon do, the warn users when someone from an IP outside of their location tries to log in)

Selenium

>compare what gets sent when logged in vs not logged in
I have to be logged in to view the page at all. When logged in I see a bunch of GET request containing encrypted cookies. The login URL is similar to
>auth.domain.com/as/authorization.oauth2?client_id=yuBv7hh7dpOQ&response_type=code&...
Previously I assumed that address changed depending on client browser, but the same (*exact*, checked with bash) URL brought me to the same page. Is this likely the 'server' I should be forwarding my cookies.txt to? The 'href' in the HTML says it's just auth.domain.com.

Just a thought dump for now. I'm trying to internalize and apply what you said, not sure what a 'postman' is but I'll figure that out. Thanks for the feedback.

>not sure what a 'postman' is
it's an app, helps you make requests (like wget but with an UI)

just replicate the headers from the browser (when logged in) inside of postman and see what response you get back

Attached: Screenshot 2019-05-28 at 23.51.09.png (1866x1182, 428K)

my mom's work schedule is posted with potential openings and shift trading options for differing pay, some of which is 3x the normal rate, so she tries to only work those shifts. a lot of valuable time is wasted staring at the screen, intermittently refreshing, trying to snag a good schedule with good pay multiplier, so I'm trying to automate it. So after I scrape it, I'll parse the HTML for what I want (ez), and then ideally when a new 3x pay multiplier is posted I'll have the program send some sort of email or sms.

they probably don't, but thanks. I actually have a nice fake user agent script somewhere. I scrape a lot of sites, but never ones that require login.

I don't think Selenium is necassary here, I just need to figure out how to use the session cookies I think and learn what the heck a post/get is.

>3x pay multiplier
Oh, forgot to mention it's first come first serve too - so speed is essential, hence the scraping.

I meant what specific thing he was working on, but don't let that get in the way of you calling people retards on the internet.

Cool. Be sure to test that shit thoroughly for real world edge
>what happens when I just sent an sms and a new opportunity comes up
>what happens when someone accidentally removes their listing and then post it again
>what happens when I'm already working during these hours
>how to deal with holidays/weird hours etc
because if the text messages look out of place and people find out about this her colleagues are going to royally pissed of.

you probably just have to send the cookie via header back, and you are logged in (pic related, works even for fb)

Attached: Screenshot 2019-05-29 at 00.01.37.png (1750x914, 126K)

Doesn't the cookie expire?

>Doesn't the cookie expire?
maybe, after 1 day or 2... or after the user logs out.

I have an interview as a front end developer tomorrow. I'm currently employed with my first job as a developer for a year. Any tips? I'm not nervous or invested in the position I'm applying for. It's more for practice I think. It's also through a recruiting company.

What is this "::" business and why is it not displaying on the page if it is not inside a tag?

Attached: 2.png (766x216, 33K)

How it is working as a webdev? I mean, what do you really do while at work? I'm still studying but I'm kinda insecure about this stuff

i could be wrong,and if i am the other anons can chime in and correct me,but i think its the "scope operator"it pretty much means to look for "before" within the global scope in this instance,i think.

Is there a difference between .class > div and .class div or is it just a personal preference?

I need to view Firefox requests that happen really fast, too fast too view in the developer view thingy. How do I do this? I'm the retard trying to scrape the site for mum.

The former selects only the children of the element with the class.
The latter selects all the descendants, no matter how deep they are.

jsfiddle.net/x7tzoj58/

How do I make sure A is always next to B, no matter how small you make the screen? Still using bootstrap.

Cool, thanks

I don't understand, how do I determine which URL or header is important?

they are always next to each other for me

I also don't know how to determine which cookie in cookies.txt I need, it's all very cryptic or encrypted, but I would be so happy to get this done today.

Based

>log in to website
>open inspector (chrome)
>click refresh
>click on first link in the network tab
>see the request header (cookie is there)

look at this image again

Attached: Screenshot 2019-05-29 at 02.12.07.png (1400x1050, 310K)

worst case
>wagie job at xyz corp
>shit pay
>long hours
>>hey user, we need you to stay overtime to finish project X
>>hey user, happy birthday, let's hope we get that Y into production ASAP
>>hey user, meet Panjeet Poo from Loo, show him the ropes please!
best case
>work at google/remote
>$$$ big bux $$$
>flexi hours n work when you have the inspiration
>>hey user, could you stay overtime? you'll get time+half and we'll order in some food! (plz say yes we want you here)
>>hey user, happy birthday! you didn't have to come in today
>>hey user, meet Bjorg from Nordtopia, he's smart n shit and will be working on Z and it would be awesome if you could collaborate with him!

>log in to website
ok, so enter the log in information, and let it escort me to the next screen, THEN open the inspector and refresh? I will do that now, and post the first link in the network tab.

Do companies hire new grads for TS or should I just stick with JS and some JS frameworks?

>Nordtopia
You delusional circlejerking Scandicucks always crack me up. I've been there, it's a dystopian muslim filled shithole.

the url is not important, just the cookie (it contains your token which identifies you to the server). Try copying all the contents of cookie into postman, like here and make a get request on the site

oh, and I also have to hop through a few intermediate links after logging in, hopefully that doesn't screw up the process. anyway, here is the network tab fella

I've tried to figure this out myself all day but I'm too retarded, pls spoon feed, i promise I'll finish the MDN course after this

Attached: Screen Shot 2019-05-28 at 5.26.06 PM.png (1275x657, 229K)

>Try copying all the contents of cookie into postman
you mean my entire cookie.txt?

that's the response header, find the request header

probably, you'll see everything in the request header (you can copy the cookie from there to, or write document.cookie in the console)

Also, don't post images in here, someone might login into your account

I was a bit sketched about posting an image to, I didn't see anything confidential btu I deleted just in case. I was kind of happy to see this returned from Postman. It doesn't let me copy my whole cookies.txt though. I found a couple request headers, does it matter which I use?

Attached: Screen Shot 2019-05-28 at 5.37.21 PM.png (895x446, 123K)

>typeof NaN === 'number'
true

Do people still use unordered lists for menu items or do flexboxes do a job better?

just copy all the properties that you think are important for auth from the request header (cookie, user-agent, maybe some custom header properties etc) and it should work...

so scrolling down a bit the request header was right there (duh). Only a select few of the things in here have cookies though, and they are all encrypted names from what it looks like. not sure how to proceed here.

How would I learn enough of this to not require spoonfeeding? I don't think I'll be able to pull this off tonight.

just copy it all (you probably don't need all properties, but whatever) into postman and send a get request to the domain... see here

I'm not sure where I'm blundering, but it might be worth mentioning all my current attempts are bringing me to the (non-local) login page (after downloading from Postman and entering "file:///path/to/scraped.html". It just loads for a bit then goes to that page. Do you think that may have to do with 'session cookies'?

getting a 'u don't have access' now, as an update

it gets hung up on the SAML http thing it seems

does postman allow offline viewing of webpages I scrape?

Time tow write some crazy garbage spaghetti code with nested for loops and index fuckery, just to make an html table just werk

>click on first link in the network tab
so, the request header of the first link in my case did not have cookies associated with it. There are several links with cookies, but I can't get any of them to work (it either brings me to the login screen or the access denied page).

To be clear, these are the steps I'm taking:
>open browser (included for posterity sake)
>login into page, navigate through 3-4 links until I get to my desired page
>open devtools (err, click inspect in chrome)
>refresh page
>copy URL of page I want to scrape into postman as a "GET" request
>enter "cookie" in key field, leaving value blank
>clink first link, view headers, esp request header
>notice there is no cookie
>scroll through links until I find a cookie, try pasting it as the value
>send request, download file, view in chrome /FF
>not the page I want, it's a login page or an access denied

oh, forgot to mention that after it fails, I try again with the next cookie value until I'm out of cookies. I tried passing more than one cookie with the GET request, but it failed.

just discovered learnenough.com

Unironically greatest learning path and guide for beginners I have ever run into (except for Ruby on Rails that sucks ass and nobody is interested in)

Attached: 15163518.jpg (337x343, 49K)

How do I save images to S3 but link their URLs to specific documents for my mongo db?

TS as in typescript?
It's just a subset of javascript. Primarily used for Angular 2+ (although it can be used in React, Node, etc). So if a company is using Angular 2+ then yeah, they'll want you to know Typescript. However if a company primarily deals with React they'll want JSX, ES6 more so than TS.
That being said, Typescript is absolute comfy tier.

If you learn Angular 2+ you'll learn Typescript along the way.

not him but there's a job offer I want to apply to that asks for C# and ASP.NET knowledge, Javascript and Angular but no Typescript.
Do you think it would be faster to learn ASP.NET or to learn Angular? I have to choose which of the two I will be lacking.

Attached: 1516403962422.gif (750x750, 16K)