Quantcast
[ 3 / biz / cgl / ck / diy / fa / g / ic / jp / lit / sci / tg / vr / vt ] [ index / top / reports / report a bug ] [ 4plebs / archived.moe / rbt ]

/vt/ is now archived.Become a Patron!

/g/ - Technology


View post   

[ Toggle deleted replies ]
>> No.75371794

>>75371455
on react-on-hooks, how can i do a simple synchronous:
>addClass to trigger animation
>wait 500ms (this)
>set state
>addClass to trigger animation
???

>> No.75371869

Anyone know? >>75365256 I'll resort to hard-coding SQL soon.

>> No.75371874

>>75371794
You can use component state to check whether to load classes and trigger timeouts.
So set a state for when there's an animation loaded and change the state to something else in the timeout

>> No.75372051

What's the difference, filezise-wise, between exporting a default vs exporting a named object?

I'm making a component library and exporting them like so
//components/button/index.js
export const Button = () => {}

//components/index.js
export * from './button´;
export * from './card´;
export * from './checkbox´;
...


Can this be tree-shakeable? Does it matter if I export it as named functions instead of defaults?

>> No.75372198

Is the roadmap for backend development any good? I've already got past the javascript/html/css phase, am currently learning Java.

>> No.75372265

>>75372198
You haven't learned JS my dude.

>> No.75372288

>>75372177
B-but web components...
We use CSS-in-JS now.

>> No.75372292

i have no idea for my website anyways

>> No.75372466

>>75372288
You can use them in JS components, too. But the whole "styled" thing is retarded in my opinion, keep a separate sass file for each component instead.

>> No.75372472

>>75372241
>>75372265
lemme re-phrase this then

I am comfortable with Javascript; yes, there is a lot more I can learn, but I want to find out where to go next from here

>> No.75372736
File: 135 KB, 667x720, 1585950982333.png [View same] [iqdb] [saucenao] [google] [report]
75372736

>not mastering typescript
Oh so you're making it a goal to become irrelevant in the future

>> No.75372759

CSS is so fucking hard

>> No.75372776

>>75372736
>"mastering" any flavor of niggerscript
reminder that WASM is on the horizon and JS subhumans will finally get the rope

>> No.75372779

>>75372736
>Add :<type> after variable name
>You mastered typescript
Oh wow, if you ever programmed in Java or C# Its the same fucking shit

>> No.75372811

>>75372779
>he doesn't know
>>75372759
Are you kidding?

>> No.75372888

CSS has a lot more concepts to learn than people realise. Most web devs I meet who think they mastered it don’t understand fundamental things like how collapsing margins or z-index actually works, or they don’t understand the difference between justify and align properly in flexbox or grid. Just keep chipping away at it

>> No.75372895

>>75372888
Meant for >>75372759

>> No.75372898

>>75372888
my iq crashes when i try to make a simple box in middle of screen with grid

>> No.75372910

>>75372888
How can you don't know similar stuff and work in the sector?

>> No.75372931

>>75372926
fucking hell im going back to programming

>> No.75372950

>>75372931
csslets, when will they learn

>> No.75372951

Question: Which is the better dev setup for a ts project?

grunt with ts watch task and nodemon watching ./dist

nodemon but using ts-node

ts-node-dev or node-dev or some combination

Seems like there are so many dev setups but which is the fastest to rebuild and work with?

>> No.75373009

>>75372951
Webpack?

>> No.75373110

>>75373075
How big is your ts project and what is it for?

>> No.75373121

Is it possible to alter the values of the options in a select-element from the browser?

I don't mean to switch between them but to actually change them DOM-wise like innerHTML.

>> No.75373191

>>75373121
You can target, add and remove them just like any other HTML element

>> No.75373213

>>75372072
Sauce?

>> No.75373537
File: 18 KB, 1164x135, ;-;.png [View same] [iqdb] [saucenao] [google] [report]
75373537

What is the correct way of concatenating the two strings together in here? I'm trying to get a color by concatenating a hexadecimal with a # and it keeps giving me a missing ) error

>> No.75373893

>>75373836
>How does one debug JavaScript code?
you are writing programs and you dont even know that? gtfo

>> No.75374043

>somehow fucked up the posting of new to do list tasks
whew

>> No.75374096

>doing tagging system
>works fine
>still feel like its not worth the effort
would /wdg/ shelve it for now or keep fucking with it?

>> No.75374160

>>75373537
Just use + operator

>> No.75374200

>>75374160
heresy, use `${variable} ${variable2} `

>> No.75374350

>>75374122
If you want other map-like features there are libraries for that which allow placing stuff on top, but otherwise just use absolute positioning. Might want to consider splitting the image up as well and lazy-load parts of it.

>> No.75374352

>>75374348
nice ty

>> No.75374708

>>75374503
>>75374520
Yeah, what is a cheap and ok domain for non company stuff, yet not a personal blog?

>> No.75374784

>>75374671
I use Scaleway ARM servers for my personal stuff since they're cheap and you get dedicated hardware so you can do whatever without anyone getting mad at you. Had several for a couple of years without any downtime.

>> No.75374920
File: 62 KB, 845x345, Screenshot_2020-04-09_15-00-49.png [View same] [iqdb] [saucenao] [google] [report]
75374920

I have an axios request that gets image links in a site, then I do a forEach for all links with a nested axios request to actually download the image files. It only downloads the last image, why does this happen?

If I print the image links in the forEach, they are all printed normally. Code in pic, you can ignore the html parsing and shit.

>> No.75375087

>>75374920
image_link and image_name aren't set in the foreach, are they declared further up?
forEach doesn't wait for async, so whats happening is it's getting to axios, then moving onto the next one. By the time the first axois call has finished, it's already gone through every element, so image_link and image_name are set only to the last one. Declare them within the forEach scope instead.

>> No.75375227

>>75375169
>image_link and image_name aren't set in the foreach
Sorry, I meant the variables aren't declared the foreach. Which means they're scoped outside of the forEach block, which is why it gets overridden before the axios call can complete.
You want to do:
```
const image_link = url_prefix+image;
const image_name = image.split('/')[3]
```

>> No.75375263

>>75375227
oh fuck lol how did i miss that, i'm used to writing python
thanks a lot anon

>> No.75375673

>>75375327
>Use namecheap for a domain, pricing is decent enough and they give you free WHOIS guard forever.
Yeah doing some research atm, and it looks like namecheap and porkbun are the best for domain because they come with free WHOIS protection. Porkbun is even cheaper. But still not sure about the hosting provider, any experiance with porkbun or namecheap as hosting providers?

>> No.75375934

>>75375870
one is tags for search engines, the other is description for search engines

>> No.75376170

>>75376080
2bh, I feel like it is one of those meme buzzwords sóy devs use to appear fancier that they really are. To me you'd sell yourself better if u told me that you serve separate files each for PC and mobile.

>> No.75376557

>>75375958
Yeah I'm hosting my sites there, it's nothing heavy, the performance is as advertised and I can saturate the line/cpu as much as I want.
I don't think France allows loli, but they have datacenters elsewhere as well (Netherlands I think) so look up their laws.
Found it on LEB a long time ago and there were talks about them when they were newer due to the ARM hardware setup. You can spin up and down machines and pay per minute so if you want to benchmark them it won't cost more than a few cents.

>> No.75376637
File: 1.02 MB, 822x795, mfw reducers.png [View same] [iqdb] [saucenao] [google] [report]
75376637

>Redux

>> No.75377126

would anyone have some, more or less, easy to understand ressources on mysql ? As much about how it works as about mysql code ?

>> No.75377786

css is such a fucking shit i fucking hate this

>> No.75378287

anons bls, prohect idea, something to do qith advanced use of objects, I already did the to do list that saves to local storage, what should I do? Making a SPA kind of makes me affraid... wat do

>> No.75378350

>>75378287
make an SPA
Face your fears, you coward

>> No.75378447

>Microservices
https://www.youtube.com/watch?v=y8OnoxKotPQ

>> No.75378508

>>75378447
people have lost their marbles in face of complexity they cannot compute.

>> No.75379417

I would like to create a small/medium CLI application.
However, I can't choose between Python, Node and .NET.
What would you advise me and why? Which libraries?

>> No.75379428

What is there to do in js/react/etc on SPAs? I don't get it, the parallax efdect or what? Advanced animations? bls guide me, I don't wanna halfass it :/

>> No.75379476

>>75379442
I know blazor server with signal R and shit, I've worked on a project. Will probably make a webassembly client down the road when it's finalized.

>> No.75379529

>tfw started a react app with Typescript 2 days ago
>my first time ever working with TS
Oh boy was that a pain the first day.
What do you do with onChange handlers for forms? Do you do them typed for several fields, a single handler for all fields or a different handler for each individual field?

>> No.75379535

>>75379504
The entire current node environment is a nightmare and deno is not going to improve it that much. So keep away from all those shits and keep .NET everywhere.

>> No.75379872

Should i start learning web dev for fun anons? Ive been wanting to make sites online like gambling sites and stuff. Dont want to do it as a job though. I get super bored when learning programmig languages. Should I still do it though? I know how to design in photoshop but thats it

>> No.75379874

This is fucking satanic

>> No.75379925

>>75379529
Honestly, if it's a bother but the form isn't touch anything besides a single host component, just use ```any```.

>> No.75380146

No I don't

>> No.75380153

>>75379417
Don't use .NET.
As for libs, I don't have any experience with Python, but if you're gonna use Node, try to minimize your dependencies. Node has some really nice built-in modules like net, http(s) and crypto, but most shit on npm is unstable and bloated (for real, not /g/'s idea of bloat).

>> No.75380387

dog fucking shit i tell you
DOG FUCKING SHIT

>> No.75380413

Is Rust the ascended path? It goes the fastest (with some meme framework on the side).

>> No.75380424

>>75380417
FUCKING EVERYTHING
LIPS WAS EASIER TO PICK UP THAN THIS SHIT

>> No.75380483

>>75380424
Try studying CSS a bit to gain understanding of how it works. I'm guessing you're just plastering shit you found on stackoverflow onto your page

>> No.75380523

>>75373571
No. Any competent developer should be familiar with all areas of the stack, you don't need to be a master but at least have an idea of what's going on

>> No.75380877

am i the only one that likes to fiddle with css?

>> No.75380964

>>75380877
I fucking hate this shit I am so fucking done after half a day. How have the retards made it so fucking hard to align elements in a fucking document? HOW????

>> No.75380991

>>75380964
just use flex my man ezpz

>> No.75380994

>>75379782
lmao

>> No.75381023

whats point of using maps if you cant convert them to json. fucking useless garbage

>> No.75381042
File: 100 KB, 921x640, A2A2ABC4-3ABC-4953-BAAD-C3F6506A9173.jpg [View same] [iqdb] [saucenao] [google] [report]
75381042

>>75371455
I had a job interview for a position I’m not qualified for. Last night I fucked something up in a database and used one of my sites ftp to test some shitty code. Ended up leaving an index.php file that said “fuck you” and that’s what I left it at.
It was in my “portfolio” and they asked multiple questions about it. I forgot I left it that way. 5 people (including the CEO and the tech leads) in a huge company (pretty much responsible for most of the digital education here) saw me in a videochat talking about how I made a responsive site and shit and it was a blank page with “fuck you” written on it. I’m waiting for them to get back to me at the moment.

>> No.75381106
File: 97 KB, 640x640, 1584331502729.jpg [View same] [iqdb] [saucenao] [google] [report]
75381106

>>75381042
My uncleaned code is full of BAPspeak or ebonics and im afraid i one day forget to clean it

>> No.75381125

>>75381042
ahahaha rest in pieces friend. Maybe it impress them with your guts an bavado

>> No.75381156

>tfw companies web designers are actually just graphic designers

It’s so obvious. For one, they do not write any code at all. They create mockups. Two, the mockups do not work in the web. Like they sent me a mock-up that broke grid rules and had random margin added to the grid. All of the images are portrait. User is uploading portrait and landscape and sometimes nothing at all. They add background images that have to be absolutely positioned, but you can’t because it’s column specific and overlaps columns. The best is them randomly moving data on screen resize, like the name from the top to the bottom. I can push or pull within the same row, but I can’t move a row from a nest to the bottom of the page without media queries or jquery or having duplicate rows and show/hide depending on screen resize.

>> No.75381202
File: 116 KB, 640x794, lqjk4kwg7gq31.jpg [View same] [iqdb] [saucenao] [google] [report]
75381202

Since using an ORM for SQL in node is basically like mongoose, is there any inherent benefit to using something like sequelize over mongoose?

I know that mongo is a meme and relational dbs are better to learn, so would I just be limiting myself again if I use an ORM?

pls advise

>> No.75381235

>>75381202
ORMs are super useful most of the time, but if you don't know SQL you should get comfortable with that first so you have an idea what the ORM is doing when things aren't working properly.

>> No.75381301

>>75381042
Should have said it was a complex game you made where it displays fuck you unless you are geolocated within 50m of any locations of specific popular franchise where it would provide the next clue.

>> No.75381560

>>75381156
I had this conversation with my boss/creative director about how if he wants me to move the content into a completely different place on desktop and mobile I have to duplicate it and do a show hide which is undesirable from a page bloat perspective and other reasons, just blank stares

>> No.75381577

>>75381560
Just use Grid bro
https://developer.mozilla.org/en-US/docs/Web/CSS/grid

>> No.75381702

what's the best way to learn webdev and become good webdeveloper?

>> No.75381776

>>75381702
read the sticky

>> No.75381790

>>75381577
Grid doesn’t solve something being in the sidebar and now it’s squeezed between two random modules in the main content area, also those modules are user chosen in the cms so the layout makes no fucking sense

>> No.75382199

>>75371455
I'm using jQuery sparklines, and below is a code to make it, however, I have around 400 variables, and I don't think repeating is a good practice, how to solve it?

The code

$('#sparkline_var1_x').sparkline(var1, {
type: "bar",
barColor: '#fc3944',
tooltipFormat: '{{offset:offset}} {{value}}',
tooltipValueLookups: {
'offset': labels
}
});

</wbr>

>> No.75382366

>>75382199
Use an object and keys
var = {}
var[1] = 'whatever'

>> No.75382415

>>75382366
So, I'll end up something like this?
var = {}
var[1] = 'whatever'
var[2] = 'whatever'
.
.
.

var[400] = 'whatever'


And how's that will work within the code snippet? The variables aren't the main issue, I don't want to repeat that snippet 400 times.

>> No.75382694

>>75379417
.NET core, it is really nice these days.
Python might be easier and faster to develop in. Do you need/want types and how big is the project. The larger it is, the better it is to choose .NET.

>> No.75384029

>>75379417
Node, for sure at least in this context
It's just fun, and you can make it as minimal as you want, or load that puppy up with the words, beautiful spinners, color inputs, ascii, etc.

>> No.75385126

In general, is it normal to have to change code in many places when making any change to your frontend? It feels like everything is so interdependent that separating things into modules doesn't help with simplicity and just makes it so not everything has to be in one huge file.

>> No.75385346

>>75385233
>hmm...she's kind of cute
>nose piercing
into_the_trash_it_goes.ugo

>> No.75385349

>>75385346
she would be cute if she didn't try to be as ugly as possible

>> No.75385353

>>75384970
kys, fucktard

>> No.75385520

>>75385126
no
learn what DRY is and how front end modules leverage it

>> No.75385550

>>75385282
>>75385353
>>75385484
stop projecting so much, see a therapist

>> No.75386375

Is it even worth learning new shit since no one is hiring? Think learning how to kill and raid people is better time spent.

t.pol

>> No.75386409

>>75386375
Who do you think will get employed first once this all blows over?

>> No.75386751

What are the best languages for backend?

>> No.75386885

>>75386751
depends.

>> No.75387377

>>75371455
If the key of a react element is stored in _reactInternalFiber.key why shouldn't I just read it from there instead of passing it as yet another prop?

>> No.75387390

>>75387377
Then you’d be relying on an internal api which could change in name or semantics/usage internally.

>> No.75387416

>>75387390
That makes sense, thanks.

>> No.75387640

Anyone interested in doing free labor for me? I want to create a platform site but I don't have the time to make it myself because I'm still employed as a webdev.

I can offer you minimal requirements and corrections.

The frontend will be in React, I'd prefer the backend to be in Django, but I'm open to whatever since you'll be the one making it.

>> No.75388054

>>75387543
Are you looking for frontend stuff?

>> No.75388131

>>75388054
Yeah. I just want to do higher level stuff. I know html/css/js to a relatively high level , lead front end web dev for few years, SPA’s, programmatic animation, blah blah. Was thinking of diving into higher level performance profiling or whatever would add to my skills if I want to apply for a job at a faang or similar.

>> No.75388199

>not adding the required css to the head on your landing page to skip on a http call

shiggy

also, why aren't websites, especially JAMstack served over websockets? just deliver the minimal setup and have superior performance

>> No.75388791

>>75388131
I was thinking of implementing lazy loaded components in svelte using Interaction observer because it sounded fun.

There's also some fun to be had by benchmarking your js and trying to optimize it.
Or you could go and read the v8 blog, they have some interesting stuff when not posting WASM:
https://v8.dev/blog/cost-of-javascript-2019

I'm just a guy doing web stuff on my own so I'm not quite sure what would benefit you the most desu.

>> No.75388879

>>75388791
I do a lot of bespoke ui/interactive stuff so haven’t really dived into wasm yet as it has no access to the dom (last I checked). Definitely something to keep an eye on though, maybe for complex layout calculation and sending result back to js to apply.

Still haven’t dived into svelte yet, was waiting for it to mature slightly. Is the dev experience polished? Like create-react-app level of getting stuck in and easy to deploy etc.

>> No.75388931
File: 31 KB, 807x172, Capture.png [View same] [iqdb] [saucenao] [google] [report]
75388931

>> No.75389096

>>75388931
>>75389079
On a more serious note, minified/uglified JS is indeed impossible to make sense of

>> No.75389170

>>75389071
You could, for example, combine left/up: 50% with transform: translate to make something sit in the middle.
Or maybe display: flex with align-items: center and justify-content: center if applicable

>> No.75389191

>>75389170
Yeah it don't work that way I wish it did but shits out of whacking whack, I use justify-content center and that shit goes fucking left corner of viewport lmao fucking kill me

>> No.75389196

>>75389071
Define centered on a screen, is the box the only thing there or is it floating above other content

>> No.75389263

>>75389191
bruh just think of this, flex is easy mode css, if u dont make it work ur a brainlet

lrn2 css in element inspector to see inmediate results, u can save from there too if u working locally, now go for it, champ

>> No.75389342

>>75372776
>WASM
>existed for multiple years
>nobody still uses it
>most companies deprecating the idea

>> No.75389439

who ever created css needs to suffer eternally in fucking hell

>> No.75389445

>>75389391
Of course it will at some point. People want a faster backend for processing and calculation even if it never touches the dom. The only thing standing in the way is apple trying to kill web apps so they can keep apps in their 30% cut walled gardens on mobile. But this can only go on so long while google embraces the web apps.

>> No.75389449

>>75389425
More and more people are abandoning static languages, so why should they suddenly adopt WASM? Answer: they won't. JS is the future

>> No.75390142

>>75389439
Is it just you moaning about css for the past 2 days?

>> No.75390209

>>75390184
will u let the bitch control you or will u control the damn bitch?

>> No.75390323

>>75390312
I have IQ defiency.

>> No.75390581

okay im starting to understand boysh...

grids

>> No.75390683

>>75390662
Show us a broken example

>> No.75390766

I'm trying to make a chrome extension but no idea how it works,i loaded the unpakced files into dev mode extension but how can i know if the script is running?

>> No.75390795

should you use VSCode or Sublime text, or something else for programming?

>> No.75391017

>>75390795
If you’re starting out I recommend sublime text for getting up to speed. It won’t distract you. VS code when you find your feet. I still use both for different purpose. Sublime text is the best for quickly editing files, especially very large ones, it’s just much more responsive.

>> No.75391609

>>75391604
uhhhh

i need to make a larger version now with media query but my boxes are tied to grids and spread :((

>> No.75391626

>>75390795
vim
idiot

>> No.75391771

>>75391709
use javascript and create a span element around those 3 words ;)
if you can't use javascript, kill your teacher

>> No.75391947

>>75391709
Css alone won’t do it

>> No.75392124

>>75392078
post a fiddle, your posts are incomprehensible otherwise tbqh

>> No.75392141

Client was unhappy that performance score of site we shipped live was 0... So we had to fix that, yook us whooping 4 hours to get to 80 score. What nonsense. Our images were 600kb each, js 4.1mb and I forgot compression on backend whjch halfed sizes rest was matter of code splitting which react makes super easy and reducing image size kek.

>> No.75392197

>>75392158
>>75392184
ok :)

>> No.75392198
File: 50 KB, 631x537, 1395331119352.jpg [View same] [iqdb] [saucenao] [google] [report]
75392198

>>75391771
>>75391947
what about using a sass? is it possible with it?

>> No.75392290

>>75392252
anon, take ur time, don't blogpost

>> No.75392298

>>75392290
np im taking a smoll break, my low performance brain is too happy about the current events

>> No.75392334

>>75392298
make a content neutral version of it for your library that you can use later on, AND learn flex

>> No.75392351

>>75392334
I'm using Grid because it's easier than Flex for my brain.

>> No.75392403

>>75392391
My autism is flaring the fuck out because same font looks so vastly different in other browsers.

>> No.75392420

>>75392417
Yes it's low IQ too.

>> No.75392445
File: 230 KB, 1280x966, UmZbz2Kbpts.jpg [View same] [iqdb] [saucenao] [google] [report]
75392445

>>75392319
okay thanks
guess using pseudo-element with my word as content to just cover my specific word is the only choice i've got, right?

>> No.75393016

>>75392792
No, you can implement it two ways. The first way is to use an interval on the frontend. Your frontend requests the messages in your chatroom every few seconds or so. You simply GET /chatroom/:room_id to retrieve the latest messages for your room and show them on the frontend. It's a bit primitive but gets the job done

The second way is to use websockets, in which case the server stores each room and the client connections for that room. When a message is received to a room, it pushes the message to all connected clients in that room. You can have multiple rooms with their own client connections, you don't need multiple instances for this

>> No.75393024

I am doing it lads

>>
Name (leave empty)
Comment (leave empty)
Name
E-mail
Subject
Comment
Password [?]Password used for file deletion.
Captcha
Action