[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vr / w / wg] [i / ic] [r9k / s4s / vip / qa] [cm / hm / lgbt / y] [3 / aco / adv / an / asp / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / qst / sci / soc / sp / tg / toy / trv / tv / vp / wsg / wsr / x] [Settings] [Search] [Home]
Board
Settings Home
/g/ - Technology


Thread archived.
You cannot reply anymore.



File: 1549627222904.png (252 KB, 1280x720)
252 KB
252 KB PNG
>Getting mad about anime on 4chan

Previous thread: >>69713726

>Beginner Roadmap and Overview
https://github.com/kamranahmedse/developer-roadmap
https://www.youtube.com/watch?v=UnTQVlqmDQ0 (embed)

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

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

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

hi friends. i was wondering where the thread was. it's the WEEKEND!!!

i'm gonna be working on my 4chan clone this weekend. i hope to have it in some demoable state soon. you can currently post a thread and post a reply but that's it. i probably won't get image uploading working this weekend but it should be pretty much complete outside of that

it's built in react, graphql/knex + postgres. i wanted to play around with graphql and it's been really fun.
>>
>>69725788
I need help on a web application
>>
>>69726013
> Friends
Sorry but I'm no friends with faggots
>>
>>69726045

that's good because i'm not friends with mean people
>>
>>69726054
: (
>>
File: Capture.png (52 KB, 1029x296)
52 KB
52 KB PNG
Javascript func question:

function(pic),
console(pic2);

How come revStr come as undefined?
>>
>>69726605
if you convert an undefined variable to a string it'll say 'undefined'.
initialize it as an empty string instead.
+= is basically just revStr = revStr + inputString[i];
which is 'undefined' + inputString[i] for you.
>>
>>69726605

this pretty much >>69726722

var revStr;

is the same as

var revStr = undefined;

And see what happens when you type this into the chrome console: undefined + ""
>>
>>69726722

don't you just love javascript

let c
>undefined
String(c)
>"undefined"
>>
>>69726778
You should be glad it doesn't throw and show a blank page instead
>>
>>69725788
So I kind of have zero knowledge on webdev, but really want to learn it
I have this project in mind that is a social network platform with money exchange service and want to learn it while building this platform
What do I need and how do I start?
>>
>>69726778
what do you want? JS to do the thinking for you and guess what you want?
>>
>>69726845
thanks for the idea nerd im building and monetizing this
>>
>>69726039
you are at least in the right thread
>>69726845
Read the OP.
Check the video and the roadmap.
Learn HTML, CSS and JS.
After that you can plan things in further detail.

Doing anything related to financial transactions yourself is normally something you'd want to stay as far away from as possible, when creating a site/app.
In almost all cases it's recommended to use some service to handle that stuff for you, because of the massive security concerns, where unlike with other things you have no margin for errors with that.
>>
>>69727027
Jokes on you I only described the very basics
>>69727071
Thanks for the advice, m8
>>
how much will the influx of journalist coders lower the average wage for developers?
>>
>>69726845
This has been implemented 100+ times. That's what webdev and development all in all are all about. You have some idea but 30 seconds of googling shows this is around for 20+ years and either failed or saturated.
>>
>>69727278
0
>>
File deleted.
>>69727278
>journalist coders

?
>>
>>69727541
>>journalist coders
there is a #learnToCode hash tag trending, encouraging laid off journalists to learn programming...
>>
>>69727605
I remember eyeing an article that claimed the trend of telling laid off journos to learn to code was coming from the alt-right. If that's true, fuck them.
>>
File: VlxXXss.jpg (199 KB, 1200x1141)
199 KB
199 KB JPG
>>69727895
It's a call back to articles, where journalists wrote about laid off coal miners and how learning to code is the solution.
Now a bunch of journalists got laid off themselves, which made some people tweet the same thing to them.
>>
>>69727338
There's actually only one semi-successful analogue for my idea and one half-assed site that uses the same core principle. I described it vaguely.
>>
>>69727984
interesting, thanks.
>>
>>69727895
>I remember eyeing an article that claimed the trend of telling laid off journos to learn to code was coming from the alt-right.
Yes goy it's coming from the evil alt-right nazis, you need to report it every time you see it.
>>
File: 1517860333692.gif (4 KB, 452x523)
4 KB
4 KB GIF
>>69728229
>>
What's a good way to setup a vue environment and manage the dependency hell of webdev? Wanna make a nice web front end and vue seems like a good framework.
>>
look at this mess
I really fucking wish to use C# again
>>
Maybe more /sqt/ than /wdg/ but what's a simple way to keep a bloatless blog?
So far I'm considering to export my .org files to html and log each new entry manually to the index.html but that may be too rudimentary.
>>
>>69728463
vue-cli
>>
>>69726045
you are missing out is the only thing I'm going to tell you
>>
>>69727993
And there's also a reason for that, namely the idea is likely not marketable. There are millions of such websites but you know nothing about them as they are dead
>>
>>69728463
>dependency hell
what kind of dependency hell are you thinking about?
If you want to go manual but still mostly hassle free I would recommend Parcel to bundle your site.
For a boilerplate Webpack setup you can use vue-cli like the other anon said.
For a more framework-y approach (with SSR and all that stuff) you can use Nuxt.
>>69728511
A static site generator like Gatsby or Vuepress
>>
>>69728463
just code them manual ffs. stop promoting this shitty webpack/js compiler meme
>>
>>69728721
You still write your components manually.
This way instead of adding a bunch of script tags and just blindly loading external JS, you can manage your dependencies properly and make use of features like single-file-components, minification, tree-shaking, SCSS, using newer JS syntax and transpiling for older browsers, etc.
>>
>>69728808
>tree-shaking
absolute brainlet here, what's that?
>>
>>69728891
>absolute brainlet here, what's that?
that's what web pack does by default, that is organise imports in such a way that there are no duplicates and that unused imports get ignored, to create smaller files..
>>
>>69728891
With the newer ES module syntax, you can have named exports/imports.
Then you can specifically only import the parts you actually need and Webpack can discard the unused dead code and won't include it in your final bundle.
>>
>>69728958
>>69728908
that's sick, I remember some dude doing this manually some months ago
>>
>>69728463

nuxt js
>>
not very good with react but whats the easiest way to go about feeding api data to some text/list element and updating it in x time intervals?
>>
>>69729403
Are you using classes or the new Hooks API?
>>
>>69729893

no i'm using ajax
>>
>>69729900

brainlet.

His question was very relevant. You must not know anything about react to respond in such a manner.
>>
>>69729900
I meant for your React components.
Whether you are using class components or function components with the new Hooks feature https://reactjs.org/docs/hooks-reference.html

The official docs will teach you how to do, what you want.
Specifically the section about state and lifecycle.
>>
>>69729403

switch to vue
>>
File: 1444651622612.jpg (169 KB, 1200x794)
169 KB
169 KB JPG
>>69728623
>the idea is likely not marketable
That's the problem, yeah, it will rely on human conscience too much but I'm trying to find a way. It definitely won't work in America, I'm more inclined towards Eurasia
>>
>>69728502
new computer?
>>
>>69731098
no, just show it to you what a mess PHP 5 is
>>
>>69728502
Did you intentionally set up your theme as poo in loo brown for doing PHP?
>>
>>69731270
yep. The theme reflects it. I am so mad right now, I wish I can drop this shitty job
>>
>>69731282
you're doing freelance?
>>
>>69731497
aye. The client insisted to use shitty PHP 5 hosting for their hotel booking system. At least they paid me quite well desu and they allow me to use VueJs for the UI
>>
>>69731554
that's awesome
how much experience do you have that got you in freelance?
>>
>>69731627
I got a link from someone from IoT competition, we talked and he got many client. After this project done, I'll be soon working into Hospital TPS. I hope we can convince the next client to use something robust and manageable than this.
>>
>>69731656
you write like a ESL
PHP is perfect for the job desu

what would you use instead?
>>
>>69728502
>_model.php
yikes
>>
>>69731676
Yes, English isn't my native language.
C# obviously, since it easy, does validation checking for me, strict data type, great scaffolding system.
>>69731700
I too yikes desu.
>>
>>69731710
so is C# the supreme meme?
>>
>>69731765
yep. Also learning it to create mod in Bannerlord of course :^D
>>
>>69731781
sweet, what do you wanna create?
>>
>>69728502
>not using laravel
>php5 instead of 7

You're retarded.
>>
I know I can use user agent styles to overwrite css styles of other websites, but can I write an extension that overwrites browser styles (notifications specifically)?
>>
>>69731806
If Bannerlord real, I want to make 14th c. Europe mod and experiment with socket stuffs to include co-op system or persistent world between players. For the assets, I will use Atilla 1212, since they're open source anyway.
>>69731811
I don't have option. So no laravel, and I have to query all these SQL and validation manually.
>>
>>69731930
sounds exciting breh, godspeed
>>
no bully pls but is there such a thing as free hosting with database and SSH access? i just want to play around with my laravel website , to see how things like artisan and composer behave when online, cant be same and easy as in local :(
>>
>>69732742

heroku?
>>
>>69732789
have you tried it? whats it like?
i will check it out
>>
Complete javascript noob here. Say I have some strings with a class name, like these:

<p class="string">Apple</p> 
<p class="string">Snake</p>
<p class="string">Kiwi</p>


What is the easiest way to grab all these and store them as an array in a variable?
>>
>>69733259
maybe this
var x = document.getElementsByClassName("string");
let arr = [...x];
>>
>>69733497
and why not let x
>>
>>69733497

I only get [object HTMLElement] when I try to print them.

I'd like to be able to print out a nice comma separated list containing Apple, snake and Kiwi from the variable.
>>
>>69733569
[...document.querySelectorAll('p.string')].map(el => el.text).join(', ');
>>
>>69733497
>>69733741
how/where did you aquired such wizard-tier knowledge of js?
>>
>>69733569
>I only get [object HTMLElement] when I try to print them.

that's because you have made an array of html elements. dude take a few minutes are just google htmlelement and then open the first result: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement

you might find a function or an attribute to just retrieve the inner text of an element
>>
>>69733569
What browser are you using? Most browsers print HTMLElement objects in a format conducive to debugging, either as HTML or in a format that makes it obvious that they are HTML elements.

Unless you're explicitly coercing each element to a string before you print them, in which case you'll get something like [object HTMLElement].

And this may seem like nitpicking but when you say
>Say I have some strings with a class name
they're not really strings, they're HTML elements. And you can't just do element.toString() to make an HTML element into a string. You have to do something like element.innerText(), to get the actual text currently being displayed inside that HTML element.
>>
>>69733741

I only get ", , " as the result..

Also, is it possible to only get those from the class "string"? So it doesen't grab this:

<p class="colors">Red</p>


Thanks for helping me anon!
>>
>>69733807
>What browser are you using?

Waterfox

>>69733795
Thanks, I'm reading now. As I said, I'm a beginner so it's even a challenge to know what to google for. But I'm getting there are I am studying all the answers ITT to try and figure out what they do.

>they're not really strings, they're HTML elements.

Thanks for the insight. In my mind, any text was a string no matter where it was located, inside a function or in the HTML. But I guess not.

>And you can't just do element.toString() to make an HTML element into a string. You have to do something like element.innerText(), to get the actual text currently being displayed inside that HTML element.

Hmm, I see. brb I'm gonna try some things.
>>
>>69733827
The "p.string" means only p tags with the class "string", for the one you posted now it would be "p.colors" instead.
Read up here: https://developer.mozilla.org/en-US/docs/Web/API/Document/querySelectorAll and try it out in your browsers console.
>>
>>69733552
it should be `const`
>>
>>69733866
>Waterfox
kek
>>
>>69733827

that's because text isn't a property of a html element so the dot map returns an array of n empty elements and you are joining them with ", " so you only get the joining characters in the resulting string. javascript is funny because can access whatever you want on an object and if it is defined, you will, oddly enough, get undefined.
>>
>>69733827
Not the guy you're replying to, but his code doesn't work because .text isn't a real property of HTMLElements. There are different properties that do this, but you probably want el.innerText in place of el.text.

And his code specifically does grab elements with class="string" and element type 'p'. That's the function of the querySelectorAll('p.string').

Query selectors are something you'll learn more about when you learn CSS. After you have the basics of CSS down, CSS Diner is a fun little game that guides you through all the different selectors:
https://flukeout.github.io/
>>
>>69733910
but why, maybe something chages
>>
>>69733956
just tested this and it works

using innerText instead of text
[...document.querySelectorAll('p.string')].map(el => el.innerText).join(', ');
// "Apple, Snake, Kiwi"
>>
File: 1530277072146.jpg (68 KB, 603x587)
68 KB
68 KB JPG
>>69733956
>https://flukeout.github.io/
>tfw can't select the plates
>>
>>69733870
>The "p.string" means only p tags with the class "string", for the one you posted now it would be "p.colors" instead.

Gotcha! (Also, that's really neat.)

>>69733933
>javascript is funny because can access whatever you want on an object and if it is defined, you will, oddly enough, get undefined.

I see. (Also, that's not that neat.)

>>69733926
>Waterfox
>kek

I also use Brave. I at least want an illusion of privacy when I browse.

>>69733995
Trying this now.
>>
>>69733973
With const you can still make modifications to the object.
You just can't assign a new reference to the const variable, that would point to another object.
>>69734018
I believe in you anon
>>
>>69734053
I checked the solutions, that was easy, but it's counter intuitive what they're asking you for in the text area
>>
>whole /wdg/ crumbles and burns down on a simple task on taking contents of 3 html elements and put them in array in javascript
>>
>>69734140
forgot to take your meds?
>>
>>69733995
Alright, cool, but you should really understand how/why this works.

Here's an expanded version of that anon's one-liner:
// get all the elements who have element type 'p' and class="string"
let nodeListOfStringNodes = document.querySelectorAll('p.string'); // of type NodeList

// convert to Array type so we can use Array methods like .map()
let arrayOfStringNodes = Array.from(nodeListOfStrings); // of type Array, containing HTMLElements

// the .map() method takes an inline function, which is applied to each array element, and returns an array of results
let arrayOfStringContents = arrayOfStrings.map(function(element) { return element.innerText; }); // Array of Strings

// the .join() method joins the contents of the array using the joiner string which is passed in
let completeString = arrayOfStringContents.join(', ');
console.log(completeString);


His [...list] thing is basically the same as Array.from(), and his (el => el.text) is arrow notation for inline functions.
>>
File: cwtf.gif (2.05 MB, 322x225)
2.05 MB
2.05 MB GIF
>>69733995
>just tested this and it works

Wow! Thanks! Also, that's very sexy.
>>
>>69734177
Thanks for explaining it!

I had to do some small changes to make it work:

// get all the elements who have element type 'p' and class="string"
let nodeListOfStringNodes = document.querySelectorAll('p.string'); // of type NodeList

// convert to Array type so we can use Array methods like .map()
let arrayOfStringNodes = Array.from(nodeListOfStringNodes); // of type Array, containing HTMLElements

// the .map() method takes an inline function, which is applied to each array element, and returns an array of results
let arrayOfStringContents = arrayOfStringNodes.map(function(element) { return element.innerText; }); // Array of Strings

// the .join() method joins the contents of the array using the joiner string which is passed in
let completeString = arrayOfStringContents.join(', ');
>>
>>69734418
Man, just chain it
>>
>>69734418
Yeah, sorry, I changed some variable names to make them more clear and missed a few.

>>69734603
Context, man. The whole point is to make it more clear and readable, one step at a time.
>>
good "essential" chrome web dev extensions?
>>
uuh, maybe a color picker and the devtools for React or Vue if you are using one of those.
>>
Anyone here familiar with npm errors? I jsut downloaded the latest version of nodejs (in executable ZIP form), extracted it to a folder, added the appropriate env variable in Windows. I globalled installed vue/cli and the installation worked fine. However, if I run:
npm update -g


I get this error:
npm ERR! path C:\Utils\nodejs\npm.cmd
npm ERR! code EEXIST
npm ERR! Refusing to delete C:\Utils\nodejs\npm.cmd: is outside C:\Utils\nodejs\node_modules\npm and not a link
npm ERR! File exists: C:\Utils\nodejs\npm.cmd
npm ERR! Move it away, and try again.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Anon\AppData\Roaming\npm-cache\_logs\2019-02-09T23_02_41_358Z-debug.log


Anyone know why a simple command to update all global packages wouldn't work?
>>
>>69735065

(And if I try deleting or renaming npm.cmd which the error is telling me to do, I can't run npm update in the first place)
>>
File: 1549749745744s.jpg (8 KB, 250x176)
8 KB
8 KB JPG
>>69735065
>npm

why not use yarn?
>>
>>69735155

Pretty much everyone uses npm, surely if a basic command like updating all the global packages doesn't work, the problem must be on my end?

Anyways I've gotten it work by renaming both the npm AND npx files in the node folder, but still wierd I need to do this.
>>
>>69735065
>(in executable ZIP form)
that's a thing?
>>
>>69725788
Can /g/ tell what my code is doing, also what would be a better way to write magic numbers like

> clouds.length - 1
or
> clouds[currentPosition + 2]

clouds is an Array of 0's and 1's, there cannot be two 1's together.

function jumpingOnClouds(clouds) {

const CUMULUS = 0;
var currentPosition = 0;
var mininumJumps = 0;

function jump(stepSize) {
currentPosition += stepSize;
mininumJumps++
}

while (currentPosition < clouds.length - 1) {
if (clouds[currentPosition + 2] === CUMULUS) {
jump(2);
} else {
jump(1);
}
}

return mininumJumps;
}
>>
File: nodedownloads.jpg (81 KB, 1130x762)
81 KB
81 KB JPG
>>69735266

Yea, it's in the "Other Downloads" link. Maybe my problem is caused by the fact that I wasn't using an actually installed version of node, but I can use any other npm command and install packages just fine.
>>
>>69735299
Yes, and it's fine to do that, creating variables to use them once would just confuse things.
The only time I'd recommend using a variable for a length is if the original variable name is long and you use it like 3+ times.
>>
File: backend.jpg (68 KB, 700x687)
68 KB
68 KB JPG
>>69725788
What am I doing wrong, am I missing something?

I have a React App and a graphQL API, my database is using MySQL, now I don't have any problems using my app to call my API and the API calling the database.

But if I do any change in the database outside the API, eg. I INSERT something using the console and If I refresh my React App which calls the API for every record in the table, the API doesn't return that last insertion.

I have to shutdown the server and restart it so it can somehow "take notice" of that change.

I just don't understand why any changes outside the API server don't seem to be reflected when my API calls the database.

I'm using Bottle py as a server for my graphQL API btw
>>
File: 1534002958264.png (145 KB, 512x512)
145 KB
145 KB PNG
>>69726778
> Not initializing a variable
> Expecting a value
>>
>>69735499
Thanks!
>>
What is a good start for SEO, like how do I get my page to show up at all in the google results?

Not going for rank 1 but just that it can be found at all.
>>
>>69735661
register your domain in the google search console interface and tell googlebot to schedule a crawl to get it index
>>
Can you explain to me when I should create elements with Javascript and when not?

For example in the following code 10 span elements are created with Javascript. Now I could also instead copy/pasting ten elements in my HTML file directly. What are the trade-offs here?

//Javascript
for(var i = 1; i <= 10; i++) {
var str = i + ') String of text',
span = document.createElement('span');

span.innerHTML = str;

var body = document.getElementsByTagName('body')[0];
body.appendChild(span);
}

<!-- html before -->
<body>
</body>

<!-- html after -->
<body>
<span>1) String of text</span>
<span>2) String of text</span>
<span>3) String of text</span>
<span>4) String of text</span>
<span>5) String of text</span>
<span>6) String of text</span>
<span>7) String of text</span>
<span>8) String of text</span>
<span>9) String of text</span>
<span>10) String of text</span>
</body>
>>
>>69736421
You use JS, when you want to create or change dynamic content, where when you load the page, you may not yet know what or how many elements need to be rendered.

If you have a list that's always 10 items and always with the same content, then you don't need to create them programmatically.
>>
>>69736421
You should use javascript if the data is (obviously) impossible to hard-code, or if you're inserting a huge amount of things. For 10 elements you should just hard code them.
But if you're using a front-end framework (which you probably should be) it would be smart to loop over things and create an element for each one. Because those front-end frameworks can use SSR, and you'll get best of both worlds.


The problem is that for what you are doing, you can just copy/paste 10 things and change the HTML in 3 seconds, but it would take you a lot longer to set up your loop, grab the elements, put them in the right place. And it's also extra shit that runs in the main thread for no reason. It's also messier, harder to reason about (where did it come from? some random for loop in a js file? oh okay.)
>>
>>69736480
>>69736512

That makes a lot of sense, thank you!
Is there a performance loss using Javascript over HTML? Because it has to be compiled one more time, right?
>>
>>69736568
Well one is executing code, the other one isn't.
Just like running any other program, your device has to put in the work to get the calculated output.
>>
My site is starting to get some regular vistors. What do I do next?
>>
>>69736719
Listen to the TechLead!
> How I scaled a website to 10 million users

https://www.youtube.com/watch?v=yPF94QiI2qk
>>
>>69725788
/g/ what are some good bootstrap templates for things like events/concerts? A friends band is playing an event and I kind to make them a website, but I'm a back-end dev and don't want to make something that looks/performs like shit, I'm fine with paying a bit for the template and plan to just host the thing on my VPS
>>
>>69726045
fucking nigger ruining a faggot's project showcase

>>69726013
cool shit anon, you created a thing while the 99% of /g/ were masturbating with dragon dildos.

>>69728891
it's dead code elimiation for the mother of all bloat that is modern web frameworks.

>>69735155
I've been using the yarn equivalent commands until I couldn't run Deezloader. npm did the job quickly.

It's the same shit effectively.

>>69737548
I usually check dribbble and behance for "inspiration", but you might find codecanyon more useful probably as want ready to use html/js/css files (not just the design). Not sure if there's anything concert related made on bootstrap though
>>
What's good way to learn php? I want to do backend. How can I look good on a resume for that
>>
>>69738238
if you're already decently versed in other programming languages, I'd recommend https://learnxinyminutes.com/docs/php/

Once you got the basics down, I'd learn Laravel. Laracasts has pretty decent free video courses on Laravel that would give you a quick start in to it.
>>
is there a function like getClientRects that supplies information about the visible portion of an element? or do you know of a library that supplies such functionality?
>>
>>69738464
There's the Instersection Observer API

https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API
>>
how do I append data from an ajax call to a react element by id?

class DisplayData extends React.Component {
render() {
return (<p id={"date"}></p>) ;
}
}
ReactDOM.render(
<DisplayData />,
document.getElementById('root')
);


and in the js file where I make the call

$("#{date}").append(parsedData.date)


but this doesn't work, it just throws errors.
>>
>>69739226
It throws errors because you aren't supposed to be modifying DOM elements outside the scope of React.

Any view framework is going to have a fit when you start manually modifing the DOM because the view frameworks keep a reference of how the DOM is supposed to look like in memory so that when update occur, the view framework knows what to do.

React, Vue, etc allow you to already append data to components but in a declarative manner. That's how they fundamentally work.
>>
>>69739226
Fuck jquery and just make the async call inside the component via componentWillMount
>>
>>69739742
Here's an example in react 18 with the new hooks release.
import React, { useEffect, useState } from "react";
import ReactDOM from "react-dom";

// Hook utility for fetching data
function useFetch(url) {
const [data, setData] = useState([]);
const [loading, setLoading] = useState(true);
async function fetchUrl() {
const response = await fetch(url);
const json = await response.json();
setData(json);
setLoading(false);
}
useEffect(() => {
fetchUrl();
}, []);
return [data, loading];
}

function DisplayData() {
const [data, loading] = useFetch("http....");
if (loading) {
return <h1>Loading</h1>
}
return (
<p>{JSON.stringify(data)}</p>
)
}

ReactDOM.render(<DisplayData />, document.getElementById('root'));
>>
>>69739226
>jquery in react
don't do this.
>>
>>69736850
how the fuck does this dude follow me around? First I see him on youtube, now he is even on /wdg/?? Not that I mind, but still..
>>
Are there any sites for pairing people up with mentors? I did a quick search and there are a few sites for people that can pay for mentor time but I think a mentor program only works when money isn't exchanged.
We are a small IT/software company and I think this would be a good way to get people into the field or help out someone that is struggling. I'm not talking about internships. This would be a relationship with a mentor providing advice or other resources like infrastructure to someone that was developing their own skills and projects.
Everyone knows that finding good people is a crap shoot and I think a mentor program would be a good way to potentially find decent employees.
>>
is d3 still the go-to library to make interactive graphs or has something new come out in the past few years?
>>
>>69739828

Seriously the only way this works is if you hire someone senior with a goal of mentoring all the juniors as his role. There are reddit subs over loaded with people asking for mentors and the people who reply often don't look any better.
>>
>>69735218
>Pretty much everyone uses npm

Pretty much everyone uses yarn.
>>
File: 1547580793981.gif (845 KB, 245x150)
845 KB
845 KB GIF
>>69739226
>jquery in react

i don't think i've seen that before

why don't you just do the data look up as part of the component's lifecycle or pass it down as props?
>>
>>69739742
>>69739745
>>69740503
>>69739754


I know very little about react but for this assignment I need to append API data to some text/list element that refreshes every hour, which means I need to update the view as well so I thought React would be the best tool for that, but I've only ever done the React tutorial and watched a couple of videos.
>>
>>69740534

the neat thing about react is that due to the nature of the lifecycle functions intrinsic to a component, you can basically do everything use the native react apis. i'll make a quick code sandbox demo

you don't really want to mix direct dom manipulation and react because react keeps track of the dom and editing it outside of that will create weird issues asthe virtual dom would be out of sync and react wouldn't be sure how to reconcile changes.
>>
>>69738801
this isn't what i needed, but i wasn't privy to it, so thanks anyway.
>>
>>69740579

I see, thanks for educating me, do appreciate it.

Final thing is how do I go about implementing a react file into my current project then? Right now I just brought react in to my html file like

<div id="root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.4.2/react-dom.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.21.1/babel.min.js"></script>
<script type="text/babel">
class DisplayData extends React.Component {
render() {
return (<p id={"date"}></p>) ;
}
}
ReactDOM.render(
<DisplayData />,
document.getElementById('root')
);
</script>


but i'm assuming I need to create an external file for all of this. i'm using webstorm.
>>
>>69740618
Use create-react-app. What you're doing now is bad performance, you don't want that, and you also don't want to mess with the proper way of doing it with webpack, CRA takes care of that for you and you'll have a sample site running in a minute.
>>
>>69740618
Oh no no no.
That's a very old version of React. We're on 16.8 now.

The Babel transpiler also should only be loaded in development environments. You need to use a module bundler (Webpack or Parcel) configured with Babel to optimise your React code.

If you haven't already, install node.js and then
install create-react-app. All those settings are preconfigured for you, and all you'd need to do is type npm start/ npm run build to deploy your app.
>>
>>69740618

that version of react is pretty old and honestly, i've never dealt with react outside of using a bundler like webpack/parcel to deal with it and i would hesitate to use it with external script tags.

how much of your project have you done already? i would recommend getting a basic app set up with parcel because it's relatively painless and then you could build all of your basic html in react components and then still do the clever stuff as well.

here is a basic data fetching code sandbox example: https://codesandbox.io/s/y2zk4x5qjx

you can see that on componentdidmount (the function that gets called after it renders), it sets an interval that will fetch data every 10 seconds. the fetchposts function uses the native browser fetch api to ping an endpoint to retrieve some json and the updates the state accordingly. every time you set the state in react, it triggers a rerender which keeps the view up to date
>>
>>69740690
>>69740700
>>69740722

holy shit so much information at once. right now I've got a basic project in webstorm with a html file and a js file and that's how i've always worked.

>module bundler
>basic app set up with parcel

No idea what that means. But i'll take a look into all this, thanks.
>>
>>69740503
The original React tutorial direct from Facebook featured the use of jQuery to interact with the code. I still have stuff in my Github from learning React that was copied straight out of it.
>>
>>69740782
Just forget about webstorm for a while and setup CRA on a command line, it's not difficult. Then you can worry about webstorm and everything else
>>
>>69740782

well that's kind of how it will work because your index.html will have a script tag that points to an index js that will be all of your bundled react/javascript code. it's just there will be a bit more going on behind the scenes in development

if you read the create react app page, it should give some clarity about the best approach for a new project: https://github.com/facebook/create-react-app

i have personally never used create react app but i'm sure it's fine as it's recommended in the react docs and based anons. i've only set up projects from scratch using parcel. the modern js environment is pretty rad like if you have a terminal and node installed, you should be good to go. getting started with parcel is as easy as a few terminal commands: http://blog.jakoblind.no/react-parcel/
>>
Does anyone here have some exp with network.js?
>>
>>69740824

okay so i've got this. what now.
>>
>>69740903

is that just from create react app? if the server is running, do what it says and go view it. then just starting adding stuff to your app
>>
>>69741143

how do I access my app? open it up in an IDE of my choice?
>>
>>69740109
there was a bigger difference when yarn initially came out, but now after the last few bigger npm updates, there isn't too much of a gap anymore.
>>69740534
>>69741248
Have you used any other frontend frameworks before?
This is for a job application you said, right? What's your webdev experience so far and what does the job list as requirement?
>>
>>69741265

1 year of basic frontend stuff like javascript, html, css/sass, angular, API stuff, recently introduced myself to react and node.js

it's a trainee position.
>>
>>69741248

when you say access, do you mean write code or just view it? the create react app github page lists the folder structure that it generates so if you want to edit the code, just open the folder in an ide or a text editor and then play around with it
>>
>>69741295
Hm I don't know Angular, only Vue, but I also dove into React recently.
I think JSX might be the biggest obvious difference, but I am sure Angular also has something similar to lifecycle methods, where you declare something once (like a timer), that will then continually interact with your application state.
Imo the official React docs, where they show the example with the timer should be the perfect guide for this. Did you finish reading through the "Main Concepts" section?

(sry if some of this is repeated from other posts. I didn't read the whole history of how things were going so far)
>>
>>69740503
>jquery in react
>>69740503
>i don't think i've seen that before
I used it for the jQuery smooth scroll feature... that is $.scrollTo()
>>
>>69740903
>>69741248
>>69741295
Surely you can do at least SOME work on your own instead of being hand-held through everything? I'm certain CRA prints the instructions to view your app locally, and it's in the very first few paragraphs in their guide as well, described just after the installation instructions. You'll need to learn to accomplish things by yourself or otherwise you'll never make it.
>>
>>69741478

that was kind of a retarded question in hindsight I admit.
>>
>>69741590
So, you figured it out, great
>>
>>69725788
cheapest way to host a website including a simple backend for crud shit?
>>
>>69742024

Namecheap + DigitalOcean
>>
Do you people use a WSDL editor or do you take the bullet and write the XML in your editor?
>>
>>69742061
I have never even heard of WSDL before.
What do you have to use it for?
>>
>>69742091
Java web service using SOAP. Not my choice.
>>
>>69728502
>using php in 2019
absolutely disgusting
>>
>>69742324
At least it's not JavaScript
>>
>>69742370
>At least it's not JavaScript
>implying PHP is better than JS
Are you serious?
>>
>>69742370
With js you have an excuse. With php, you don't.
>>
pointless and baseless language hate
>>
File: latest[1].png (106 KB, 253x405)
106 KB
106 KB PNG
>>69742497
C# and Web Assambly is the only way
>>
Lmao all these javascript shills who don't even know how to wordpress.
With my PHP skills I will make the next Facebook using Wordpress.
>>
>>69742428
PHP7 is fast as fuck tho
>>
File: slime-2.jpg (124 KB, 1200x400)
124 KB
124 KB JPG
>>69733793
This is normal day to day JS work as a professional programmer anon.
>>
I'm learning conventional programming, currently working with strings, in java. I hate doing homework at home though, someone give me a productivity pill pl0x.
>>
>>69742784
Practice makes perfect anon.

Programming is a skill that develops over time.
>>
>>69742784

no one got good at anything by just sliding by and doing the bare minimum. doing the homework now sets you up to do cooler shit later on. the universe rewards hustle. so hustle your ass off on shit you don't wanna do, eventually it will become habitual and you will enjoy the hustle.
>>
>>69742937

to add to that - what are you gonna do instead of your homework
>>
>>69742964
enjoy very bland and boring entretainment on 4chins and twitch, but most importantly, not doing shit
>>
File: deathbeam.jpg (211 KB, 1920x1080)
211 KB
211 KB JPG
I just wanted to let you guys know that I got a Jr. position. Thanks for the help.
>>
File: 1518442603945.jpg (59 KB, 346x500)
59 KB
59 KB JPG
>>69743019
what did you have to do to finally achieve said goal? Congratulations btw.
>>
>>69743019
Congrats anon.

Also know that impostor syndrome is a real thing.

Hustle when your manager is around and make friendships. Office politics are a real thing.
>>
How the fuck do I escape tutorial hell?
I feel like I'm been running circles for so long.
>>
>>69743019

that's nice anon. what sort of stuff are you gonna be working on? i remember my first role and i was so nervous like i kept constantly doubting and feeling like shit. you'll probably get that but it's normal. just try to ignore it and feel like you're on the right path

>>69743000

it's all a balance my man. bland entertainment is always gonna be there for you. just chip away at your homework like just do a bit to get the cogs turning. the worst feeling is when you set yourself a monumental task and you're not used to work load so you'd rather just default to whatever and then feel bad about it. just starting anywhere is better than nothing
>>
>>69743078
Building shit.
>>
>>69743057
Ive been grinding for months.Without being as consistent as I would have liked.

>>69743071
>>69743101
Thanks my dudes I will try to dont feel like shit the first months, just last night I was feeling uneasy.

For what I understood we will be building some sort of bus management software.
>>
>>69743281
>I've been grinding for months
I need more detail, grinding what, building what, knowing what, what's on your portfolio, and what was on your interview test?

>>69743101
I've just started, decimal to binary converted in String. pretty quick.
>>
Over time I learned a bunch of webdev stuff, but am still a complete newbie, when it comes to SQL.
Does anyone have a nice way they would recommend to work through the basics of Postgres? (In addition to the learnXinY SQL syntax crash course)
I know the very rough concepts.. create table, select bar from foo... but have never used it for anything I built.
>>
I'm just starting FCC courses and about halfway through the first section of JS.
How long can I expect to wait until I am proficient enough to be a front end dev and make enough freelance to be financially independent?
>>
Japanese websites are so weird, like most of the elements are small and there's less white space but somehow it works.

>https://www.ameba.jp/

compare it to

>https://medium.com/
>>
>>69740722

I've been playing around with this code for now but for some reason, my react says that
index.js:47 Uncaught TypeError: data.map is not a function


I only changed the url, changed the "posts" variable and added some settings to the data fetch like headers and such.
>>
>tfw binary 2 decimal
I'll have to think for that!
>>
>>69743631
Get a solid book on it, SQL is deep and really heavy when it gets to the real shit. No way around it practice + understanding. There's a point where you have to make multiple operations on a query, you book has to cover that, like subqueries with joins, group function, etc all mixed up, you gotta learn that to really understand SQL
>>
>>69743832
they seem outdated tbqh
>>
>>69743838
>I only changed the url, changed the "posts" variable and added some settings to the data fetch like headers and such.
I literally don't understand these posts.
You could have included a link to the editor showing your code.
Do you want people to guess and ask again to clarify what you actually did?
From what you wrote it's probably because you assigned some non-array object to the posts variable, which doesn't have the .map() method, but who knows.
>>69743962
Alright I will see what I can find, thanks
>>
>>69744022
Make sure the book comes with a database where you can practice what it teaches in the book
>>
>>69742937
>>69743101
thanks for the motivation my dudes, I'm doing fine
>>
File deleted.
>>69744490
>>>69742937 (You)
>>>69743101 (You)
>>
>>69743832

never occurred to me before to wonder if other countries had a different approach to web design. now i'm gonna browse cool japanese sites for a bit

also, can you use japanese characters in an element's class name?
>>
>>69744852
>can you use japanese characters in an element's class name?
if it was a valid ASCII code, why not?
>>
File: fdghgfhgfdhgfe.png (19 KB, 442x503)
19 KB
19 KB PNG
>>69744852
Pretty sure you can.
Anything unicode seems to go.
>>
>>69744888

was wondering because the website other anon linked:

>https://www.ameba.jp/

had english classes everywhere. i can only assume they use some framework
>>
>>69725788
https://medium.com/@rrhoover/the-rise-of-no-code-e733d7c0944d

Honestly, how many years do we haev before web development and even light desktop dev is gutted by automation and shit? I would probably off myself if I spent a couple years trying to get a Jr. job in dev only to see the market fall out the next day
>>
File: 1530479448330.jpg (29 KB, 543x533)
29 KB
29 KB JPG
>>69744510
Just finished, back to the NEET lyfe yahoo!
>>
I've been neglecting to learn React because I feel like it's really unnecessary for most things, yet it's the fucking hottest shit and it seems that everyone *has* to know it to get a job. How fucked am I? Why is React so popular? Why do we even need huge libraries like React? DOM manipulation is so easy with ES6.
>>
>>69745609
>DOM manipulation is so easy with ES6
what does exactly ES6 introduces that makes it easy? <= clueless
>>
>>69745668
brainlet
>>
>>69745609
You use React (or another frontend library) so you don't have to specifically type out all the interactions with the DOM, which can result in a lot more LOC and be more work to maintain.

Think of it like instead of writing out methods to manipulate DOM elements, you instead create a template, where you declare how the site should go about rendering your site/application state.
Then you can focus on the actual functionality and just update the state and let the library do the work of figuring out, which elements should be changed/moved/removed/etc. to accommodate the updated state.

here is a reply to someone who had a similar question with a code example
>>69420708
>>
File: 1535577988470.jpg (91 KB, 640x932)
91 KB
91 KB JPG
>>69745733
y u hurt my feelings anon? Not everibody is born knowing the wonders of ES6
>>
>>69745609
>>69745749
oh that 404'd in the meantime
anyway, that was the link
https://jsfiddle.net/b8z2je0h/2/
>>
>>69744888
Japanese characters are explicitly outside of ASCII though. ASCII only does the basic english alphabet, numbers, and symbols. If you need CJK or others, that's encoded in Unicode, usually with the UTF-8 encoding. Based on that other anon's results, you can use Unicode characters for classes. But you might still not want to, in case older browsers don't like it or don't support UTF-8 properly.

>>69744988
The encoding type might already get set by some HTTP headers from your server, but for safety, you should include
<meta charset="utf-8">

in the <head> of your HTML file, as well as
@charset "utf-8";

at the top of your CSS file.

Or, I mean, to be really safe, just stick to ascii characters.
>>
File: Screenshot_1.png (344 KB, 1919x978)
344 KB
344 KB PNG
>>69728502
What framework is this?
I don't mind PHP, you just have to use a framework to make it bearable. I use Codeigniter.
>>
>>69745609

components are neat ways to encapsulate aspects of an application. building web apps becomes declarative, you can import a button a component and then you can render one. if you need to change the button component, you change button component without affecting other shit. there are clear separations of concerns. components are easy to test because they are self contained.

react apps are easy to optimize because you can code split and lazy load components when they are needed. react makes it easy to visualize and build an application. you have a tree of components and it reflects the structure of the dom. it works really well with data fetching due to the component lifecycle. it's great for teams because you can use things such as css modules to have component scoped style sheets.

the best bit about react is the reconciliation when state changes. react is clever enough to know to only update certain parts of the dom based on the update. e.g. if state changes and a class should change only that node will be effected. updates are super fast.

i would love to see you come up with an es6 solution that can make on the fly view updates that is fast as react. there are so many benefits of react that i would recommend just using it to build something to see what the fuss is about
>>
>>69745877
people still do projects with pure php? wtf use frameworks retards or ssay no to the employer
>>
Is it possible to change the selected printer in Chrome using an extension? Lets say I have a web app that prints invoices and labels. Can I use a chrome extension to have invoices print to a full page printer and labels print to a label printer? Obviously some sort of trigger from within the web app would tell the extension which printer to print it on.
>>
Does anyone here know if videojs has an API for it's subtitle editor? I'm making a simple video.js-er for people to quick enter video links and subtitles to watch things in browser and embed them. I want to save subtitle edits in local storage the way I do with volume.


http://videojser.x10host.com/?v=https://v1.4animu.me/Shingeki-no-Kyojin/Shingeki-no-Kyojin-Episode-01-1080p.mp4&sub=https://raw.githubusercontent.com/brenopolanski/html5-video-webvtt-example/master/MIB2-subtitles-pt-BR.vtt
>>
Whats wrong with raw PHP again? It works on my machine.
>>
>>69746020
prolly not

https://stackoverflow.com/questions/45922502/changing-default-printer-in-chrome-by-website
>>
You'd be surprised how many people still do
>>
>>69746152
Was for >>69745988

>>69746089
PHP is fine for what it is. Just use it correctly and you literally won't have any issues with it. I mostly use it to build API's and it's pretty comfy once you get into it.
>>
alright, i worked on my imageboard a bit this weekend. i didn't really do that much to be honest. i did some styling on the forms and got pagination, bumping, thread limits and thread archival working. i got a version up. all you can do is post a thread and reply to a thread. there is one board.

i'm using a free postgres database on elephantssql but you can only have 5 connections and my current set up for managing the pools on my server is janky as fuck so it might just crash out and complain.

i haven't setup any subscriptions so the only way to get new posts are to refresh or submit a thread/post which requests new data when it updates the cache.

here is a link: https://imageboard-web-hcurr3i10.now.sh/d
>>
>>69746194
oh and the most crucial thing about an imageboard, you can't upload images. so it's a shitty forum at best
>>
>>69746097
I know the website itself can't do it but extensions can bypass a lot of the security restrictions applied to websites.
>>
>>69746194
>>69746221

apparently it can't handle a number of concurrent users greater than one. goddamnit, i knew i should have used heroku
>>
>>69746273
You can still switch, no?
>>
>>69746346

yeah i just can't be bothered to mess around with deploying anything else today.

*sigh*
>>
>>69746363
Cheers, you can do it anon. Godspeed.
>>
>>69746194
>>69746273
rip
>>
>>69746381

yeah, thanks. i will work on it again next weekend and get a more steady deployment set up. my current free plan set up is apparently shit. i really made it to play around with graphql and graphql is rad
>>
>>69745810
>utf-8
Why is this not a default by all browsers now? is it a performance issue?
>>
>>69746803
Browsers will generally try to automatically detect the encoding based on the file contents. But some older browsers might be worse at this, so it's good to either set it in the files, or at least make sure it's being set in HTTP headers.
>>
I've learn MERN but NodeJS (Express and Mongo) jobs per month in my country are like 50 while Java ones are like 800.

So, what's the relatable java stack for web development? Java and Spring? what database should i go for to use with java? should i go for one in specific or go for mysql?

My goal would be to get a job as a jr java developer, but still using node for personal project (Also, knowing java would be a pro, i think this would be the perfect opportunity to sit down and learn it)
>>
>>69740722
Sending get requests on interval is a surefire way to hinder you app's performance in the long run.
Use websockets instead.
>>
>>69746088
Nevermind I did it myself here without the need for an API
https://pastebin.com/6M37DCvp

You can see an example here; notice any saves you do to the customization of subtitles auto saves in local storage so you can pimp them out easier

http://videojser.x10host.com/?v=https://v1.4animu.me/Shingeki-no-Kyojin/Shingeki-no-Kyojin-Episode-01-1080p.mp4&sub=https://raw.githubusercontent.com/brenopolanski/html5-video-webvtt-example/master/MIB2-subtitles-pt-BR.vtt
>>
do i need to read about http and all that theory if im gonna be backend dev?
>>
>>69748014
You need to know what it does, not read an entire book on it.
>>
I need some help
My PM want me to pass aone landpage to Wordpress by using the Gutenberg Editor only.

I've never using Gutenberg in my life but with WP going to 5.0+ my PM gave me the task to do it.
Is that editor viable to do that kind of task? I've heard it has probletreating responsive blocks
>>
>>69748214
What's with all the broken English niggers here today?
>>
>>69748233
Poo's in the Loo's
>>69748214
I've never used Gutenberg in my life. I know WP 5.0 has implemented it but I haven't upgraded yet since I don't have the need to do it.

However, I'd never use an editor (classic editor is still shit) to do page content. That's why you have the fucking page templates unless you want the user to be able to change the page content by himself for some reason
>>
File: eclipse js.png (27 KB, 687x361)
27 KB
27 KB PNG
Anyone uses eclipse for writing javascript ?

My .js files have very weak syntax highlighting(90% of code is just white); What do I need to install to fix this?
>>
>>69748426
>Anyone uses eclipse for writing javascript
100% No.

use sublime text, atom, vscode or what have you
>>
>>69748426
this is fucking beautiful are you fucking retarded?
3-4 colors max is perfect
>>
>>69748426
Notepad++/Sublime Text for PCs with low RAM/resources
Atom/VS Code for PC with average performance
>>
I'm current getting through the FCC JS curriculum and at the bottom in the console window it says
 /**
* Your test output will go here.
*


Nothing pops up in that window unless I write console.log() in the script and fiddle around putting different variables in there.
My question is shouldn't they have implemented a better way to display the result of your code? Did they and I just missed it?
As far as JS goes I feel as though I understand it but I still don't have a grasp on how a lot of the concepts I am learning are practical. I know what to do with all of this information, but what are some scenarios in which I would need to put an array into an array or call the first value of an array etc.?
>>
File: ghfjhgfje.png (53 KB, 926x776)
53 KB
53 KB PNG
>>69748896
are you sure?
Just clicking run, if the test fail, there should be some output.
If the tests are ok, you should get the popup to go to the next lesson.
>>
>>69748963
shouldn't you put myVar++ under the comment?
>>
>>69748963
Yes, it gives me notes when the code fails or I fail the test but I think it would be helpful to see things react as you edit the code similar to editing css and html. I know JS is a different language altogether but without a visual representation of what I am doing I find it difficult to conceptualize what my code is actually doing.
Maybe I'm in the minority or maybe I'll just get used to it over time.
>>
>>69749007
yeah, this is just the example when you click run immediately with the wrong code still there.
If you enter a correct answer it will just say "test completed" and show the popup to cintinue
>>
I want to write backend in Rust. How sick am i?
>>
jesus, picking good looking colors is literally harder than anything else.
>>
Any good SVG icons collection out. Got tired of using font awesome... or any of the other """icon fonts""".
>>
>>69748365
how the fuck can you add font-awesome icons without the html block in gutenberg?
>>
Is it pointless to use vim for web dev? Should I just embrace the botnet and install VSC? What text editors do you use?
>>
>>69749611
>What text editors do you use?
VSC with amVim
>>
>>69749611
VS Code is already open source. You can disable the botnet by disabling some of the settings although I'm pretty sure that there is a fork that removes the botnet by default.
>>
need a small project idea thats not todo or weather
>>
I just finished my first major project since learning how to program. Now I feel kinda empty inside. Is this normal?
>>
>>69749611
Friends of mine use Vim, but I prefer atom. I don't see the need for something like VSC for webdev. In fact, all you really need is something that highlights code, a file tree, and uhh...well that's pretty much it.
>>
>>69750023
Completing projects always gives that feeling. It's not strictly tied to programming, but any job where you [finish one] => [start new one]
>>
>>69750023
what did you do
>>
>>69750023
easy, just start a project that will never be finished.
Then you can spend all your time on that and never do anything productive, that could actually benefit your potential career.
>>
>>69750094
lmao that project is the one called good ole 4channel lurking
>>
File: atom_autocomplete.png (23 KB, 754x305)
23 KB
23 KB PNG
Just installed atom, thank all of u guys for suggesting it!

One question though, when atom auto-completes code, shouldn't the auto-completion follow official psr standards ? I'm really not a fan of this debate, and I though psr rules are official legit guidelines to solve the problem.

>>69748426
this is old me, fuck this guy, eclipse is gay!
>>
>>69750056

But I feel like the project seemed to have a lot more value when it was an idea compared to now that it's finished. It works just as I intended, and that's kinda cool I guess. Maybe I should start thinking about a version 2?

>>69750087
I can't say, but it's for solving a specific problem we've had for years at work.

>>69750094
At least it'll kill time. I have been thinking about writing a text editor. The world needs one that isn't shit.
>>
>>69750046
Yeah I got all of that in vim.
>>
>>69750046
>the need for something like VSC
what do you mean?
>>
File: IMG_20190211_011926_058.jpg (157 KB, 1279x1061)
157 KB
157 KB JPG
>>
>>69749611
There is no botnet with VSCodium
>>
I need project ideas. I really want a fucking webdev job but I need a better portfolio.
>>
>>69750356
if u can't google it then u already doomed
>>
>>69750356
If you can't come up with something, then just pick a new library or technology instead and do the most basic example with it in order to learn something new.
Asking others what to build is pointless, since it doesn't come from your own motivation, so it will be more of a chore to finish than actually be interesting to do.
>>
>>69750307
?
>>
why the fuck is enabling cors so difficult
>>
>>69751144
it's a lost art
>>
>>69751144
I GODDAMN HATE CORS
>>
is cors only affecting my local dev network? if i upload the same code to the web server would it fuck everything up or would it be okay?
>>
>>69751144
Shouldn't be that difficult, it should be just setting some response headers, which I imagine is straightforward in most web servers.

Maybe if you're only enabling it for specific requests, or in the presence of a valid API token, and only then in some servers/frameworks.
>>
>>69751348
enable-cors.org not helping?
https://enable-cors.org/server.html
>>69751405
It's either the same (or whitelisted) origin or it isn't.
If you have an API somewhere and want to use it with a site on your local dev server, you would allow CORS for http://localhost:3000 for example (or any other port)
>>
>>69751555
i've been trying enable-cors and variations of it with no luck yet. the site online still works fine so i must've made a recent change somewhere in the past few days on the dev side and not realized it.

>>69751513
i'm not sure if it matters, but the site has always required a valid token to use. its been working fine so far until recently.
>>
i'll figure it out i guess. it's just frustrating since im running against a deadline.
>>
>>69751766
you are not the only one, my nigga
I need to pass a shit ton of pages into the gutenberg format and I only have till tomorrow afternoon
time is ticking
>>
I wonder if some people just have too much time on their hand or if that's what they actually get hired to do
https://codepen.io/miocene/#
>>
>>69751888
and i thought i was decent at animations...
>>
how do i do web dev faster? right now i edit an html file in visual studio, then refresh my chrome tab where the file is. problem is it takes a couple seconds to update, which is really fucking annoying for when i change some minor css thing and want to see how it looks
>>
cors anon here again. i said fuck it and uploaded it to the web server and the whole thing works fine on it. its just my local network that is having the cors issue. i need to get it working again locally but at least i know the site works.
>>
>>69752089
sometimes it just be that way. if you're testing a small change though then you could try injecting the code through the console.

document.getElementById('someElement').style.color = '#abc';


the change should appear instantly. of course you can do that for larger blocks of code too if you need.
>>
>>69752294
>open up the console on this page (F12, ctrl+shift+i, or however you access it on your browser)
>paste this document.body.style.backgroundColor = "red";
>the background for 4chan should turn red
>>
>>69752089
You can have the page autorefresh every e.g. 1 second by putting this tag in the HTML head:
<meta http-equiv="refresh" content="1">


That only works if your page is loading pretty much instantly, and doesn't have much JavaScript to run or heavy files to load.
>>
I've completed my React project and I need to display it on a website. How do I go about that, since there is no index.html file in my project?

Does uploading to github still work despite not having an index html?
>>
>>69754157
Keyword is deployment.
>>
I used to develop and deploy web applications on Apache + PHP (mod_php) + MySQL about 10 years ago. Are these still relevant or should I switch to something else if I want to get back into web development?
>>
I'm using this code:
message = message.replace(/(https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=\[\]]*))/ig, '<a href="$&" target="_blank">$&</a>');
and changing

<a href="http://nullrefer.com/?$&" target="_blank">$&</a>


to help prevent sites like 4chan when being clicked on getting the cloudflare error, but it prevents anything from embedding like images. what do? any help?
>>
>>69754428
They're still pretty relevant. If you wanted to upskill I'd learn nginx and integrate your PHP application with it instead of Apache.
>>
>>69735505
Nobody?
>>
>>69754428
PHP is irrelevant. Learn a real language.
>>
>>69754157
>since there is no index.html
what? react projects surely have an index.html, located in the /public folder. Without it, you wouldn't be writing react.

Anyway, you can use github pages. Just do a search for 'how to react github pages'.
>>
>>69750023
>completing a project
Then it must not have been anything great. A calculator? Fuck no, I never felt empty "completing" projects like that. I felt great, on to the next one. Now I have projects that will never be complete, and will be worked on for years to come.
>>
>>69726813
I fucking wish

>Hey, the page loads, and it seems to do what it's supposed to! Who cares that errors are popping up and data is getting corrupted, the page loads amirite boss?
>>
>>69753752
this would be horribly annoying to look and interact with
>>69752089
>how do i do web dev faster? right now i edit an html file in visual studio, then refresh my chrome tab where the file is.
Simplest option is to use the Parcel bundler.
It even works with basically no configuration and will give you hot reloading out of the box, which can apply those changes instantly without reloading the page itself.
>>69754428
The tech is still very relevant, but 10 year old knowledge not so much.
If you want to try something new in addition, then look at modern frontend JS frameworks like React or Vue.
>>69754938
Can you not fetch the new data at all or just not on the first fetch after an update?
It shouldn't really be a React issue, since it doesn't really care how you get the data.
>>
>>69754938
Sounds like it can be query result caching.
>>
>>69755684
>Who cares that errors are popping up and data is getting corrupted, the page loads amirite boss?
?
>>
300
>>
>>69754995
80% of internet running on php
seething
>>
File: hqdefault[1].jpg (22 KB, 480x360)
22 KB
22 KB JPG
Who is the Queen of /wdg/, and the King?
>>
File: 9IMi[1].gif (387 KB, 480x360)
387 KB
387 KB GIF
>>69757640
I'm summoning Boxxy fro temporary Queen until we get one (idk if we got one or not, sorry), not Crackychan, I wasn't really arround at that time. So Queen of newfags it is.

https://www.youtube.com/watch?v=Yavx9yxTrsw
>>
Is Vue only useful for single page apps? Still happily chugging along using jQuery.
>>
>>69758413
You can use it for SPAs, but you can also use it for smaller sections in existing apps, where you want to implement some reactivity.
>>
Is there a minimal version of jQuery that doesn't have any features except allowing jQuery plugins/extensions to work? I don't want to use jQuery itself at all but there is a jQuery plugin I need which has functionality that doesn't elsewhere.
>>
>>69759108
If I'm not mistaken, you can use the webpack/babel fuckery to reduce the files to the minimal functionality required to work, but tbqh I know nothing about it, maybe someone else in here knows about it.
>>
>>69759130
jQuery doesn't use named exports though and just dumps everything into a global object
>>69759108
what does the plugin do?
>>
>>69759130

I don't know much about Webpack itself although I've used it before since vue/cli kind of sets it up automatically. So if I npm installed jQuery rather than just include CDN, and then only used it for the sake of the jQuery plugin I need, the transpiled end-result would only include code relevant to the little bit of jQuery I'm actually using?
>>
>>69759388

Barcode scanner detection:
https://github.com/iuyes/jQuery-Scanner-Detection
>>
>>69759418
Hm that's less than 100 LOC.
Shouldn't be too hard to rewrite without jQuery or newly re-implement yourself. (or just look for an alternative library on NPM)
>>
>>69759523

Yea I was thinking about doing that eventually, was hoping that I could just get away with some kind of minimal version of jQuery (everything works fine right now, it's just that I'm importing all of jQuery just to use this plugin and everything else is done by Vue).
>>
How did this lad do this website:
https://www.humbertpoyet.com/
specifically, the letters working as filters for the image
>>
>>69759775
probably some filters over a transparent letter

https://css-tricks.com/almanac/properties/f/filter/
>>
is it still the standard to put the "remember me" checkbox on login page?
i dont see facebook having this anymore
>>
>>69759775
My brainlet guess is that it might be canvas wizardry, since the text can't be selected or doesn't appear to be selectable in the inspect element menu
>>
>>69759775
that website is awful, without any kind of taste, just billions of animations lumped together by some faggot who just learned his first jquery animations
also slow as fuck
>>
>>69760048
yeah I know, but I did like the inverting letters effect.
>>
new thread:
>>69760179
>>69760179
>>69760179


>>69760015
I think persistent login is kind of just the default now.



Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.