/wdg/ - Web Development General

What music do you listen to while writing your jQuery code, /wdg/?

Previous thread: >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 (independent of your browser choice)
freecodecamp.com
codecademy.com
hackr.io

>Further resources
developer.mozilla.org/en-US/docs/Web - excellent documentation for HTML, CSS & JS
github.com/kamranahmedse/developer-roadmap - Frontend+Backend learner-path suggestions
youtu.be/Zftx68K-1D4 - Web Development in 2018

jsfiddle.net - Use this and post a link, if you need help with your HTML/CSS/JS

Attached: L-974084-1456600468-2542.png.jpg (264x300, 12K)

Other urls found in this thread:

eslint.org/docs/rules/no-return-await
youtube.com/watch?v=vTIIMJ9tUc8
developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis
jsfiddle.net/nw3x2ueu/3/
4stats.io/
dev.4stats.io/
jonathas.com/token-based-authentication-in-nodejs-with-passport-jwt-and-bcrypt/
tools.ietf.org/html/rfc6749
redditblog.com/2005/12/05/on-lisp/
github.com/reddit-archive/reddit1.0
jsfiddle.net/epw8po7q/1/
twitter.com/SFWRedditImages

const StorageCtrl = () => {
return {
store: (item) => {
localStorage.setItem('detnotes', item);
},
retrieve: (item) => {
localStorage.getItem('detnotes');
},
clear: (item) => {
localStorage.getItem('detnotes').forEach((value) => {
if (item === value) {
console.log(value);
}
})
},
clearAll: () => {
localStorage.removeItem('detnotes');
}
}
};

console.log(StorageCtrl);

StorageCtrl doesn't contain any of the functions I have in the object literal whch is supposed to return all these functions, according to the console. What gives?

console.log(StorageCtrl());

Woah.

Now, see, I don't get that. Why would it not list everything in the function if I console.log it without calling it? When I log StorageCtrl without calling it, the console says its length is 0, which is clearly false when there are functions returned in the StorageCtrl parent function.

Opinions on asp.net?

Because it's a function. I didn't even examine your code, just saw that you were calling a function without braces.

I'm no genius, but I'm pretty sure you need to call the function in order for the engine to understand what is going on. When you just call `StorageCtrl`, you're not invoking the actual function, but just calling the function name, so I think the engine stops right there, and doesn't go any further to see what the actual function does.

>the console says its length is 0, which is clearly false

Wrong. the length here is the number of arguments that the function takes, so since StorageCtrl doesn't have any arguments the length is 0.

You can see the number of arguments a function takes by doing
[function name].length

never used it

Why would i ever use %d over %s? I understand that everything gets rounded down, but what if i need the exact amount on integers?

amazing for low level control, but really robust
not really required for 90% of web

%d -> integers
%s -> strings
%f -> floats

%3d -> integer with 3 decimal places i think

and so on

ohhhh thanks

Why are you even asking this in /wdg/?
/sqt/ is where you need to go newfag. Or even google the fucking answer, it would have taken you 10 seconds

I always ask here, everyone is so nice and quick to help here. I like it here

>he doesn't have a private notepad in the browser


body {
max-width: 707px;
margin: auto;
padding: 4vw;
font: 1rem/1.8 sans-serif;
color: #002b36;
background: #eee8d5
}
img { max-width: 100% }

How does that work? Save it as a file and open locally?

yes. save as html file and open it

Neat I guess, I'm trying to make it into a bookmarklet right now

javascript:
var code='
.. stuff from above but it's triggering some sort of firewall when I try to include it...'
,tab=window.open('', '');
tab.document.open().write(code);


It isn't quite working. It works but Firefox thinks it's opening a duplicate of the current tab.

Also, when I tried to post that post but with your code block above, I got an instant Connection Error. I guess some sort of cloudflare DDOS protection has a false positive?

"await" should even be omitted there
eslint.org/docs/rules/no-return-await

this is what you get for not using type checking
pic related

it's okay, but pretty useless as long as spring exists. also .NET core has still a long way to go. a friend told me that they've wasted a lot of time fighting EF core at work and then just went back to the regular one

you can just add "data:text/html," in front of and then literally paste it directly into the address bar
works on chrome, firefox has some problems ("data:text/html," works there though)

forgot the pic of course

Attached: ss-2018-05-06-11-17-40.png (645x272, 12K)

>firefox has some problems
I had to inline the style and convert the hex colours to rgb but this works in firefox:
data:text/html,


Thanks for the data:text/html tip.

>What music do you listen to while writing your jQuery code, /wdg/?
youtube.com/watch?v=vTIIMJ9tUc8

>useless as long as spring exists
fucking javafags

>accused of only being popular cuz sxy babs in his videos
>make video depicting only self
>become worldwide sensation
>tfw based pajeet

Attached: Daler_Mehndi_on_Stage-2.jpg (640x427, 55K)

the first argument to "setTimeout" is a string, it will be implicitly "eval" ed

setTimeout("var foo = 'top kek';", 0);
setTimeout("console.log(foo);", 0);

>be you
>turn audio on
>open browser dev tools
>paste the code
window.speechSynthesis.speak(
new SpeechSynthesisUtterance('Hello /wdg/')
);


>????
>profit

>open browser dev tools
>paste the code
window.speechSynthesis.speak(
new SpeechSynthesisUtterance('I am a faggot')
);

>Enter, Press up, enter like 50 times.
> ????
>everyone at library looks at you and shakes their head.
>not profit

noob here

I'm just learning the basics of how to use gulpjs

At the moment all I'm doing is writing some CSS (sass) and Javascript to a new directory

How can I set up gulp to run a virtual php server so I can ditch apache?

Attached: DFEO1pi.png (1141x831, 154K)

>library
you are on a library on a weekend?

Interesting. Is this intended as an accessibility feature?

It's an experimental API.

Maybe you want your app to have some type of voice speech, i dunno.

developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis

Attached: 1523289168666.jpg (357x334, 46K)

I just prefer to internet and code at the library
I get to be in a nice room with art and all that, look at the city through the window, get some sunshine, be around people, and occasionally meet someone new.
Same reason people internet and code at a coffee shop, I guess, except here there is less distraction (no annoying 17 year old girls yelling) and no expectation to pay any money.

you don't do it at home too?

Hi. Why I can't see the gid?

Attached: Screenshot_8.jpg (1277x543, 90K)

What's up with node.js? I'm trying to run a function through it and it's unable to use map(), forEach() and it says that my array is not iterable if I try it with a for of loop. What the fuck.

I'm not interested in learning node right now, I just need it for this little thing.

whats your shit look like bruh??

it's the function from the eloquent example, current version is this,

jsfiddle.net/nw3x2ueu/3/

it performs like it should in the browser, it transforms the array of roads into an object blah blah blah for the dijakstra moudle

which Node version are you using?

v.8.11.1

can you post the exact code thats giving you the error?
You aren't trying to iterate over the "graph" object, right?
Also why create the object like that instead of just doing "let graph = {}" ??

Oh God. I misspelled the word

for (key of edges) {


Type Error: edges is not iterable
at buildGraph graph.js 5.13;
at Object. graph.js>20>18
at Module._compile (module.js:663:10)
at Module.load (module.js:565.32)
at tryModuleLoad (module.js:505:12)
at Modul.............. and some other shit

It worked yesterday on another function, I need to go now, been doing this for too long today. Thx for the effort guys.

don't know really
On version 9.5 at least I am running
function buildGraph(edges) {
let graph = Object.create(null)

for (key of edges) {
graph[key[0]] = []
graph[key[1]] = []
}
for (key of edges) {
graph[key[0]].push(key[1])
graph[key[1]].push(key[0])
}

return graph
}

const roads = [
"Alice's House-Bob's House",
"Alice's House-Cabin",
"Alice's House-Post Office",
"Bob's House-Town Hall"
]

console.log(buildGraph(roads.map(r => r.split("-"))))

without issues, but even version 8 should handle for...of just fine

coming back to my post from ~1 week ago I tried to update the layout a bit and make better use of the screen area.
The sticky column on the right was a bit tricky to get right, but I personally like the way that works now.
Color scheme might be a bit bland.

old: 4stats.io/
new: dev.4stats.io/

Honestly interested in any feedback or ideas regarding the layout, but also regarding its functionality.
Looking at the same page for hours on end you lose the ability to spot some obvious retarded things I guess.

Attached: dev.4stats.io_ (1).png (1920x800, 358K)

i'm making something similar to "reddit" (god forbid)
should i make it a single page web app with react or do more traditional different pages with http get

NODE_ENV is: production
enforcedClientVersion is: 26


i feel like the setting page is a little bit amateurish with those buttons.

You can use drop down buttons with a check mark for example, to avoid posting 50 buttons.

Also, how is the "users on site" implemented in java script? you check for active connections, i guess?

Attached: mockups.png (800x600, 180K)

brah

Attached: DUDE.png (1315x575, 94K)

is this a pet project or you plan to take over reddit?

it is not competing with reddit in anyway. just similar style subforums etc

thanks for the reassurence, I will try it with another version

anyone know a good resource to learn about authentication/authorization, specifically about refresh tokens?

The top Google result is essentially an ad for Auth0, and the top Stackoverflow responses are contradictory.

I'm not going to be using a separate auth server with Google or FB or w/e. My auth server and resource server are the same. All these resource seem to be about the separated case w/ OAuth2

This article helped me a lot with Node js and token based authentication:
jonathas.com/token-based-authentication-in-nodejs-with-passport-jwt-and-bcrypt/
Hope it helps.

holy shit sublime really cracked down on shared licence keys

Really? What happened? Who uses Sublime anymore now that there's VSC?

tools.ietf.org/html/rfc6749

you could've just google a licence key from some github gist and it would've worked for months, years even, but now it's deregistered in hours

i prefer sublime over vsc because it offers really nice batch text editing quirks similar to vim

What browser version is that specifically?
I also just fixed something scrolling related, but I don't know if it's the same issue.
yeah it definitely is.
I always told myself to do it properly, once I had some additional useful options to add on that page.
Should see how I can make it a bit nicer.
>how is the "users on site" implemented in java script? you check for active connections, i guess?
yes, the active websocket connections
On each socket connect/disconnect, the server sends out the updated usercount to the clients. (with some debouncing, not that it really matters when there are only 2-3 users)

Any self taught front end web developers? Any success stories? I’ve been learning web dev on my own for a quite a while. HTML and CSS are pretty easy and I’m getting the hang of JS, syntax atleast. But am I fooling myself without any certification? Just building a portfolio?

> but now it's deregistered in hours
Wow, rude. Yeah, I know of the available keys, still, I never felt like using it.

> because it offers really nice batch text editing quirks similar to vim

Maybe there's a vsc plugin that could do that for you? I use both vim and vsc and I had no problems configuring vsc to my liking. There's even a vim plugin available on the marketplace.

Also, you could just disable the license notification popup, though you probably knew that.

>What browser version is that specifically?
Firefox Quantum 59.0.3 (64-bit) on Windows 10

hey anyone knowledgeable on chrome extensions?

I just published my first one. What do you want to know?

what idea do you have in mind?

what does it do?

Hey Jow Forums. I'm a professional full-stack dev who wants to help beginners. I don't want to write the same "learn html" stuff, so I was wondering what issues people specifically have with web development that aren't commonly covered. Like hosting maybe, working within a team, version control etc? Any ideas?

I have it atm it lets you download YT videos, three problems are
>can't get it to work in a pop up (im waiting for a specific network request, works in debugger mode though)
>can only download audio and video separately (this is due to the network requests from YT, load a video go to network and look for XHR that are videoplayback?....)
>can't think of a way to merge said audio and video files.

hosting is a pain in the ass, i think. depends on the service you use (AWS,...)

What do front end devs that make 200k actually even do? I do front and backend work at my job but I plan on moving in a couple years and will be aiming for a higher salary but I don't know what I should be doing to ensure I get that

oh uh pic related i guess? it waits for 3 network requests before displaying audio and video dl links

Attached: picrelated.jpg (1530x737, 872K)

Is it good practice to avoid using jQuery?

depends on what you're doing, a lot of places still use it so at the very least it's worth learning. You should still know vanilla JS though.

What is the best mean + Universal boilerplate?

Can anyone tell me why postQuery is being attached to props as an object and not a function?

Attached: file.png (1787x705, 67K)

What language is this? It's hideous

show me a beautiful language

Attached: 1525098020323.jpg (2480x3507, 2.89M)

javacsript + GraphQL ?

The error is because there is not such function defined in this react class and you are trying to access it using this.props.X

Absolute newbie here, why does this not work?













Local page
Google
Fake page

I can put local html pages inside the frame just fine. But when I try to load a webpage, I just get a blank white page. What gives?

isnt that being taken care of at the bottom?

CORS related I guess

it runs fine on a single file, it's a commonJS issue, or my limited understanding of commonJS, this is what I'm inputing into the function, no idea how to get rid of it or why the "undefined" is even there.

Attached: New Bitmap Image.jpg (424x255, 44K)

How do I pick good fonts for my website?

if you are importing the function from a separate file, post the content of the 2 files as pastebin links or something like that and someone will probably be able to tell you what's wrong

This question is one which is looking for a spoonfed answer.

Use whatever you find most useful. Everything works, effectively. It is possible to write a reddit clone in Assembly.

reddit itself was born written in Lisp.

redditblog.com/2005/12/05/on-lisp/

You can produce a similar site with any set of languages. Use whatever you are most comfortable with.

>reddit itself was born written in Lisp.

*Common Lisp

github.com/reddit-archive/reddit1.0

>tfw you know how to do something but you can't be assed to do it
Vanilla JS fatigue, think it's time to pick up a framework and get going on those big projects.

watched a tutorial in hindu and understood it, it was 6 minutes long, a deconstructed variable caused the shitshow

I had const {build} = require("./graph"); for whatever reason

here the whole thing for transparency
jsfiddle.net/epw8po7q/1/

was fun

Udemy was recommended to me, since it's having a big sale on most courses. Would I be better off using the (free) resources in the OP?

>gulp

why are you learning deprecated tech user?

>r.split

???

>since it's having a big sale on most courses.
Really does it..
Udemy is infamous for always being "in sale"
It's some gray-area scummy shit.
You might even open the site in 2 different browsers or private browsing mode and get different discount percentages.

Anyway don't sweat it. It's going to be on sale next week and the week after.

What would be the absolute bare minimum I need to be able to land remote web dev jobs?

What needs to be in my portfolio?

How long would it realistically take to become a webdev if I spent time in courses and studying on my own for about 5 hours a day everyday?

all depends on how fast you can pick it up/ if its your thing?

Does mongoose still need the .exec() function to work?

i'm a quick learner, 2 to 3 months?

You'll have to have some kind of github or portfolio so keep that in mind

Attached: 1523209326261.jpg (1200x1187, 177K)