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

[Advertise on 4chan]


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


We're all gonna make it

>Full Web Development Roadmap
https://github.com/kamranahmedse/developer-roadmap

>Free beginner resources to get started with HTML, CSS and JavaScript
https://developer.mozilla.org/en-US/docs/Learn - a good starting point to learn about web dev fundamentals
https://javascript.info/ - quite a good JS tutorial according to many posts
https://www.freecodecamp.org - curriculum including HTML/CSS/JS, React, Node.js, Express, and MongoDB
https://www.theodinproject.com - curriculum including HTML/CSS/JS, Ruby on Rails, and SQL
https://fullstackopen.com/en/ - requires you to have basic web dev, db and git knowledge
https://flutter.dev - flutter resources

>List of PHP resources
https://ghostbin.com/paste/sNdM3

>List of design resources
https://ghostbin.com/paste/rTwHe

>All useful documentation in one place
https://devdocs.io

>Need help? Create an example and post the link
https://jsfiddle.net - if you need help with HTML/CSS/JS
https://3v4l.org - if you need help with PHP/HackLang
https://codesandbox.io - if you need help with React/Angular/Vue

We have own website: https://wdg.one
Submit your project progress updates using the following format in your posts (the scraper will pick it up):
:: my-project-title ::
dev:: anon
tools:: node, react, etc
link:: https://my.website.com
repo:: https://github.com/user/repo
progress:: Lorem ipsum dolor sit amet, consetetur sadipscing elitr

Previous >>80319731
>>
>>80343959
Pic related is from a site I made in 2014:
https://section9.neocities.org
>>
>>80343959
OP's pic is exactly how I feel lately.
>>
>>80343851
This is it. It works properly now, thanks
>>
Fuck just doing javascript tutorials is boring and demotivating since I feel like a wet-brain all the time
>>
How do you advance? Like you learn some front end framework then some backend one to make apis and connect the two but all the courses/tutorials I watched are kinda on the easy side.
How do you learn more advanced features? I guess you have to be hired and progress on the job or what?
>>
>>80344407
It feels much better once stuff starts working. You can just do it without tutorials when you start feeling confident. Then you look a tutorial and compare solutions, do it again if you found best practices, etc. But I'll be honest with you refactoring my code is somehting I never do. Mostly cause I used to write spaghetti behemoths which are a pain in the ass to refactor. Now I write much cleaner code, but it took some time and advice to get there. Generally speaking the divide big tasks into small tasks and each of them as a function. BIg tasks are usually a "main" function that calls smalelr ones. So that way making changes is usually easier.
>>
>>80344407
Agreed. I'm a beginner and I dislike all tutorials i've encountered .
>>
>>80344524
>>80344407
oh and apply the DRY principle, (Don't Repeat Yourself), so if you do a task more than once throw in a function to abstract the task.
>>
>>80344407
came here to post this. i can only finish 1-2 mosh's modules and call it a day.
>>
Can anyone explain what does this query mean in google?
>sxsrf=ALeKk013C285zgPDCR0FMh7oH35C>WXze5w%3A1614086353060&source=hp&eiWhat are these obscured tokens?
>>
>>80344514
>How do you advance?
You need to do something other than tutorials.
>How do you learn more advanced features?
Personally, I run into them while trying to solve some related problem. If you manage to get a team with experienced devs, their knowledge might rub off onto you.
>>
>>80344407
You should just do javascript tutorials to your basic data structures like arrays/objects and then watch some videos on async js and DOM manipulation. At that point you can just jump in and start writing a website, if you get stuck just check MDN or reddit/SO. The best learning is by doing, tutorial hell is called so for a reason
>>
where do i get a job doing web when i'm an undergrad and only know react?
>>
>>80344514
press F12.
When you post a reply or open image, look at the amount of transactions.
100s of js to spy on you.
1000s of ads to scam you.
10s of CDN to load balance.
None of Zucc/Dorsey/Moot made their own website. They went to CIA and sold their soul.
internet is a spying machine. Go into wood with a girl and fuck her day and night.
>>
Lately I've been appreciating design styles like those found in the interfaces of some polished video games, the opposite of minimalist, baroque.
I'm wondering if there's some ready to use thing to add nice frames/borders like that to what I'm doing.
But I can always do it manually by putting images around it.
>>
>>80344592
>>80344407
oh yeah, always check:
javascript.info and MDN
>>
>>80344524
>>80344530
>>80344536
The most fun I've had coding so far is the HTML + CSS project challenges on freecodecamp. This tutorial stuff is a grind that bores me, but I feel like I need atleast some base before I start building things.


Currently on chapter 5 of the javascript.info tutorial.. Thinking I'm going to do this, then chapter 6 and then try something else.
>>
>>80344622
javascript.info is very good
>>
>>80343970
you are still paying money. Where is your income?
>>
>>80344514
Don't worry about frameworks if you're still in tutorial mode. That's like wanting to work on an engine before you've ever even changed a tire (fuck my analogies are shit).
>>
Job just assigned me some frontend libraries to write in typescript but I've never done ts/js outside of a website. Any good tutorials that won't make me look like I copied?
>>
>>80344647
paying money for what?
>>
>>80344654
But I always follow videos thats how I learn
>>
>>80345247
Try to build something on your own once you've already built some stuff. See if you can do it on your own. Something good for beginners are:
. calculator
. todo list
. front-end CRUD
>>
>>80345270
pretty sure ive done those in uni
I got a CS degree
rn just looking for a job and learning frameworks to add to my cv
>>
>>80345288
you can do those with a FW now maybe?
>>
>>80345247
You won't retain anything though
>>
>>80345247
Don’t get stuck in tutorial hell
Do what anons say and build stuff on your own
>>
>>80343959
>complete React tutorial to make clone of popular website
>realize i have no idea how i would do this without the tutorial, or what i would do if i had to change anything
how do i really learn React?
>>
>>80346005
Build a website using react from scratch and google/check documentation as you go along
>>
File: 1573419058757.jpg (34 KB, 693x720)
34 KB
34 KB JPG
>>80343959
I found a new and more optimal testing ground. In the browser, open a new tab, and in the url type
about:blank
. You can do your magic there now.
>>
Just a question, I'm a beginner looking through some code to see what others are doing, and I have no idea what the fuck I'm reading. For example, looking at https://codepen.io/TurkAysenur/pen/RwWKYMO , I wanted to see the HTML and CSS that they're using since that's what I'm familiar with, but holy fuck it's all foreign to me. Is it best to just keep studying up before looking at what others are doing to get inspiration?
>>
>>80344514
1. learn flutter

>>80344407
have you tried flutter

>>80346172
try kiijubg yo fkytter
>>
what the fuck is mocking/mockito used for and why cant I save in test env as in JUnit tests? Spring/React here
??
>>
>>80346091
I made a folder specifically for testing simple backend shit, with its own package.json and all. It's much easier compared to doing things one at a time in the browser even if only for the 'watch' feature of Jest. I assume that's what you were trying to say, I may be wrong
>>
>>80346420
Nah I mean front end stuff like HTML css and js, backend makes no sense in that case.
>>
Is webdev a comfy job? I'm coming up to the end of my copsci degree and deciding what field to go into. I feel like webdev would be pretty comfy
>>
my front end makes fetch requests to my server api endpoint. but anyone else with the endpoint url can make the same requests, right?

how do i restrict this?
>>
File: file.png (748 KB, 850x601)
748 KB
748 KB PNG
I'm currently using an array of alphanumeric ids in javascript but I'm planning to pair other info to each id. Should I turn my array into an array made of objects like so?
var myArray = [
{
path: "something",
id: "w063dF5R"
},
{
path: "something2",
id: "m10mNB8L"
}
];


Right now I'm using includes() to quickly check if an id is present in the array but is there a similar way to do so when dealing with objects? Looping through the whole thing sounds resource intensive depending how big the array gets
>>
File: 1568315763748.jpg (154 KB, 600x524)
154 KB
154 KB JPG
>>80346899
You could also do
const myArray = {
w06dF5R: 'something',
m10mNB8L: 'something2'
};


Or if you go with array of objects, then you can use array.find() to do everything that array.includes() and array.indexOf(), etc. do.
>>
>>80346899
>>80347052
Ofc calling it "myArray" no longer makes sense if you make it an object. My b
>>
>>80346899
You could keep the array sorted and access using binary search or such. Although it probably wouldn't be worth the trouble unless you're expecting thousands of entries and frequent access.
You could maybe even use IndexedDB depending on your usecase
>>
>>80346899
Depends on how you're going to access the data, looping it and using all the values once or looking them up after the fact? If the latter you want a hash, otherwise what you have is fine.

{
"w063dF5R": {
path: "something"
}
}
>>
>>80347052
>array.find()
I think I might go that way.
>>80347091
The max number of entries I worked with so far is between 200 and 300 and I really doubt I'll ever get close to 1000
>>
Does it make sense using let instead of var in self invoking anonymous function if the variables inside won't affect the global scope anyway?
I generally use let over var when I only need to call something once and never use it again but should I even bother?
>>
>>80347377
>I generally use let over var when I only need to call it once
What do you mean by call? It sounds like you need a refresher on the differences between var/let/const. Which one you use inside an IIFE makes no difference.
>>
>>80347448
I mean, I use var if I need to reference something later for whatever reason and use let if I need to reference something only once and forget about it. For example I would use let to create a style element to insert in the document.head and call it a day
>>
(JavaScript)
Is it possible to load the result of a function only when it was finished calculating and mean time to display console.log("loading")?

Any examples would be very nice.
>>
>>80347481
Just use let and const, var is not needed anymore.

>>80347484
Calculating what? If it's heavy you can use web workers, if it's just 1+1 you can do

setTimeout(() => console.log(1 + 1), 0);
console.log("loading...");


Or

const promise = new Promise(resolve => {
resolve(2 + 2);
});

promise.then(result => console.log(result)); // 4
console.log("loading...");
>>
>>80347578
not him but
>promise
pretty neat stuff
>>
>>80347578
Thank you,

Canvas with shitload of code. I want to load website first, and then the canvas itself. Now everything loads at once making a sluggish experience (for ~3s) till it renders the view.
>>
I'm trying to make a timer with a screen and two buttons, set and reset respectively, but I can't figure out how to put the buttons under the screen div, here is the code https://jsfiddle.net/u0xra6ef/#&togetherjs=K1GAxVbAtf
I simply want to fix the buttons in the lower part of the circle, does anyone have an idea?
>>
>>80347763
hacky but werks
https://jsfiddle.net/vt3so78r/
>>
>>80347880
>>80347763
unboomered:
https://jsfiddle.net/vt3so78r/6/
>>
>>80347880
>>80347993
thanks, anons
>>
>>80346649
>anyone else with the endpoint url can make the same requests, right?
Yes
>how do i restrict this?
Authentication from the caller.
Token based systems are common. You can send a JWT every time you make a call and validate it on the server side.
Just lookup how people do authentication.
>>
>>80344622
The Odin Project is quite good for giving you a project to do as they teach you all the tools you need to make it, then just tell you what to do without telling you how. Definitely the most satisfying course I've done.
>>
>>80346005
the only skill you need to learn any coding language/fw is knowing how to properly google questions. reading docs as well
>>
File: 1580633829207.jpg (43 KB, 493x449)
43 KB
43 KB JPG
How common is to use "jade" with node, I just found out it exists and I have to use it for a project. But I'm extremely disgusted by its mere existence.
>>
>>80344407
Read EloquentJS until chapter 8, then do the JS section in freecodecamp.
At that point you have all the fundamentals of JS and can begin working on projects for your portfolio
>>
>>80346899
>but is there a similar way to do so when dealing with objects?
Literally just lookup the property:
/* Search the object AND its prototype chain */
"thing" in myStoreObj
// or the ghetto version
myStoreObj["thing"] !== undefined

/* Search the object but NOT its prototype chain */
myStoreObj.hasOwnProperty("thing")
// or if myStoreObj is a null prototype object
Object.prototype.hasOwnProperty.call(myStoreObj, "thing")

For very small number of keys an array might actually be faster despite being O(n) vs property key lookup which is (approximately) O(1).
When you eventually get sick of manually doing all this shit just use Map.
>>
I was thinking about creating a database using the cmd shell in XAMPP but I decided to use phpMyAdmin because it looks so easy
I got the main database set up and connected to my php/html code. I am able to run the php code quite well but I am throwing a few errors.
What I'm wondering is if each time a user uploads something using php will the table look like this?
posts table
CREATE TABLE posts (
post_id INT(8) NOT NULL AUTO_INCREMENT,
post_content TEXT NOT NULL,
post_date DATETIME NOT NULL,
post_topic INT(8) NOT NULL,
post_by INT(8) NOT NULL,
PRIMARY KEY (post_id)
) TYPE=INNODB;

>post content - TEXT NOT NULL
If I wanted more than just text do I need to mention something in the script about uploading images or is that fine?
Say I wanted multiple webpages that allows uploads, can they all reference the same database, the same table?
>>
>>80349099
oh yeah and I know that TYPE was replaced by ENGINE, gonna try fiddling around with it more and connecting things so I can save posts into my database but I wasn't sure if a multiple database site would be preferable if there were several categories already available.
Rather than custom categories created by users, there will be preset categories users will post in. I supposed I need to update my categories table?
>>
>>80349206
CREATE TABLE categories (
cat_id INT(8) NOT NULL AUTO_INCREMENT,
cat_science VARCHAR(255) NOT NULL,
cat_etc. VARCHAR(255) NOT NULL,
UNIQUE INDEX cat_name_unique (cat_name),
PRIMARY KEY (cat_id)
) ENGINE=INNODB;

Is this the correct way to go about things? My code will reference variables such as "science" and so on in order to store posts from those webpages into the database using that table
>>
>>80349099
>phpMyAdmin
Just use MySQL Workbench.
>>
>>80349099
>INT(8)
Do you actually know what the 8 in INT(8) means?
>>
File: sip.png (196 KB, 680x613)
196 KB
196 KB PNG
>>80349778
but it's too difficult
I'm too scared of new I want old
>>
>>80349099
If you want to save images in a database you can either use the blob type or convert the blob to base64 and store that as normal text.
And yes any/multiple PHP scripts can connect to any/multiple databases.
>>
File: 1614069153427.jpg (101 KB, 396x385)
101 KB
101 KB JPG
>>80349824
no...
>>
File: 1609183364845.jpg (26 KB, 448x301)
26 KB
26 KB JPG
>>80350645
it's an integer, go read about data types. int, float, dobule, boolean, String, etc...
>>
The code is working bu t I'm not sure how to use the blob type to upload yet. I'll keep researching, thanks frens. Am I doing it right? Is there anything else I need to organize my tables better?
 <form method="post" enctype="multipart/form-data">
<label>Title</label>
<input type="text" name="title">
<input type="file" name="file">
<input type="submit" name="submit">
</form>
</section>
<section>
<a href=".html">Animation</a>
<footer>
<img src="coin.png" alt="coin" width="50" height="50">
</footer>
</section>
</main>
</body>
</html>
<?php
$localhost = "localhost"; #localhost
$dbusername = "root"; #username of phpmyadmin
$dbpassword = ""; #password of phpmyadmin
$dbname = "Renaissance"; #database name

#connection string
$conn = mysqli_connect($localhost,$dbusername,$dbpassword,$dbname);

if (isset($_POST["submit"]))
{
#retrieve file title
$title = $_POST["title"];

#file name with a random number so that similar dont get replaced
$pname = rand(1000,10000)."-".$_FILES["file"]["name"];

#temporary file name to store file
$tname = $_FILES["file"]["tmp_name"];

#upload directory path
$uploads_dir = 'images';
#TO move the uploaded file to specific location
move_uploaded_file($tname, $uploads_dir.'/'.$pname);

#sql query to insert into database
$sql = "INSERT into fileup(title,image) VALUES('$title','$pname')";

if(mysqli_query($conn,$sql)){

echo "File Sucessfully uploaded";
}
else{
echo "Error";
}
}


?>
>>
where do i learn CSS, HTML, and JS
>>
>>80351034
You're going to get your tables wiped by the first script kiddie.
Use PDO (https://www.php.net/manual/en/book.pdo.php) and learn about prepared statements.
>>
>>80351038
>>80343959
>>
>>80349778
>>80349834
How about just learn to write SQL? I cna think up a database and write it down in minutes now.
>>
File: 1429505498725.png (183 KB, 370x359)
183 KB
183 KB PNG
currently using custom hooks for almost every logic shared more than once. Is this pajeet level ?
>>
File: 413R42AOaBL.jpg (18 KB, 333x500)
18 KB
18 KB JPG
>>80351465
>>80351062
I don't...
>>
File: gay.jpg (25 KB, 460x362)
25 KB
25 KB JPG
Anyone keep seeing those "software developer" memes? It's like "my code is a pile of shit and the code from stackoverflow is amazing", more stackoverflow memes about how people can't do their job without it.

Is this how the new wave of developers are?
>>
>>80352216
hahaha ”I can’t exit vim” that’s a good one haha you’re funny lol
>>
>>80346192
Commit neck rope
>>
>>80352216
The field is saturated with grass feeding retards who can't code for shit. It's unfair to generalise "muh new wave" when there's clearly a new set of great developers every generations. StackOverflow is also industry standard, no company is going to pay you to look through 3 programs manual for hours when you can just look it up online and solve the issue.
Bottom line I don't know what you're trying to achieve by slinging shit but are you even better than those devs you claim to be shit?
>>
>>80354200
Based PHP and MySQL Chads are the true strugglers
reject flutter trannies
return to monke
>>
>>80354312

>DDOS StackOverflow for a few weeks
>millions of shitty devs can’t deliver and get fired
>only real programmers left
>suddenly enough jobs
>IT is suddenly non-cancerous
>we can finally just focus on the fucking work
>>
>>80354664
Would backfire hard since SO is also used by competent people to share information on roadblocks like weird languages quirks.
Unironically just destroy plebbit.
>>
I didn't write a single line of code for the last three months because of beimg Covid19 patient, now that Im recovered I started to forget about a lot, I'm finding my self googling often even simple stuff, does any one had similar issue before?
>>
>>80343959
>Submit your project progress updates using the following format in your posts (the scraper will pick it up):
do I need to resubmit the image for progress updates?
>>
>>80354700

It’s not backfire, it’s collateral damage.

You can't make an omelette without breaking eggs, you know?
>>
>>80354702
Were you incapable of using a computer for three months from the flu?
>>
>>80347578
var is faster in chrome. I remember having to refactor a whole script because the stupid idiot that coded and left the company used "let" to be a hipster and it ended up not working in production. The only instance I've used const is for money formats.
>>
>>80346172
You can't recognize the <div> tag?
>>
File: sadapu.png (228 KB, 619x453)
228 KB
228 KB PNG
it's...it's not working lads
<?php 
$localhost = "localhost"; #localhost
$dbusername = "root"; #username of phpmyadmin
$dbpassword = ""; #password of phpmyadmin
$dbname = "Renaissance"; #database name

#connection string
$conn = PDO_connect($localhost,$dbusername,$dbpassword,$dbname);

if (isset($_POST["submit"]))
{
#retrieve file title
$title = $_POST["title"];

#file name with a random number so that similar dont get replaced
$pname = rand(1000,10000)."-".$_FILES["file"]["name"];

#temporary file name to store file
$tname = $_FILES["file"]["tmp_name"];

#upload directory path
$uploads_dir = 'images';
#TO move the uploaded file to specific location
move_uploaded_file($tname, $uploads_dir.'/'.$pname);

#sql query to insert into database
$sql = "INSERT into fileup(title,image) VALUES('$title','$pname')";

if(PDO_query($conn,$sql)){

echo "File Sucessfully uploaded";
}
else{
echo "Error";
}
}


?>

how do I combine it with this?
<?php
// PDO + MySQL
$pdo = new PDO('mysql:host=example.com;dbname=database', 'user', 'password');
$statement = $pdo->query("SELECT some_field FROM some_table");
$row = $statement->fetch(PDO::FETCH_ASSOC);
echo htmlentities($row['some_field']);

// PDO + SQLite
$pdo = new PDO('sqlite:/path/db/foo.sqlite');
$statement = $pdo->query("SELECT some_field FROM some_table");
$row = $statement->fetch(PDO::FETCH_ASSOC);
echo htmlentities($row['some_field']);
>>
how is their site so beautiful bros

https://stripe.com/
>>
File: website outline.png (24 KB, 1811x731)
24 KB
24 KB PNG
>>80355258
How it's going so far...
Is you sayin' that I be usin' PDO instead of MySQL?
*smacks lips*
sheeeeeiiiiit
>>
>>80343959
Id like to get a general consensus from any devs out there.
Lets say hypothetically I was going to write an Android/iOS app. I already have several published apps on android, and I'm reasonably competent at Android development. Worth it to look into Flutter? The thought of only needing to write 1 codebase is tempting.
>>
>>80344407
I barely ever done any tutorial and I do stuff like
Array.apply(null, {length: (n + 1)}).map(Function.call, Number);


I just work on real projects and learn from accomplishing something actually useful. Boring things are boring for a reason, it's because you know you're not accomplishing anything.
>>
>>80355313
beautiful but fucking hungry. that globe animation makes the site lag.
>>
>>80355344
please help me guys you can all be admins on my site! There's a secret special ingredient that makes this website better than all social media platforms!
how do I create a userbase now? how do I make it so people can have accounts?
>>
File: darkness.png (244 KB, 832x790)
244 KB
244 KB PNG
>>80355492
>>
File: maxresdefault.jpg (99 KB, 1280x720)
99 KB
99 KB JPG
>>80355524
I was doing fine until I couldn't use phpMyAdmin anymore.
I don't know how to use PDO to connect to my database, I don't know how to use MySQLWorkbench to create one, all it lets me do is create tables, no database to put them under
$db = new PDO('mysql:host=localhost;dbname=test', $user, $pass,);

I think I can use this to connect to the database...if I can create one
>>
File: .png (578 KB, 1902x2928)
578 KB
578 KB PNG
>>80355675
here's an exerpt of some code I fixed up for some anon a few months back. Just look at the connect function
>>
>>80355709
You write the database line by line in PHP? That's way different than what I was doing.
are you using
const DBNAME = "RocketAdmin';

to connect to the very Database class you are writing or is there a mysql based database somewhere in mysqlworkbench or xampp cmd?
>>
File: webdevs_are_trash.png (420 KB, 1848x2018)
420 KB
420 KB PNG
You should all throw yourselves off a bridge. Fucking webdev trash
>>
>>80355764
In MySQL you can have many databases.

CREATE DATABASE {name}
USE {name} // switches to that database
CREATE TABLE ... // Creates a table in your active database
>>
File: White Pepe.png (371 KB, 920x985)
371 KB
371 KB PNG
>>80355778
i-it's just a jumping off point for me
I'll start learning c++ and finish my c# game when I finish my site, I want a site to post them on.
>>
>>80355804
>>80355764
To clarify, you're not *writing* the database in PHP, you're connecting to the database in PHP.
>>
>>80355392
Yeah it does lmao and it also has one of those click and rotate animation thingies for no reason besides looking cool i guess
>>
>>80355778
I honestly feel like i'd fail that question too 2bh
>>
>>80355832
You have to write THAT MUCH code to connect the database? I really need to learn PHP then, go through all the data in the documentation in order...
>>80355804
Is that necessary? Should I have a database per webpage? That would make things easier to categorize. Could there be a main database for storing user information? Where do I write this stuff at so I can start storing values(I store values in databases right?) and files in a database?
MySQLWorkbench looks great, but it just seems like I can only create tables and can't link them to an actual database unless it's outside of MySQLWorkbench which has to be connected to...confusing
>>
>>80355778
It's another episode of no job tranny seething. come back after you've actually found a job ok
>>
File: carbon.png (280 KB, 2004x1380)
280 KB
280 KB PNG
So I just discovered lit-html and its the simplest, most intuitive library I've ever used.
>>
>>80355778
also this is a chill subreddit so if youre gonna post be COOL or go back to wherever you sperg about nerd shit like c++ programming and being poor
>>
>>80355918
>You have to write THAT MUCH code to connect the database?
Well, no. That code sample is using a MVC structure, (which models are representation of a table). The general goal though for a competent developer is to make your code readable by others. I just pointed out that you just want to use the connect function in that code snippet.

>Is that necessary? Should I have a database per webpage?
No, just use one database for your whole site. You're categorizing data by tables/columns.

>Where do I write this stuff at so I can start storing values(I store values in databases right?

Look at the query function. First, there's a connection to the DB, and then a SELECT statement. To add stuff you'd use an "INSERT" statement. "$req->execute()" executes the query which would run the statement and insert data in to the DB.

Honestly I'd just learn about MySQL / relational databases first before going balls deep in to PHP and other shit.
>>
File: bmk2.jpg (299 KB, 1419x1028)
299 KB
299 KB JPG
>>80343959
:: bangmarrykill.io ::
dev:: anon
tools:: Typescript, Vue, Vuetify, Kotlin, Springboot
link:: https://www.bangmarrykill.io/
repo:: -
progress:: unlocked female tv category but data still incomplete; minor changes
>>
So lets say I have 2 models of key value data IE a giant JSON cotaining info on cars and one on old boats. I know that the data in those will never change. How dumb would it be to use redis as a DB for those? Could I shove the data from boats into one redis instance and the data on cars into another?
>>
>>80356133
I did a similar thing with video games a while back. You using elo?
>>
>>80356133
I spent more time than i'd like to admit on your site the other day
>>
File: terminal (2).webm (454 KB, 320x240)
454 KB
454 KB WEBM
Dear PHPMyAdmin guy,
pls look at webm.

Using sql in command line is easy. You just have to practice it. Only annoying thing is selecting from large tables. I exclusively use terminal for all of my mysql needs.

>>80356133
Might I suggest just bang and kill? It's easier for elo. I'm not really aware of many celebs though so not sure which I would marry.
>>
>>80356133
Well built. I was blocked for doing a replay attack.
>>
>>80356255
It DOES look easy!
How do I know it gets saved in there? Can I go back and look at it after closing the command line?
>>
What's the best way to store a full stack project on github? have the .git in the root folder, make separate folders for frontend and backend stuff?
>>
>>80356332
The last command I write is a select query which shows what I just added.

So I really tried to show most of what you need.
show tables;
will show you all the tables in your database

desc tablename
will show you the schema of the table you have asked to be described.

select * from tablename
will show you ever column and row within tablename, so you can see everything added

You can even say like
select * from users order by id desc limit 1
to show the last inserted value to the users table
>>
>>80356383
Just put them all in the same repo unless they are running on different servers.
>>
>>80356304
What's a replay attack and how do I prevent it
>>
>>80356548
Check network tab on chrome. Select the fuck, marry, kill. a new item appears showing the request. Right click the request and hit 'replay xhr', it just resends the same request.
The site is tokenized which is probably used to prevent replays. I swear this guy was around when I made VidyaVote and remembers me getting replayed to death until my ELO algo failed and fucked the whole site. That was only like half a year ago.
>>
>>80356427
I see! Thanks anon-san!
>>
I feel dirty when i write css because i have to google literally everything besides the absolute basics and it feels like im just copy paste stitching components to make what i want
>>
>>80356563
Yeah I knew I shouldn't have asked. Now it's something else to think about when I'm already feeling swamped. Thanks though
>>
>>80356698
It's an important thing to think about. As a web dev you have to defend against common attacks.

Back with old PHP you didn't really have to worry about replay since you weren't using XHR, but these days it's normal to use PHP as a strict backend that you XHR. Not much different than using any other kind of backend.

Basically just have a token table and every time you send something to the user that is supposed to be done one time then you tokenize it and make sure to put the options in the database and invalidate the token afterwards, otherwise they can keep grabbing tokens for the same votes. That's what ended up happening to me. At first I didn't tokenize so a guy replayed the xhr over and over, then he let me know, so I tokenized it, but then he would just receive the new tokens and stuff the old values into the xhr causing the same effect. So you have to verify not only the token, but also what the values the token is for.
>>
>>80356788
and honestly for most things you won't need to worry at all. I run several saas products and none of them are tokenized. All I do is check that the user is subscribed and if not then they are redirected to the billing page. I also check that they have an active session. You're only going to need to worry about replay attack if there is some incentive to replay, which is usually if voting is involved.
>>
>>80356133
Man you make me really want to take the vue and vutify pill. Last time I tired react material design it was a clusterfuck
>>
>>80356816
Flutter is great for material design.
>>
>>80356830
sue sue shill
you just bring out the polfags
>>
what's a good fullstack project i can do, that others will find useful (not another clone or todo list app)?
>>
>>80356188
no, I just calculate how much a person was banged, married and killed as a percentage and make an ranking from that.
>>80356304
>>80356788
lol, I actually have to fix that. thanks for mentioning it. i don't think you were blocked. at least I don't see anything in the logs.
>>80356816
I like it so far. Don't know how it compares to React since I haven't used it.
>>
>>80356912
CRUD templates with the framework of the month, including some basic features like an admin panel, CMS, a landing page, so on and so forth.
Use case is for other anons to copy your work when asked in an interview to implement something retarded.
>>
>>80356912
design a headless CMS and blog that uses it
>>
>>80356931
maybe you have fail2ban running? I wasn't able to access the site for several minutes.
>>
>>80355372
>Flutter
So it works, but it's still buggy, but i think you'll find its way better for android dev, and works on other platforms too.

give it a shot anon, vs is way better then as
>>
>>80357133
yes but that should only affect login attempts afaik.
>>
>>80356840
that's not me, but he is true, flutter/material is all i use because it's so customizable
>>
I'm starting a new project and have a stack decision to make, it's just a portfolio project and my plan was to use node+express for the back-end, MySQL for the database (only storing comments really, since everything else will be static) and for the front-end I can either use React Native or Flutter, which of these is most likely to pull in potential employers?
>>
Any recommendations on where to get a pixel rain overlay?
>>
File: idk.png (29 KB, 453x156)
29 KB
29 KB PNG
Does sass/scss not recognize an index file if the folder has a number in it? When I remove the '0-' in the utilities folder it compiles fine and recognizes the index file. How come?
>>
>>80358175
I'm going out on a limb and guess the hyphen has some meaning in the syntax and needs to be escaped
>>
>>80358435
I don't think it's the hyphen. 'a-utilities' seems to work. Must be the digit
>>
im making a shitty little personal website and I want a tiling background, but I also want it to be animated, how do I have my background scrolling? Or is there something that will make a static image a scrolling tiling gif?
>>
>>80358894
like this how do I make an image like this
>>
what's the best way to deploy a vue app, backend, and elastisearch on to aws and to automate deployment with ci and shit
>>
>>80356133
I saw this earlier, pretty nice.
>>
File: 412442421412124.png (753 KB, 1149x832)
753 KB
753 KB PNG
Why isnt Svelte catching up in popularity? This shit is a godsend compared to Angular/React/Vue (And i used all 3 use two of them now). But its like people dont want to switch to something that is objectively better and simpler
>>
>>80354898
Nope. You don't need to rewrite most of the fields, project name, dev and progress is fine.
>>
>>80359638
Have they finished sveltekit yet? no one wants to jump ship while they're in limbo. If I'm gonna ditch react/cra/nextjs then I need a full replacement for the ecosystem not just a nice view library.
>>
File: LONDON.png (73 KB, 644x316)
73 KB
73 KB PNG
i wish fcc did PHP
>>
>>80358894
>>80359029
Like this https://jsfiddle.net/xj09a5ct/
>>
File: wpxd3aj.png (428 KB, 520x703)
428 KB
428 KB PNG
Never done did them fizzbuzzes before. If someone asked me to do it, this is what I'd give 'em.
If it was a job interview (and I wanted to show off readable code and whatnot) I'd replace the &&|| shit with a switch.
Array(100).fill(0).map((_, i) => (!(++i % 15) && 'FizzBuzz') || (!(i % 3) && 'Fizz') || (!(i % 5) && 'Buzz') || i)


Good enough for me
>>
>>80360153
updated, this version loops seamlessly, just changed it to loop over the same width and height of the tiled image https://jsfiddle.net/fnkzjrd2/
>>
>>80356816
>vutify
What is that?
>>
File: Autism_Speaks_Rebrand.png (61 KB, 500x199)
61 KB
61 KB PNG
>>80360174
The interview is over unfortunately anon, we've gone with someone who understood the point of the question. Good luck next time!
>>
>tfw all I have to get done today is transfer a website from staging to live
>client can't find their login details to manage the domain
it's all so tiresome
>>
File: 1611171414195.jpg (26 KB, 464x404)
26 KB
26 KB JPG
>>80360302
>>
>>80343959
:: rtnF ::
dev:: altilunium
tools:: go
link:: localhost
repo:: https://github.com/altilunium/rtnF
progress:: Now you can use it as Static Site Generator
>>
>>80360174
I guess it depends if the interviewer is a ES6+ fan or not. Nontheless, very original take.
>>
>>80360174
I'm curious though, can you do the switch, no idea how I'd do it with a switch
>>
>>80360535
Yeh. Based on my experiences as a wagecuck, ES6 is expected. Could of course be transformed to for-loops in a minute.

>>80360542
Something like this
Array(100).fill(0).map((_, i) => {
switch(0) {
case ++i % 15: return 'FizzBuzz';
case i % 3: return 'Fizz';
case i % 5: return 'Buzz';
default: return i;
}
});
>>
>>80360523
>Write something. It will be autosaved every 10 seconds.
You could trigger the save function on ever keystroke but debounce the function call to 500ms or so. I'm imagining a scenario where I write something and close it but it misses the save timer.
Looks cool though
>>
>>80360654
>switch(0) {
> case ++i % 15: return 'FizzBuzz';
> case i % 3: return 'Fizz';
> case i % 5: return 'Buzz';
> default: return i;
> }
the fuck? I 100% didn't know you could do this, you're the master of workarrounds
>>
File: vCKQJwt.jpg (12 KB, 355x258)
12 KB
12 KB JPG
>>80360702
thanks, bb
>>
>>80360734
How did you learn js?
>>
>>80360523
Do you use it yourself?
>>
>>80360747
self-taught webdev for about ~10 years. got a job in frontend like 2 years ago with no formal education.
>>
>>80360780
any resources you recommend?
>>
>>80360780
How did you so it?
It would be nice if people like you could help us improve the OP to make the path more clear for new beginners.
>>
why doesn't the vote update immediately?
import React, { useState } from "react";
import ReactDOM from "react-dom";

const Button = ({ onClick, text }) => {
return <button onClick={onClick}>{text}</button>;
};

function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min) + min);
}

const App = (props) => {
const [selected, setSelected] = useState(0);
const handleClick = () => {
setSelected(getRandomInt(min, max));
};

const vote = () => {
copy[selected] += 1;
sortedArr = [...copy].sort((a, b) => a - b);
return copy[selected], copy, sortedArr;
};

return (
<div>
<h2>anecdote of the day</h2>
{props.anecdotes[selected]} has {copy[selected]} votes
<br></br>
<Button onClick={handleClick} text={"next anecdote"} />
<Button onClick={vote} text="vote" />
<h2>anecdote with most votes</h2>
<p>
{anecdotes[copy.indexOf(sortedArr[sortedArr.length - 1])]} has{" "}
{sortedArr[sortedArr.length - 1]} votes
</p>
</div>
);
};

const anecdotes = [
"If it hurts, do it more often",
"Adding manpower to a late software project makes it later!",
"The first 90 percent of the code accounts for the first 90 percent of the development time...The remaining 10 percent of the code accounts for the other 90 percent of the development time.",
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand.",
"Premature optimization is the root of all evil.",
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.",
];

const max = anecdotes.length;
const min = 0;
const points = Array(max).fill(0);
const copy = [...points];
let sortedArr = [...copy];

ReactDOM.render(<App anecdotes={anecdotes} />, document.getElementById("root"));

>>
>>80360654
>switch(0)
ahh yes, javascript
>>
>>80360785
https://developer.mozilla.org/en-US/docs/Web/JavaScript
https://css-tricks.com/
http://vanilla-js.com/

>>80360810
My "secret" to success was probably that I actually like webdev. If I didn't do this as my job, I would (and did) do it as a hobby.

Also, 99% of the time I tried to reinvent the wheel. Before using a library (or even worse, a framework) I first learned how to implement my own version of that library.
Best thing you can do for learning is write your own code, instead of using other people's code. Reinvent the wheel, so you learn how things work.
Don't use CSS frameworks.
>>
>>80360883
why are none of your variables defined as internal state?
>>
>>80360893
>(!(++i % 15) && 'FizzBuzz')
can you explain the function of the ! there?
>>
>>80361093
X % N returns a remainder number. If that remainder is 0 (which is falsy), it means that X is divisible by N.
In that case the !(X % N) will become !0, which results in true.

! before a value just returns the boolean opposite of that value. So if the value was truthy, it returns false, and otherwise true.
>>
>>80361147
What happens with the true value afterwards though? Cause it only prints fizzbuzz, so where does the true go in the end?
>>
File: es6.png (502 KB, 1050x525)
502 KB
502 KB PNG
I don't get it. You are now encouraged to only use const and let but wouldn't using const turn your variable into a static useless thing?
I'm a beginner and don't really know anything
>>
>>80361171
expr1 && expr2 returns expr2 if expr1 is truthy
>>
>>80361246
Maybe read up on it a bit before asking stuff like this
>>
>>80360297
Vuetify. It's a component library for Vue. Unless you're in your learning phase you should use a component library so you don't waste your time reinventing the wheel.
You can look through all the components here: https://vuetifyjs.com/en/components/alerts/
Vuetify uses treeshaking which means that the production code should only contain the components you actually use. But you should verify that.
>>
>>80361246
>wouldn't using const turn your variable into a static useless thing
then use let when it needs to change
>>
>>80361246
sometimes you just want to remember a value
const result = operation();
if (result > threshhold) {
return result + 1;
} else {
return result;
}

also const doesn't mean immutable, it just declares the reference to be constant, not the value which means you can still manipulate const arrays and objects
>>
>>80361030
as in
 
const [selected, setSelected] = useState(0);
>>
>>80361257
You're a fucking beast brub, thx for clarifying.
>>
Is it a good idea putting margin 0 to everything? Chrome pissed me off many times with random margins that I don't want
>>
>>80361534
Maybe this will help https://css-tricks.com/reboot-resets-reasoning/
>>
>>80361534
* {
margin: 0;}
>>
>>80351631
Bump
>>
File: 1613598008556.png (19 KB, 220x227)
19 KB
19 KB PNG
which should i use react-final-form vs formik?
>>
>>80361422
Not that anon but just so you no there are downsides to using the && trick. You might consider an empty string or the number 0 or false a valid value in some scenarios, but because they are "falsy" you will get the fallback value. The new nullish coalescing operator ?? exists because of this. You only get the fallback if the value is null or undefined. Useful in different scenarios.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator
>>
>>80361534
No it's not but you will find lots of people that do it. There are hundreds of default html elements you probably don't even realise exist that are going to lose spacing because you zeroed everything out. This is especially important if you have users using a cms that outputs markup for you.
>>
>>80361925
yeah that's what i was thinking. i'll just add it to individual elements instead
>>
>>80358894
>>80359029
the other anon already posed a solution but can't you just use that gif as background image?
>>
>>80360883
Because your stateful vote holder, ‘copy’, is defined outside of react. React function components will update whenever:
a) props change
b) hooks change

‘copy’ is neither a prop nor a hook. React is not observing value changes to it.
>>
>>80361948
for me it's normalize.css
>>
Do I have to flatten the parent array for this to return true?
var test = [
"1",
["2", "3"],
"4"
]

if (test.includes(3)) {
console.log("true")
} else {
console.log("false")
}
>>
>>80362115
Forgot quotation marks in includes but you get the idea
>>
>>80362043
thank you
>>
>>80362115
Yes. Or do a recursive search. Depends on your use case.
>>
File: nested array includes.png (13 KB, 322x472)
13 KB
13 KB PNG
>>80362115
aren't you writing this in a browser?
>>
>>80362184
he already knows it returns false
>>
>client asks me if there's any room to negotiate day rates
>"no..."
>well ok then
I've freelanced quite a lot now and I've never given a client a reduced rate when they ask and they've always still given me the work. If they know you're good at what you do nit picking over money is rarely a genuine concern.
>>
//Convert HTML Entities
//Convert the characters &, <, >, " (double //quote), and ' (apostrophe), in a string to their //corresponding HTML entities.

I'm losing my mind over this wtf it's supposed to be so simple...
I don't want the answer I wanna know what's wrong with my code

here is my code I'm an absolute beginner btw

function convertHTML(str) {
var arr = str.split("");
console.log(arr);
console.log(arr[6] == "&")
for (let i = 0; i < arr.lenth; i++){
arr[i] == '&' ? arr.splice(i,1,"&amp;") :
arr[i] == "<" ? arr.splice(i,1,"&lt;") :
arr[i] == ">" ? arr.splice(i,1,"&gt;") :
arr[i] == '"' ? arr.splice(i,1,"&quot;") :
arr[i] == "'" ? arr.splice(i,1,"&apos;") : null;
}
console.log(arr);
str = arr.join("");
console.log(str);
return str;
}

convertHTML("Dolce & Gabbana");
convertHTML("Sixty > twelve");
>>
my friend, you've written a monstrosity of a multiple line ternary statement, please do the needful and write it in a normal way, will probably fix itself in the process
>>
>>80362448
meant for >>80362348 obviously
>>
>>80362448
I tried a switch statement and it also failed
>>
>>80362476
a switch statement makes sense, put it back in and lets work from there
>>
>>80362484
function convertHTML(str) {
var arr = str.split("");
console.log(arr);
for (let i = 0; i < arr.lenth; i++){
switch (arr[i]){
case "&":
arr.splice(i,1,"&amp;");
break;
case "<":
arr.splice(i,1,"&lt;");
break;
case ">":
arr.splice(i,1,"&gt;");
break;
case "'":
arr.splice(i,1,"&quot;");
break;
case '"':
arr.splice(i,1,"&apos;");
break;
}
}
console.log(arr);
str = arr.join("");
console.log(str);
return str;
}

convertHTML("Dolce & Gabbana");
convertHTML("Sixty > twelve");

still don't have a clue lol
>>
>>80362348
first of all use to post code here. secondly this >>80362448.
but concerning your code where is the assignment in the for loop? you don't reassign the value if I'm not mistaking.
>>
>>80362582
ok, sorry. splice does that I guess.
>>
>>80361246
const test = [1,2,3]
test.push(4)
console.log(test)
>[1,2,3,4]

It is magic :)
>>
>>80362582
>first of all use to post code here
huh?
like this?
>>80362580
>>
>>80362580
you misspelled length
>>
File: file.png (51 KB, 771x774)
51 KB
51 KB PNG
>>80362115
Expanding on this, what's the smartest way to flatten this while ignoring duplicates?
I tried this approach but it didn't work (?) https://jsfiddle.net/1rfze9bL/
>>
>>80362580
>>80362615
you have a typo in there. arr.LENGTH
>>
>>80362665
>>80362690
OMFG kek
fuck me thanks anons maybe it's time to take a break
>>
>>80362683
your code does do any flattening
new Set(arr.flat())
>>
>>80362348
>>80362580
Late answer, but maybe something like this would be cleaner:
const symbolsMap = {
'&': '&amp;',
'<': '&lt;',
'<': '&gt;',
'"': '&quot;',
"'": '&apos;',
};

function convertHTML(str) {
var arr = str.split('');
console.log(arr);
console.log(arr[6] == '&');
arr = arr.map((x) => symbolsMap[x] || x);
console.log(arr);
str = arr.join('');
console.log(str);
return str;
}
>>
>>80362731
Thanks. This fixed it https://jsfiddle.net/aeq5xtn9/
>>
>>80362115
>>80362683
there's literally a function called flat that you can use.

var test = [
"1",
["2", "3"],
"4"
]

if (test.flat().includes("3")) {
console.log("true")
} else {
console.log("false")
}


mind that you have to use "3" as a string. you have it as a number which doesn't work anyway.
>>
>>80362715
Happens to everyone. Here's a more concise example on how you could do it a different way. Most people don't realise str.replace accepts a function instead of a replacement string. You don't have to do any array conversions.
function convertHTML(str) {
const swaps = {
'&': '&amp;',
'<': '&lt;',
'>': '&gt;',
'"': '&quot;',
"'": '&apos;',
};

return str.replace(/[&<>"']/g, found => swaps[found]);
}

console.log(convertHTML("Dolce & Gabbana"));
console.log(convertHTML("Sixty > twelve"));
>>
>>80362731
isn't the new Set unnecessary?
>>
>>80362768
It's needed if you only want unique values. Sets only contain unique values.
>>
>>80343959
What do you guys test on your application? I'm getting into tests and I made one to make sure the component is not crashing hit what else is important to test?
>>
>>80362763
very interesting function, many times I've wonderd how to do this, saved.
>>
>>80362763
sorry I don't understand the function inside map?
what does the || operator do here?
arr = arr.map((x) => symbolsMap[x] || x);

>>80362735
thx anons
>>
>>80362851
oh I got it thx again
>>
>>80362750
Yep. That simplified my code quite a bit
>>
How harder is it to use Java or C# as back end instead of PHP?
>>
>>80362994
Lots of boilerplate but not very hard, specially if you use spring boot for the java backend, still, simple PHP is maybe as lightweight as you can go with something like toro.
>>
>>80362994
I only know that Java is a bitch, I'm guessing once you know the dos and don'ts it must be a smooth ride. But until then you're swimming in a sea of errors everywhere and no idea how to step out of them.
>>
>>80360174
I used this similar solution, which I think I stole from some anon here:
Array(100).fill(0).map( (n, i) => i > 0 && console.log(i % 15 ? (i % 5 ? (i % 3 ? i : "Fizz") : "Buzz") : "FizzBuzz"));

Aced the interview, and now I’m making 100k a year:^)
Thanks /wdg/
>>
>>80362994
java + springboot is pretty nice. it has a lof of functionality that you learn to appreciate. haven't used c#.
although I prefer kotlin over java. less boilercode but same funcitonality since it runs on the jvm.
>>
>>80363075
>aced the interview
>for a memorised 1 liner
the company is retarded for being impressed but I still respect your hustle
>>
>>80363075
I understand it, but it is abstract as fuck and counter-intuitive as fuck
>>
>>80363133
Sorry the interview and job was a joke
But I thought it was an elegant or innovative take on FizzBuzz, but then again I’ve only studied frontend for about 6 months so what do I know. I thought the challenge was more of a meme where the implementation was a larger part than solving the actual challenge
>>
>>80363447
>>80363447
the point of fizzbuzz is exactly to see if you can suck up the ugly
if div 3 then
if div 5 then
fizzbuzz
else
fizz
fi
else if div 5 then
buzz
else
i
fi

or if you try to be clever about it at the expense of readability
>>
>>80363447
>>80363638
yeah, one liners are cool but at the end of the day readability is 10x more important.
although I have no clue what interviewers want to see.
>>
>>80363447
>elegant
>innovative
>creating an array unnecessarily
>looping through it to fill it with zeros
>looping through it again to find the required values
>using map instead of foreach, returning a new array for no reason
>nested ternary operators
It's very clever anon, but as you will no doubt learn it's neither elegant in it's design or innovative in it's conception. I only point it out in case someone thinks this would be a good thing to do in a real code base. No shade against anyone fucking around for fun.
>>
Is there any way to sniff a post request's parameters sent from an android device? I'm trying to reverse-engineer an old app that fetches data from a public API but I want to see which params they're sending, my results and theirs are too different.
>>
anybode here using postgREST?
https://postgrest.org
>Using PostgREST is an alternative to manual CRUD programming.
>>
>>80363765
We use it in production for a few things so can't really tell how it holds up under huge pressure, but it gets kinda awkward if you need to write more than simple filter queries.
>>
>>80363765
>>80363785
what about business logic and data transformation? you have to define it all at the DB level? what's the escape hatch?
>>
File: 1601919167914.jpg (140 KB, 1279x960)
140 KB
140 KB JPG
>>80363670
>creating an array unnecessarily
Only in the console.log version

>looping through it to fill it with zeros
>implying v8 won't try a fast fill if possible

>looping through it again to find the required values
ah yes, i'm sure you would rather unroll the loop

>using map instead of foreach, returning a new array for no reason
Only in the console.log version

>nested ternary operators
see above. although i do agree, that's ugly af

For the console.log version .map is not needed, as the main point of the snippet is to log text to console. For the non-console.log version .map makes sense, as if you're implementing such a snippet, you probably want to actually use the results for something.
Depends if the task description was to >log fizzbuzz, or to >return an array of fizzbuzz.
>>
>>80363674
don't have any experience with this but off the top of my head i'd probably use tcpdump on the router (or anbox) and if it's encrypted, find the servers it's communicating with, reroute those names/ips to a reverse proxy with a cert you have trusted in android and use ssldump
>>
if i create a scraper that scrapes /g/ every day, and update a DB with most popular thread topics on /g/. and i create a front-end that shows what the most popular topics are. does that count as a CRUD fullstack app?

>backend sraper creates, updates, deletes database with most popular topics
>frontend reads from the DB to display results
>>
>>80364048
yes
>>
>>80364086
although actually I'm not sure since the backend doesn't have endpoints for crud operations.
>>
>>80363874
Kind of a complicated setup but this will work, thanks.
>>
File: vue-cli.png (101 KB, 1920x829)
101 KB
101 KB PNG
So I'm trying to build a simple form with a json server with vue-cli.

I'm following this:
https://shouts.dev/vue-js-cli-api-post-request-with-axios

As it is rn I have 2 package-json. One on the root of the project and another one inside a folder called axios-form I created with vue create axios-form.

I'm following this if someone feels curious. Obviously it doesn't run, but I'm curious, what is creating a duplicate project? I'm obviously doing something wrong. Just as a headsup, I don't fully understand vue-cli or npm to begin with.

Pic related the two package.json objects I have.
>>
>>80364325
I think I figured it out, I had to cd into the folder first
>>
I was tasked with splitting two node projects that live on the same repository. They use the same package.json, is there any utility that will help me trace which modules each one actually uses?
>>
>>80364460
Just remove one package at a time and run your unit tests to verify it didn't break anything.
>>
>>80364584
Yeah, that wouldn't be an option, project is quite big and the test coverage is less than optimal so testing it would be a pain in the ass.

After more looking around apparently webpack can do it for me, people in here don't seem to know what foresight is kek.
>>
>tfw spend time doing useless refactoring and colorising the fucking console messages in flutter

how to stop procrastination goys? I am 99% finished, but it's probably just fear of failure and I am delaying the remaining 1% of work for months now.

>inb4, it looks gay (it's dracula theme). also, nohomo
>>
>>80363859
You’re right, I’m assuming the console log version, although I’ve never seen it framed not as a console log.
>>
File: a7c8aocr.jpg (213 KB, 1142x800)
213 KB
213 KB JPG
>>80365016
>dracula
>not monokai
you literally had one job
>>
>>80365139
I love such colours, and Dracula hit the sweetspot. They just made the BG too purple.
>>
Bros how do I restart/stop npm run serve????
>>
>>80365322
And no Ctrl + C doesn't cut it, I literally have to restart my computer. Bls h4lp.
>>
>>80365322
>>80365334
npm run serve is just a shortcut for some other bash command in package.json

if it's using nodemon, you type in "rs" into the terminal to restart it
>>
>>80365334
get the PID from
>ps aux | grep -i node
and then
>kill -9 PID
where PID is the PID you got from the first command

might be multiple PIDs
>>
>>80365363
I found someone saying
killall -9 node
would that work?
>>
>>80365389
probably, yeh. just like learn to kill processes
>>
>>80365389
>>80365402
>>80365363
I tried, killing the node process stopped the process in the console, but that doesn't seem to be enough to avoid a "too many watchers" on the thingie if I want to start it again. Full restarts, fml.
>>
>>80365016
>flutterjew
i use neonwave that requires some hacky shit just to work

i'm prolly porting my source to everyone

also anon i know you can do it.

>>80357403
react native if you're boring
flutter if you're willing to take a risk to make way more, although there is allready jobs from flutter itself opening up
>>
>>80366042
>>flutterjew
just us flutter for mobile. Usually I use react/ts... Would use react-native, but the performance sucks. At least it sucked 2 years ago when I tried it.
>>
>>80343959
how do I add a class to a clicked element with react (useState).
example: add class .active on clicked element on navbar.
>>
Does removing an element from the DOM remove all event listeners attached to it?
>>
>>80366279
apparently it doesn't
>>
>>80366388
hmm good to know. thanks
>>
>>80366279
no you have to remove them enjoy your memory leaks
>>
>Foundation
>Material UI
>Bootstrap
>Antd
>Bulma
>Tailwind
which is best?
>>
File: file.png (7 KB, 436x193)
7 KB
7 KB PNG
I'm looking for a way to quickly grab a YT id from a link. It will only be fed videos in plain format so no p laylists, no s horturls and so on. Would a simple match with the following rule be enough?
>>
>>80366590
If that's the only format then I'd just split by = if they add more characters to the IDs eventually. Most solid way is to just parse the URL.
>>
>>80366590
If they're all in that format just take the last 11 characters. Otherwise

[A-Za-z0-9-_]{12}
>>
>>80343959
I'm updating a checkbox value in react code, it updates the value of the checkbox on the page but it doesn't change the appearance of it. Anyone know what's going on here?
>>
>>80366831
FUCK wrong number, but you get the idea. looking for ?v= might not work since sometimes it's youtu.be/XXXXXXXXXXX
>>
>>80366846
Ye that's what I meant with plain format. That won't be the case. In the end I used .split("=")[1] since it's just one line thing
>>
>>80365699
you need to raise your inotify file thingy limit. google how to do it
>>
>>80366042
>react native if you're boring
Honestly just probing around, I'm pretty comfortable with either one but I've been trying to get into mobile dev professionally and there seem to be more openings for react native at the time, I think in the end I'll just end up making two separate projects with both frameworks.
>>
File: vue-cli.png (118 KB, 963x701)
118 KB
118 KB PNG
Bros, any idea why vue isn't picking up ANY values on the options I'm setting? I'm seeing examples arround and I'm literally doing nothing wrong. But not only it doesn't pick the :value (it does pick one though the one I highlighted), it doesn't pick up simple manually set value. So what is this fuckery? It reads from the jSON, it is printing the data on the v-for => item. But for some reson it is acting weird.
>>
>>80360153
a thousand blessings upon you
>>80361975
wrong colors and the squares are too small
>>
>>80367416
Did you find any webpage where you could make a pattern like that? You gave me an idea for my portfolio site with a cascading, parallaxed background.
>>
>>80367597
I made a simple checkerboard pattern in paint.net (the program)
>>
>>80367614
Sounds simple enough.
>>
>>80367346
the data comes from something like this:
"thing": ['a','b','c']

Is Vue punishing me for trying to use simple data formatting? Does it want me to do:
"thing" : [
{value: "thing1",
text: "thing1"},
{value: "thing2",
text: "thing2"},
]


Or what is the fucking deal here?
>>
>>80367068
1. use flutter first, be amazed at google technolog
2. realize even though it's underdeveloped it's almost 3 years old and still beats rn on speed and performance
3.ditch reactnative and watch your flutterdick grow 6 inches
>>
>>80366097
the js bridge is history
dart compiles to asm
that means i'm technically lower level and higher level all at the same time
>>
>>80367870
>that means i'm technically lower level and higher level all at the same time
imagine being this retarded while trying to convince people to join your side
>>
>>80367721
>>80367346
>>80367346
this:
>>80367721
worked, which imo means vue catters to absolute retards, why use an object when you can just use an array, full retard. Or am I missing something bruthas?
>>
>>80367346
>>80367721
probably because it's nested data.
>>
Do you ever ask someone to rate your code? I always feel like I'm writing garbage. Although it works once I'm done I live with the fear it's going to break the moment I stop thinking about it
>>
>>80368147
try something like this

computed: {
firstName: function() {
return form.firstName
},
lastName: function() {
return form.lastName
}
}

>>80368293
My code is reviewed at work. If you don't have a job you can probably post it here or in the daily programming thread and get feedback.
>>
>>80368204
I have no idea what you mean but this is what happens:

// this doesn't work
<option v-for="item from (this is a simple array)" :value="item(this won't work)">{{item (this works)}}</option>

// this works
<option v-for="item from (this is a simple array OF OBJECTS)" :value="item.value(this works)">{{item.text (this works)}}</option>

>>
>>80368311
the soruce has this format:
{
"form-data": {
"names": ["it1","it2","it3"],
"surnames": ["it1","it2","it3"]
}
}
>>
>>80368375
>>80368311

which I reformated to:
>>80367721
>>
File: feells.png (59 KB, 1347x764)
59 KB
59 KB PNG
>>80356255
I'm using MariaDB and can't seem to get it to work
>>
>>80369057
Anon, it already tells you what's the problem. It says "no database selected". So you need to select it by typing "use anon"
>>
>>80369057
use [database_name];
>>
>>80369134
without the brackets of course. also as the other anon said open your eyes.
also it's show tables; with an s.
>>
Does anyone have any good recommendations for WooCommerce tutorials? I already have experience with making custom WPT I just have never use WooCommerce before.
>>
>>80369169
What are you trying to learn specifically, how to setup and configure it or how to develop plugins/customize the functionalities it?

I don't have any tutorials to share but I learned Woo just by fucking around with it. Eventually landed a job doing customer support for a company that has a major Woo plugin.
>>
>>80368293
>Do you ever ask someone to rate your code?
I tried to get my colleagues to do code reviews for my code, but it never happened. So in the end I just quit.
Instead I teamed up with a anon and hope to make some good money with zir.
>>
>>80368311
>you can probably post it here
It's just a userscript for personal use that I plan to suggest every time somebody asks if x thing exists. I kinda cringe just calling it code but it's probably the most complex thing I'm still maintaining after all this time
>>
>>80369593
>What are you trying to learn specifically, how to setup and configure it or how to develop plugins/customize the functionalities it?
I guess just the basics. My boss wants me to implement an online store into an existing website (its for the giftshop of a bar) and he already has some extension that can be used with woocommerce to process the credit card payments apparently.
>>
File: reels.png (63 KB, 1346x767)
63 KB
63 KB PNG
>>80369151
Do I have to create the tables somehow?
>>
>>80370231
first step:
.connect to DB
. . use nameOfDB
>>
>>80360174
sorry, we asked you to print the values, not store them in an array. thanks for your time though, im sure you'll do well elsewhere.
>>
File: af2.png (29 KB, 741x568)
29 KB
29 KB PNG
>>80370253
The database off phpMyAdmin?
>>
new thread >>80370337
>>
>>80370331
whatever db you want THAT EXISTS
>>
File: 157070.png (39 KB, 200x200)
39 KB
39 KB PNG
>>80370370
how do I make it exist?
>>
>>80370402
wait, all you have to do is type it in the command?
sheit
>>
>>80370402
go to the other thread let's talk there
>>
>>80370231
;



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.