[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] [Home]
Board
Settings Home
/g/ - Technology



Thread archived.
You cannot reply anymore.



File: op.png (251 KB, 824x553)
251 KB
251 KB PNG
lazy fucks not making threads and only eager to shitpost
this is probably the worst general on /g/
Even that thread about literally wrist-watches probably has more posters
>hurrrr how do I flexbox
>hurrr I learned HTML and jQuery, what now?
>hurrr whats MDN, whats a google?
>anon can you please google for me?
>retards shilling their discord server and splitting up the thread even further
like half of these threads don't even make it to 310 and just die in the night

>Previous Thread
>>64062407

>Free resources to get started
Get a good understanding of HTML, CSS and JavaScript.
https://developer.mozilla.org/en-US/docs/Learn - a good introduction (independent of your browser choice)
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://www.freecodecamp.com/
https://www.codecademy.com/
https://bento.io/

>Further resources
https://github.com/iRaul/awesome-portfolios - Portfolio examples
https://github.com/kamranahmedse/developer-roadmap - Roadmap
https://stackoverflow.com/ - Developers asking questions and helping each other

>Tools
https://jsfiddle.net/ - Use this and post a link, if you need help with your code
https://caniuse.com/ - Check browser support for front-end web technologies
>>
>>64111986
Fpbp
>>
I wrote up a SQL database design plan for my website but instead of making one like a normal person I just wrote up all the columns and tables basically.

How do I actually implement this?
>>
>>64112159
set up a db server and build the tables? If they have relations make sure you're using a relational db
>>
>>64112264
I mean in my Java code...and SQL is relational.
>>
File: 1513890149797.png (199 KB, 544x428)
199 KB
199 KB PNG
>>64111986
Can you help me here?
>>>64110235
Basically, I want to show only one user in that line.
Editing CSS in Kapchat (yes, I don't know CSS)
https://community.nightdev.com/t/kapchat-only-want-subscribers-displayed-on-stream/7930
I want the opposite of that, tried :not()
.chat_line[data-nick=:not("username")] {
display: none;
}

but doesn't work ;_;
>>
What is a good beginner-ish web app to make? I want to do it in Angular2, and i just finished a basic task-list app. Dunno where to go from here though.
>>
Anon who has been asking for help for days with his final project. If anyone has any experience with using google map marker clustering and knows how to implement it please help me.

I have to present my project to everyone on Friday and right now it's nothing but a some divs. Alternatively if anyone can point me to some resources that basically hold your hand on setting up googlemap marker clustering for react using redux please direct me there.
>>
>>64112159

install a SQL server and make the db files
>>
What software do you use?

I said in the old thread I'm using adobe dreamweaver and people asked if it's a bait. I don't understand why this could be a bait but ok, it isn't a bait, the software license expired and I don't have money or crack to it, so what do you use?
I read good recommendations about notepad ++.
>>
File: 1513392612076s.jpg (2 KB, 184x184)
2 KB
2 KB JPG
>>64112570
Extend what you already did, by adding a due date to the task and when it's only 1 hour until the date is due, send an email to the person alerting him/her.
>>
>>64112536
think the not has to go before the attribute like this
https://jsfiddle.net/16xohwzp/
>>64112570
something involving a backend is interesting for learning purposes.
Like a simple chat app, where the backend forwards messages to other clients via sockets or something like that.
>>64112572
Tried freelance sites? Upwork, etc.
>>64112691
because wysiwyg editors never let you create stuff to your full potential.
Any editor you commonly see will do. VS Code is good, but other people like Atom, Sublime or whatever else.
>>
>>64112730
yea i tried hackhands. Blew a shit ton of cash and got almost nowhere. If any anons want to look at my code please let me know. I'll take any help I can get honestly.

I'm googling to figure out what to do but really can't get anywhere. I was close earlier today but it all got fucked up now.
>>
>>64112572

maybe this:

https://github.com/istarkov/google-map-clustering-example

?
>>
>>64112783
or maybe this:

https://appendto.com/2017/01/google-maps-in-react-redux-interactivity-across-different-components/
>>
>>64112808
yea that's pretty much exactly what i have in my code right now and I have my long and lat coordinates as well for all markers I want to render. The problem is that I need to get them into the map component and I'm not sure how. Also i have no clue how to work react-compose.

I think I'm pretty dang close but I just can't make some connections
>>
>>64112879
search everywhere for your problem:

https://stackoverflow.com/questions/44390123/react-google-maps-markerclusterer-multiple-markers-at-same-location

stackoverflow has a section on the right side "related" that has question that might help with your problem
>>
>>64112879
this one is pure JS i think

https://github.com/googlemaps/js-marker-clusterer
>>
>>64112852
i saw that but not sure what to think of it.
>>64112925
maybe I just worded my problem incorrectly but I don't think those related questions are relevant. I'm rendering out my map and even got it to start at my desired location. At this point it's all about importing the coordinates and setting them as markers with state. Which is fucking confusing because of react-compose
>>64113037
thanks but I think i'm going to try and stick with what >>64112808 anon linked since I already have it in my code and all.

I really do appreciate all ya'lls help desu it might be the most help I've ever gotten on this site. I'm going to pull an all nighter and try to figure out react-compose and hopefully have some marker clusters on my map by 7am. If anyone has anymore ideas, examples etc please link me. Or if you want to be a kind soul in 2018 and actually talk me through some code on skype i'm fucking down. I'll monitor this and future threads if anyone responds
>>
File: 1514674980360.jpg (198 KB, 1200x1350)
198 KB
198 KB JPG
>>64112730

https://jsfiddle.net/16xohwzp/
.chat_line:not([data-nick="username"]) {
display: none;
}

Thanks bro!!!!
I'm so fucking happy right now <3
>>
Why won't my first callback invocation ever be invoked? I've checked with the debugger, user is indeed null, but i can't get the first call to callback to fire.

User.prototype.init = function (callback) {
dbAccess.findUser({emailAddress: this.emailAddress}, (user) => {
if (user === null)
callback(user); // this will never fire
this.salt = user.salt;
this.hash = user.hash;
this.alerts = user.alerts;
this.updates = user.updates;
this.settings = user.settings;
this.isVerified = user.isVerified;
callback(this);
})
};

>>
Say I have an active discord server. What would be the best way to store all the message data (author, message, reactions, etc.)? I'm trying not to have to rely on JSON, but that seems like the easiest.
>>
>>64114038
>callback a null object

shiggy diggy
>>
>>64114102
>I'm trying not to have to rely on JSON
why? you gotta a lot of time to waste?
> but that seems like the easiest
no shit
>>
>>64114113
I've got logic to check the null in the callback's scope. If it's null I'm returning 401. Is it not possible to callback a null value or something?
>>
>>64114171
>By convention in Node, the first argument to a callback is usually used to indicate an error. If it's something other than null, the >operation was unsuccessful for some reason -- probably something that the callee cannot recover from but that the caller can recover >from. Any other arguments after the first are used as return values from the operation (success messages, retrieval, etc.)

>This is purely by convention and there is nothing to stop you from writing a function that passes success as the first argument to a >callback. If you plan to write a library that is adopted by other node users, you will probably want to stick with convention unless you >have a very good reason not to.
>>
>>64114136
Preferably I'd like to use some sort of database software because I want to learn it for data analytics. Json can be passed into Tableau though so that works too I guess.
>>
>>64114341
use XML then
>>
File: 1476381101909.jpg (58 KB, 525x503)
58 KB
58 KB JPG
I want to make something like:

>[Light] [Dark]

Buttons, and when you click on either of those it displays different content. Nothing much, just a different background and some content.

How would I go about achieving that? Do I need Ajax for it? Can it be done in pure HTML/CSS?
I know how to achieve it by simply creating another page and linking to it... but can it be done in a style like hide content 1 and display 2; vice-versa?

Then again I'd like to change the background.... maybe I really should just create a new page and do a page loader with a nice transition or something. I guess it's not that bad.

If anyone has ever done anything like this and has any tips/videos/etc I'd appreciate it.
>>
>>64114282
I tried putting a string in place of the null user object and it still passes right over it on execution, even if I remove the second callback invocation.
>>
>>64114482
create a separate stylesheet and onclick set the stylesheet?
https://developer.mozilla.org/en-US/docs/Web/API/Document/enableStyleSheetsForSet
>>
>>64114651
Thanks, I'll check it out
>>
I have a goal for tonight: before I go to sleep, I'm going to figure out how to have these two nginx configs coexist and have both be served correctly.

Fucking hate this dockershit, really having a hard time with getting it to proxy correctly. I changed the ports in the setup as recommended on the git page, since you use docker-compose to get things going, but I still can't get the radio program to show up properly if I have my other stuff running (since I already have binds to ::443 and 80).

The repo for reference:
https://github.com/AzuraCast/AzuraCast

And the nginx config:
https://hastebin.com/uhamedequb.pl

And the playbook/compose file I changed (from port 80 to 9080, 443 to 8443, and one of the stations was bound to 8096->8097 due to it being in use as well):
https://hastebin.com/dizigejapa.http
>>
>>64114482

Couldnt you just do something like this (https://getbootstrap.com/docs/4.0/components/list-group/#javascript-behavior), except replace the listgroup with buttons and make the background color of the divs whatever color you wanted?
>>
>>64114482
>>64115458
This guy here,

This might be something more of what you were looking for, just a collapsible area. So you could have 2 buttons next to each other, one light one dark, and show different content based on what button they clicked.

https://getbootstrap.com/docs/4.0/components/collapse/#example
>>
>>64114038
>>64114171
>>64114494

This is what I ended up with.
User.prototype.init = function (callback) {
dbAccess.findUser({emailAddress: this.emailAddress}, (user) => {
if (user === null) {
callback(new Error());
} else {
this.salt = user.salt;
this.hash = user.hash;
this.alerts = user.alerts;
this.updates = user.updates;
this.settings = user.settings;
this.isVerified = user.isVerified;
callback(null, this);
}
})
};


If I didn't include an else statement the first callback would fire and then all the rest of the code in the callback's scope THEN return to where the first callback was called initially and continue to run until the second callback.

I don't understand why it behaves that way but thanks to >>64114282 for putting me on the right path
>>
>>64115389
>kill nginx service
>remove all images
>install and start it all up again
>changed the compose ports to 9080:80 and 8443:443 per the docs
>even less works now, but at least I can login to the admin panel
>stream portion of it via icecast works perfectly, as always, but I can't add any media because the media page outputs unhandled JSON that should point to a 404 page
>just wanted to self host a radio stream with a playlist module with easy configuration, instead of this abstracted turn key bullshit

Docker was a fucking mistake. Really just thinking about having a playlist creation script that feeds into liquidsoap into icecast or nginx directly or something.

Being an ignorant brainlet is suffering, but at least I'm learning something so far I guess.
>>
>>64116629
>abstracted turn key bullshit

truly cancer
nothing is worse to me
>just don't worry about it senpai :^)
>it just werks
>>
>>64116690
This.

"Declarative infrastructure" is a fucking meme that should have died back in 2012 with the puppet/chef faggotry.
>>
>>64116205
That's just the normal flow of code execution. Callbacks aren't magic, they're just functions. Execute one, carry on. Whenever functions return, the call stack unwinds. In the case of JS, all the way back to the point of the polling of the event queue
>>
>>64116690
>>64116708
Even worse is that the manual installation shit is still handled by a script that ONLY targets Ubuntu xx.xx LTS. Might look into the script, take it apart, and make it target stretch instead.

The suite is honestly really nice to work with from what I can use, but all of the setup shit is terrible. And the worst part is that it would work perfectly if this were a fresh VPS instead of a dedi with a bunch of pre-installed shit/nginx configs on it. Makes me want to grab another cheap VPS to dick around on, but I'm not really interested in dealing with 1-3TB/month limits when I'm streaming at 320kbps or lossless (since it would double fuck me, as the new VPS would feed from a read only sshfs mount).

At least it's not libretime, I guess. :^)
>>
>>64115458
>>64115557
Those will be pretty useful, thanks!
>>
newbie making a chat app in react that uses set interval. I have my backend linked up and working with my front end and have api routes for chats between two users. I can render out the messages in what I believe to be the correct order. All thats left is displaying a users name next to their text and also using set interval to fetch POST new messages that a user sends.

The problem is i'm already fetching to display all the messages between two users. I don't want to repeat displaying messages and have a bunch of duplicates. how do i handle this?
>>
>>64114136
would a format like

{ id: [timestamp, author, content, embeddedLinks, attachments, channel, reactions[] ]}


be good? i've never created JSON data before, so I don't know the best practices.
>>
>>64112264
>>64112573
Do you people seriously think I'm going to manually perform each modificaiton to the DB?

Well, basically from what I can see in the code I've been trying to glean from, POST requests etc. are rarely used in actual source code. But I'm too lazy to actually read like 30000 lines of code or whatever to find where the hell these variables and shit go. So what do I do?
>>
Ok guys. I'm an old webdev but its been like 4 years since I've done any. It seems like these Node.js frameworks have actually matured to the point of usability. Back in my day they were memey dogshit that had everyone excited because the names ended in .js.

I'm looking at express.js right now. Seems simple, lightweight, and unimposing on its implementation of MVC, which is what I want. Any other recommendations?
>>
File: t3_6vobft.png (157 KB, 676x616)
157 KB
157 KB PNG
>>64118078
an object with only one key (id) with an array as its value?
At that point you could as well just use an array directly.
>>64118844
I am still not sure I know what MVC is supposed to mean exactly.
I mean I know the definition, but it seems like you can just slap the term onto anything. It's just data and methods on a remote end somewhere...
Feels like its one of those terms like "Cloud".
Never did I think when writing code "Aha yes, this is my controller. And here is my model. Now lets make them interact, so I can send the data to my view."
>Any other recommendations?
Not directly Node related but have you also looked at the big 3 SPA frameworks yet?
React, Vue, Angular
It's definitely valuable to know at least one.
>>
Learning about SMACSS and BEM, using SASS.

Is this the correct way to set a modifier? My card--login class will just have a larger and more opaque shadow.

//module.scss

.card {

// --- borders & white space
border-radius: 25px;
padding: 60px 50px;

// --- color & shadow
background-color: $lighter-color;
box-shadow: 0px 0px 16px 0px rgba(20, 140, 210, .25);

// --- text & font
text-align: center;

&--login {

@extend .card;

box-shadow: 0px 16px 32px 0px rgba(20, 140, 210, .5);

}
}


I watched a video saying how something like this
<div class="card--login>..."
is better than doing this
<div class="card card-login>..."
, something about not depending on other classes to make my modified class work. Need to watch the video again to remember why, think it was this one https://www.youtube.com/watch?v=IKFq2cSbQ4Q
>>
I'm making two fetch requests to my api, one to get messages a user has received and another to get messages a user has sent. I can make the request of my api but I need to sort it all on the backend because it's way easier to sort datetime in rails than it is to in javascript which is my front.

example of the datetime i'm trying to sort
"created_at": "2018-01-03T09:23:18.701Z"
>>
>>64119612
and what are you stuck at?
>it's way easier to sort datetime in rails than it is to in javascript
why is that?
>"2018-01-03T09:23:18.701Z"
that iso datetime string seems very suitable for sorting purposes
>>
>>64119521
looks right, although are you sure the convention isn't double underscore?
>>
>>64120011
nvm i was thinking of sorting everything in a class. That would be something like Class.order(:created_at)

which apparently doesn't work with a regular old variable. On the plus side I realized i don't need to make two fetch requests since I can just use the id's i sent to the backend to find both ends of the sent and received messages.

Now i just need to sort "created_at": "2018-01-03T09:23:18.701Z" with ruby on rails which shouldn't be that hard if i just think
>>
>>64120017
I think BEM convention is

module__child ie card__button
module--modified-module ie card--login
>>
how do i do this shit like 4chan and many other sites where you can type something, refresh the page, and its still there when you come back?
>>
>>64120553
localstorage
>>
File: 1512867890614.gif (134 KB, 340x340)
134 KB
134 KB GIF
"b" + "a" + + "a" + "a"
>>
What's a good way to generate responsive, sortable tables very quickly? I need to be able to post updates from an Excel spreadsheet. Each daily update will be a seperate table with anywhere from 1000 to 15000 cells with data (although I can definitely reduce that). I do not want to share my document / use something like google docs.
>>
>>64122902
I guess Vue could be an easy option, if you need sortable elements.
What should be responsive about a table?
>>
>>64119320
>Never did I think when writing code "Aha yes, this is my controller. And here is my model. Now lets make them interact, so I can send the data to my view."

You'd be surprised. Some frameworks are actually quite imposing on this design pattern. ASP.NET MVC for example.
>>
File: 1432847736231.png (463 KB, 1070x601)
463 KB
463 KB PNG
>tfw to dumb too understand frameworks
>>
>>64123939
which one?
>>
>>64111986
Why do websites keep requesting desktop notifications?? This is the most annoying thing in the fucking world. They're trying to treat my laptop as a cellphone, or something.

Who the fuck would ever allow this?! Why is it even a thing? No one is allowing desktop notifications. How can I block websites from even asking?
>>
>>64123939
same senpai, React is a fucking nightmare. It's seemingly simple, but the way things are structured just blow my fucking head off.

You've got
>components(a hundred folders/files within)
>reducers
>actions
>etc.
>etc.
>etc.

And everything is all over the fucking place. That's the only thing I think is confusing. But creating everything in one file is pretty damn easy, but that's not "best practices", or the "react way", I'm told.
>>
>>64125413
>senpai
forgot about le epic troll fammmm*
>>
>>64125413
Might want to give Vue with single-file-components a try.
I used React one time and didn't enjoy it that much either in comparison.

>>64125366
Some kind of retarded marketing decision. From the same people, that think you will sign up for their newsletter by entering your address into the modal, that pops up, when your mouse leaves the window.
Pretty sure there is a browser setting to block it by default
>>
File: 1514821973493.jpg (39 KB, 476x600)
39 KB
39 KB JPG
>>64125413
Reducers and actions are not part of ReactJS, that is redux which adds a bunch of complexity and boilerplate. First learn React and when you are fully comfy with that add Redux. Learning the two at the same time will be harder and you won't be able to understand which parts belong to which framework/library/design pattern
>>
File: 1515006410938s.jpg (6 KB, 241x250)
6 KB
6 KB JPG
Recommend me a project in Javascript for my resume
>>
Is it possible to create a website that interacts with a user's local files without the need to upload it?

For example, creating an in browser video editor / image editor / etc.

I don't want the user to need to upload their files for privacy reasons.
>>
Hey react anons!
Do I have to extend the `React.Component` everytime?
Can I use functional patterns?
>>
>>64127038
Yes
https://developer.mozilla.org/en-US/docs/Web/API/Web_Storage_API
>>
>>64127290
Is this supposed to look like a weird /pol/ critique meme?
>>
>>64127327
No, it's just some random image in a google search
>>
>>64124565
Django
>>
>>64127445
django is fucking annoying to set up it kept throwing errors for obscure packages that i needed to download. fuck off with that shit.
>>
>>64121730
+"a"+"i?"
>>
>>64125366
behind every dumb website is an even dumber management major who somehow got a position in managing developers
>>
What's your stack, anon?
>>
File: anime question.jpg (25 KB, 433x380)
25 KB
25 KB JPG
Is it possible to use a scanner in Javascript without using DWT or Scanner.js?

My front end and back end are separate and I need the website to use a scanner.
>>
>>64127290
https://reactjs.org/docs/components-and-props.html#functional-and-class-components

Look at the first example
>>
>>64128559
>Scanner.js
github repo looks like it's also involving .jar files.
And there is no source apparently. Only the minified js output.

>>64128323
I like Vue on the front- and Node for the backend.
LevelDB if I need an embed-able long term storage.
>>
>>64129631

Yeah, there's some magic fuckery going on with Scanner.js. You also need to download and install a program to use it.

What really bugs me is the price tag on the license. I'm looking for a cheap/free alternative, but everywhere I look scanner.js and DWT are the only solutions. They can't be the only ones, right?
>>
>>64112159
Which RDBM's are you going to use? probably worth remembering that SQL syntax differs sometimes between vendors.
>>
>>64117485
What technology are you using backend? is it a simple Ajax chat that uses a timer to constantly fetch new messages or is it something more sophisticated like using node with web sockets etc?

>chat app in react that uses set interval.

Guessing it's a simple Ajax chat system. Best thing to do is have a field in your DB table that called "seen" or something, when you call your backend script it updates the retrieved records to true for "seen". Then your query for retrieving new messages will only select unseen messages is "seen" is false.
>>
Convince me I shouldn't mix promises and callbacks
>>
How do I know if a DOM Element is an input?
And by input I mean the equivalent of a
$(elem).is(":input")
.

I'm assuming any element that contains defaultValue must be an input, since <option> tags have values, but are not considered inputs. Is there a better way to check this?
>>
>>64130563

this tests if the parent of the input is a form element.
var isFormParent = $( "input[type='checkbox']" ).parent().is( "form" );
>>
>>64130615
But then I'm using jQuery. The whole point was doing it without jQuery, that's why I asked for an equivalent.
>>
>>64130691
https://www.w3schools.com/jsref/prop_node_nodename.asp

Simple google search would of done
>>
>>64130563
https://github.com/jquery/sizzle/blob/master/src/sizzle.js#L125
looks like jquery just checks for
input,select,textarea,button


>>64130840
>would of
>>
How liable are you for the shit your users post?
For example if a user posts an illegal image which is hosted elsewhere but displayed on your site, where would you stand legally?
>>
How come hardly anyone posts in webdev general?

Arent webdevs probably the most populous group on this site?
>>
How do I learn how to use d3.js?

I'm a beginner to programming with zero web development experience

that being said, html and CSS aren't really that hard to use
>>
>>64131573
>Arent webdevs probably the most populous group on this site?
not even close
you would think that chans naturally attract people interested in technology, but that's not necessarily the case. /g/ is still more popular than a bunch of other boards but also less so than music, sports and comics on here.
>>64131983
>How do I learn how to use d3.js?
>I'm a beginner to programming with zero web development experience
Hope you didn't expect anything other than people telling you to learn JavaScript then.
What are you interested in using D3 for?
>>
>>64130182
MySQL
>>
>>64119320
I'm not familiar with JSON objects at all. Would I be able to sort by that?
>>
>>64132250
Natively you can't sort an array of objects. Make your own function or Google some.
With loDash you could use _.sortBy(myArray, "id");
>>
Is there an easy and painless way of learning react or angular without having a mac? (win10 here)

can i use a VM without problems?

can i just do everything on linux?
>>
>>64132552
Of course you can. You pass a function to Array.sort() and have it sort whatever you want.
By the same logic you could say, that you can't natively sort an array of numbers.
>>64132250
>I'm not familiar with JSON objects
Just be familiar with JS objects. Read up on it on MDN if you need to. (technically the same)
What I meant was, that in your example, the object only had one single key, which didn't make it very useful as an object.
>>
>>64133014
windows also supports text editors and node.js
>>
>>64125366
this, i have been looking a way to block notifications, i already blocked the cookies notifications

>>64133075

So just install node.js?
>>
>>64133014
>can i use a VM without problems?
probably
>can i just do everything on linux?
yes

but you can just as well learn React on win10 if you want.
Install Bash for Windows (WSL) and you can keep using windows while being in a pretend-linux-environment.
Not sure if the Angular build setup was working correctly though. Think I only ever had trouble with that and MongoDB.
Vue and React worked just as well as on linux iirc.

I guess you could even stay completely on windows as well. Don't see why it wouldn't work.
Where did you come up with the idea, that you needed a mac for webdev?
>>
>>64133133
every webdev i see seems to be using one, to the point i start thinking i need one, it gets annoying to see so many maxs
>>
>>64133174
also, i have never tried to use MacOS so i'm a bit curious about what am i missing, if i install it what version should i install on a VM machine? do i need activation serial or something?
>>
Also what about jsfiddle.net/ would someone recommend me to learn to use React/Angular just building stuff there?
>>
>>64133174
>every webdev i see seems to be using one
Never go by that logic, especially in webdev.
There are so many languages, frameworks and tools you can use.

>>64133246
no, jsFiddle is suited for sharing code snippets.
Just use a good editor, create index.html, style.css and index.js and have a go at it.
>>
>>64132116
I think d3.js is cool to learn please teach me Mr web wizard
>>
>>64132116
I haven't used D3 before.
Was simply wondering since you already seemed to have something so specific in mind.
>>
>>64133411
>>64133730
>>
forEach should return the array used to call the function.
Just saying.
>>
i read that dynamically generating lots of html from javascript isnt a good practice. i'm currently working on a project using vanilla JS and kinda templating with JS with no framework. is this a bad idea?
>>
>>64116908
>the script was just echoing repo changes on a Ubuntu box
>try to dig into them, but each package pulls a differently named package from Debian (some of which may or may not have the headers I want)
>after a few attempts, scream fuck it and go back to trying to make this docker bullshit work
>purge it again, remove all trace of it and get back to trying to debug this garbage with limited knowledge of the structure or implementation
>there's something on another one of these awful one-level-above turn key implementations that's rewriting improperly maybe from an nginx snippet or something
>snippets dir has TEN FUCKING DIRS IN IT THAT ALL HAVE MULTIPLE FILES/DIRS IN THEM
>disable nginx confs one at a time, remove snippets one at a time
>kind of get things working in terms of binds/whatever else
>install the turn key radio bullshit again
>docker compose throws an error to do with the lock file and a directory that it doesn't have permission to as root (because it doesn't exist) after all of this and now absolutely nothing works on the radio shit
>remove all images, remove all containers, purge the git stuff I pulled, and now I'm going to start from scratch again (with only the docker-compose.yml modified)

I. FUCKING. HATE. DOCKER. I HATE ALL OF THESE FUCKING NIGGER DEPS AND THESE NIGGER ABSTRACTIONS WHERE YOU HAVE TO EXTRACT EVERYTHING MANUALLY JUST TO SEE HOW THEY FUNCTION. REEEEEEEEEEEEEEEEEEEEEEE.
>>
>>64134970
I'm confused, are you trying to run a docker host or client?
>>
>>64136980
I'm trying to run a container on this server, which pulls several other containers. So, host I guess? Nomenclature isn't exactly the most semantic thing for docker from what little experience I have or reading I've done.

Really have no idea what I'm doing with docker, I have most everything else setup "properly". Have this somewhat functioning, I just need to find the nginx config inside of this container/volume/whatever the fuck it is and have it proxy/rewrite the URL now. And then I can get into why it isn't reading a symlink properly within the docker container (reads it, but won't allow me to play/process symlinked music).
>>
>>64137227
So are you doing docker inside docker or something?? Write your own dockerfile based on a docker image from the hub.
>>
>>64137240
This is just some throwaway dedicated server seedbox with a bunch of data and meme programs on it (like plex, emby, this radio player for all of this music, and ru/rtorrent). This particular meme program is supposed to be "turn key" with an installation script that chain pulls a bunch of docker shit.

And instead of messing with docker all night, I would rather try to figure out how to edit this single file (nginx config) inside of the running container so it points to the correct SSL certs and isn't sitting on a non-standard internet facing port. Already made the mistake of running some script to get some stuff up and running when I was feeling lazy the other day, and now I'm paying for it with its bullshit nginx configurations. Really not interested in migrating 15k+ torrents to new ru/rtorrent instances in the near future, so my logic is that I can maybe force this one thing to do my bidding if I slam my head against it hard enough. Tfw I just wanted to listen to some music without being forced to download it on this slow connection.

Really wanting to get back to learning stuff on muh OpenBSD server instead of """"fixing""""" this nonsense. Currently dicking around with werc/nginx/cgd stuff while messing with some advanced dynamic CSS for templating and some vanilla javascript for proficiency's sake.
>>
>>64134435
map
>>
>>64134435
You should read some docs my man.
>>
Here is an app I made a few months ago using react. It's a combo notation translator for fighting games. It's hosted using github pages but I have my own domain name.
www.combotranslator.com
I wanted to add to it by doing a few things like allowing users to save and share combos online. I'm not sure what I should research to make this happen. Can anyone give me a push in the right direction? I'm not even sure if this is possible.
>>
>>64137494
>turnkey solution
>difficult to do low-level configuration
Yeah that's the tradeoff. Your problem has nothing to do with docker, and also isn't really relevant to /wdg/.
>>
Simply but important question:
What in the h*ck is the best way to do css animations with React?
>>
>>64140127
I'm talking about stuff like fade-in, fade-out etc.
>>
File: anime.jpg (240 KB, 750x850)
240 KB
240 KB JPG
>CodePen requires JavaScript to render the code and preview areas in this view.
>CodePen requires a referrer to render this. Your browser isn't sending one.
at least let me see the code
>>
>>64139334
need a backend then, unless you make it some kind of shareable URL, that translates to certain moves, but that wouldn't be searchable of course.
>>64140127
Not necessarily React specific, but anime.js is nice and small.
For fade-in -out any kind of animation library would be overkill though.
>>
>>64133174
You might not want it as your main computer, but you'll want as many of the major devices as possible to test your compatibility. You will lose large portions of your audience if the website doesn't work for them.
>>
good resources for better understanding RESTful APIs and other services? I know what an API is and what it does, but I want a bit more in-depth knowledge, not just a 5-minute tutorial.
>>
>>64130490
Uh it's usually not an option. There's tons of code that hasn't been updated to use promises, and inevitably you're going to mix it with code that has.
>>
>>64131573
You probably don't want a bunch of 4chan posts coming up when HR searches for the project you mentioned in your resume.
>>
I have a stupid question that I don't have the words to google for.

So I have been learning npm and when I do

npm install faker

i get

node_modules
---faker

Nice and neat but when I do install Express or even small packages like cat-me I get

node_modules
----dependency
----dependency
----dependency
----dependency
----dependency
----thingiwant
----dependency
----dependency
----etc

Why are some packages spread out and some neat?
>>
>>64142498
lol no, just because Apple keeps Safari as part of their walled garden, doesn't mean you have to buy overpriced hardware.
Your money is much better spent on some cross-browser-testing service if you want to check compatibility on browsers other than just FF and Chrome.
>>64143425
Packages can have other packages as their own dependencies.
There is no point downloading the same package multiple times for each package that depends on it.
>>
File: file.png (36 KB, 319x514)
36 KB
36 KB PNG
so I'm working on a userscript to use on twitter that adds a pair of buttons in the navbar on profile pages. everything works fine but the buttons are unloaded when I click on buttons that add dynamic content to the page without a reload (for example when I click on the Lists or Moments buttons in the navbar). so I thought I need an event listener for the job so that I can call said function when additional content is loaded.. anyone here with previous experience with twitter event listeners? is there a general rule I should look for or maybe there are specific rules for the lists and moments buttons?
>>
>>64133246
Install node, install cli in npm for framework, run cli
>>
>>64133014
OS has little to no impact on node. JavaScript is for your browser after all...
>>
>>64130357
You should probably use sockets for a chat and stop using Ajax. We have much better options now
>>
>>64128323
Dotnetcore + Dapper + azure SQL + Vue (typescript)
>>
>start learning webdev
>php, html, css
>pretty fun actually
>get to javascript

Jesus christ do people really enjoy using this convoluted piece of shit or do they just force themselves for money?
>>
>>64145621
do you have an example?

I could say the same thing about PHP, but I usually restrain myself from shitposting.
>>
>>64140127
just do it with CSS and keyframes. Don't shit your shit up with more libraries if they are not needed.
>>
File: online monk.jpg (30 KB, 298x298)
30 KB
30 KB JPG
what's your favorite HTML5 tag, /wdg/?
>>
>>64146810
i like https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details
>>
File: approval.gif (1.93 MB, 235x240)
1.93 MB
1.93 MB GIF
>>64146859
comfy choice anon!
>>
>>64143335

Check out Net ninja on youtube. I recall he had some tutorial series on that topic and bunch of other usefull stuff
>>
>>64145621

What is so convoluted about JS?

>>php

I guess different kind of people can stomach different kind of shit
>>
>>64145784
>>64147523
I was planning on learning PHP this new year, but reading your posts made me ask if it's a shitty language.
>>
>>64145621
How is PHP not worse? And slower too.
>>
>>64144067
That's what I would do, but the person I was replying to wasn't and wanted a solution for his approach.
>>
>>64148818
Been a PHP developer for years. I wouldn't say it's a shitty language, it's fun to use. There are plenty of frameworks out there to build scale-able applications in. It's also still one of the most popular server scripting languages out there. Go try looking for a Job, PHP always comes up.
>>
>>64150804
>PHP
>Pretty Hot Programmer
>>
hey fellow anons noob here

i wanna build a pwa spa in vue. I need to make requests to specific API and I have api key. So I guess I need backend for it to hide my API key and make request throught that backend.
my app -> my backend -> API

it wouldn't be unoptimal or something? I wish I could poll API directly, I don't wanna any db etc.
>>
I am wrapping my site with webview to make an android "app". Is there any legal and free way to do the same for these cunts? I don't have any of their products.
>>
>>64152308
write your app in a platform that exports for android, apple and windows phone
>>
>>64148818
PHP is an easier language than JavaScript since it's specifically for servers, and not a general-purpose language. That isn't to say it's not Turing-complete, however.
>>
>>64152297
depends,
if other people are not supposed to know it, then you can't just put it in your frontends code.
And they might not allow cors anyway?

Are those requests something, that your server can sensibly cache and distribute or is every request entirely unique?
Might just say what it is.
>>
>>64152588
it's something like reddit. site with topics, people can vote, comment.

Almost every person can generate own api key at certain limits.

So every request I need to ask their API for new topics, vote count. I don't wanna build app with full functionality. Just simple things to see how it will go and for fun.
>>
Does anyone know how to install php and mysql? Lot of resources point at xamp but it doesnt support mysql anymore it seems.

Can anyone help? I need to build a simple php server. Windows 7 user btw
>>
>>64152862
im surprised that xampp dont support mysql anymore lol

check homestead
>>
>>64152885

just use sqlite
>>
Was reading through the Cookie Clicker main.js file and found this, dude was trying to make the browser check whether it is Easter or not
//easter is a pain goddamn
var easterDay=function(Y){var C = Math.floor(Y/100);var N = Y - 19*Math.floor(Y/19);var K = Math.floor((C - 17)/25);var I = C - Math.floor(C/4) - Math.floor((C - K)/3) + 19*N + 15;I = I - 30*Math.floor((I/30));I = I - Math.floor(I/28)*(1 - Math.floor(I/28)*Math.floor(29/(I + 1))*Math.floor((21 - N)/11));var J = Y + Math.floor(Y/4) + I + 2 - C + Math.floor(C/4);J = J - 7*Math.floor(J/7);var L = I - J;var M = 3 + Math.floor((L + 40)/44);var D = L + 28 - 31*Math.floor(M/4);return new Date(Y,M-1,D);}(new Date().getFullYear());
easterDay=Math.floor((easterDay-new Date(easterDay.getFullYear(),0,0))/(1000*60*60*24));
if (day>=easterDay-7 && day<=easterDay) Game.baseSeason='easter';
>>
>>64153753
Dealing with dates and times is horrible.
Reminded me of this again https://www.youtube.com/watch?v=-5wpm-gesOY even if it's not 100% the same thing.
>>
>>64152308
I'm pretty sure you need MacOS with Xcode to build for iOS. You might be able to install MacOS on another computer, but I'm not sure how well that works.

Also you need to pay $99 per year for a developer account, which you need in order to publish to the app store, so you can't really get around the "free" thing.
>>
I've tried every fucking script that I found on some shitty blog and so and nothing works.

I got a form with a few text input and a file input (to upload a picture).
I'm sending it to php via JS so the page do not refresh, but I can't find a way to send the picture this way.
Any tips ?
Using FormData do not send it for some reason.

    var input = document.getElementById("picture");
var file = input.files[0];
var form_data = new FormData();
form_data.append('file', file);
$.ajax({
url: 'upload.php', // point to server-side PHP script
dataType: 'text', // what to expect back from the PHP script, if anything
cache: false,
contentType: false,
processData: false,
data: form_data,
type: 'post',
success: function(php_script_response){
alert(php_script_response); // display response from the PHP script, if any
}
});


to know if it's actually passing anything, I print_r($_FILES) and print_r($_POST), and it's just empy.
>>
Does anyone have a key for Prepros I can use? They're unlimited uses.
>>
>>64154412
add a
error: function() {
// doesnt work
}


to ajax to see the error
>>
>>64154093
Fuck Apple in the ass. I will pay the 99$ but no way am I getting one of their shitty products. I will just make a hackintosh in a VM.
>>
My Webstorm evaluation month ran out what's a good IDE for React that's free?
I have tried using Atom but I don't like that I have to install so many packages for every simple thing.
The node debugger is incompatable with Node v8 ffs
>>
>>64153753
>that spaghetti code
Use a function goddamn
>>
pipsqueak is coming for your fat asses
>>
>>64157025
vscode?
>>
I have a simple graphing program where i want to put it in a database. Can a foreign key be used twice that actually points to the same primary key.

[node] --- [edge]

each node has 0 or more edges. Each edge has exactly 1 from_id and 1 to_id. Note that an edge between a and b is only allowed to occur once, no duplicates.

node:
Primary key | node_id | int

edge:
Primary key | edge_id | int
Foreign key | from_id | int
Foreign key | to_id | int

Is this correct/allowed?
>>
Since JavaScript is a botnet what should I learn as a substitute? Is it possible to use c++ for user side web design?
>>
>>64158983
Thanks I found out JetBrains offers free licenses for students
>>
>>64159481
No. Javascript is basically a hard requirement for interaction in the browser. You can write in other languages, but they all compile to JS.
>>
>>64156152
There are no error.
>>
>>64152862
You mean for your local environment? If yes then i can recommend Vagrant which i use both professionally at work and for my own projects. If you are new then it might be a bit confusing to set up at first but once you get over that first hurdle it works great.

For a simple LAMP or LEMP stack:
https://box.scotch.io/

To custumize your own (bit more complicated) use puphet:
https://puphpet.com/#create
https://return-true.com/beginners-guide-using-vagrant-with-puphpet-for-local-development/ (guide a bit outdated but should still work)

Or you could just look up a box and configure it manually:
https://app.vagrantup.com/boxes/search

About vagrant:
https://www.vagrantup.com/
>>
File: fileupload.jpg (90 KB, 585x554)
90 KB
90 KB JPG
>>64154412
Here is a script i use to upload an excel files along with some metadata. Works great for me.
>>
I've got accept as a junior front-end developer at some big firm. They said I'm gonna code mostly in JS(jQuery and a cuple of JS frameworks). They are also going to send me to some kind of bootcamp for two weeks to up my practical skills, cause I only know the basics and core concepts.
This whole shit is starting in 5 days. Should I try reading or watching something before it starts in order to be slightly more prepared? Any advice? I've never actually dealt with front-end before.
>>
>>64162157
You got hired for a job that requires you to do something that you actually never dealt with before? Wat? How did that interview even go?

"Hi, we need someone that can do THIS. Are you the man for the job?"

"I have absolutely no idea how to do THAT"

"YOU'RE HIRED!!!"

Dont just read and watch. Play around and make small things. Nothing fancy, just fuck around and get a hang of things. You dont want to go in there blind imo.
>>
>>64162190
Well, I actually came for another position(back-end). They asked my a shit-ton of technical questions. I'm gonna work on other things I've actually delt with in the future. But right now they are in need of front-end development for some of their sites.
"you're hired, but don't worry, we're gonna send you to a place where they quickle teach you how to do it"
>>
>>64131468
There's a rule named "safe harbour" which generally indemnifies you *if* you make a reasonable effort. It's literally the only reason 4chan has mods. Not to stop shitposts, but to b& people that post cp. Same as how you can't make piracy website and claim it's the users that uploaded everything - if you actively encouraged it you're totally liable.
>>
>>64162278
>They asked my a shit-ton of technical questions

post some here. i wanna prepare myself
>>
File: 1508411791102.jpg (65 KB, 650x650)
65 KB
65 KB JPG
>>64159481
>Is it possible to use c++ for user side web design?
no, and JS isn't used for 'design' either.
A language is not a botnet.
>>
>>64159481
Sure, check out the Wt framework. It does client-side as well, no JS required.
>>
>>64143744
>cross-browser-testing service
Don't say these things, people might believe you.
>>
>>64159481
Probably yes in the future with WASM, when they get DOM manipulation if ever
>>
Does anyone else get overwhelmed by all the resources available to learn? I wish I could live for hundreds of years just to truly master everything there is.

Btw there are a few courses available for learning React on Udemy, does anyone have something to recommend? They look all good to me.
>>
>>64111986
Why is ember.JS considered the best framework at the moment?
>>
1) Why are HTML Emails / PDFs so shit to work with?
2) Why does every customer want them? They're just going to ignore the emails and never use the PDFs
>>
>>64163928
Here's a much more valuable udemy course.

https://www.udemy.com/the-chakra-system-master-class/
>>
>>64164182
Is this some joke I don't understand? I don't care about chakras.
>>
Which of these would you (or are you) use for a website focused on user submitted content (like 4chan i guess)?

https://www.digitalocean.com/community/tutorials/5-common-server-setups-for-your-web-application

Or is there other setups not mentioned?

So far i just do use a single VPS for everything, but i want to learn how to do proper setups and scaling.
>>
>>64164209
it is a joke im sorry

but can you believe 4,444 people forked out cash for this?
>>
>>64164232
Yeah, I guess you can sell anything these days.
>>
>>64164229

If you haven't already paid for anything check out AWS / Google cloud platform .

Don't get involved with Azure, as microsoft is evil and /g/ will poke fun at you.
>>
>>64163928
>https://www.udemy.com/the-chakra-system-master-class/
check the preview. it's most of the time taught by a pajit with a heavy accent. which i don't mind at all if i can actually make out what they are trying to say but it's mostly unintelligible.
>>
What's the difference between

import Something from './somewhere';


and

import { Something } from './somewhere';
>>
>>64164249
What's the upside of using AWS over a Digitalocean or Vultr server.
From the outside it simply costs a lot more for less powerful hardware and more complicated management, but on the other hand there is surely a reason why it's also a popular service.
>>64164590
look up 'import' on MDN.
First imports the default export and the second only imports a single export of those available.
>>
>>64164904
>look up 'import' on MDN.
>First imports the default export and the second only imports a single export of those available.
pefect, ty anon
>>
>>64164904
How expensive really is AWS? Lets say you make a site sort of like 4chan but less popular, where people can upload images and webms. Lets say it has 1000 daily active users.

What would my monthly bill be?
>>
File: aws_services.png (169 KB, 1234x924)
169 KB
169 KB PNG
>>64165041
noone can you tell you that with so little info and no idea which AWS stuff you would utilize.
Try looking at the price calculator and see if you can make any sense of it.
http://calculator.s3.amazonaws.com/index.html

Watch for the 35$/month 1st-year discount that's already applied to everything if you want to get an idea of the actual cost.

Compare AWS, DO, Vultr and decide then.
Only my own opinion but I find it unlikely, that anyone would get much use out of AWS unless its some large scale next-level-enterprise-project.
>>
File: 1506622420212.jpg (47 KB, 645x968)
47 KB
47 KB JPG
I'm using wordpress and I want to have a pop up box shop up with the search field whenever I click on the search button icon.
I know I have to use jQuery for this but how do I use it correctly with wordpress?
Where do I write the script and how do I get it to access html elements that I want to use if they're in header template?
>>
>>64165320
Hmm, i used http://calculator.s3.amazonaws.com/index.html to calculate some stuff.

For cloudfront: Say i get 1000 visitors each day for a month. Each visitor watches 20 webm videos each. Each webm video is 3mb in size. So thats 3*20=60, 60*1000 = 60000x30= 1800GB a month.

That will cost about 300usd in only cdn fees. Thats crazy expensive...Am i calculating this wrong?

What does 4chan use?
>>
React question.

Best way to make this fire when ENTER is clicked?
  handleSubmit() {
if (!this.state.message){
return;
}
const { message } = this.state;
this.props.sendMessage(message);
this.setState({message:''})
}


Got a <Input /> and a <Button onClick={this.handleSubmit}>Submit</Button> component
>>
Guys, I suck at PHP. How would I go abt doing smth like this:

if (randomFunction()) {
DO NOTHING AT ALL!!
} else {
$testVariable = 'lorem';
}
>>
Just remove the else clause and reverse the condition?
>>
>>64165817
nvm I found how:
if (!randomFunction) {
$testVariable = 'lorem';
}
>>
I'm a front-end dev about to jump on the MEAN meme.

What should I expect?
>>
Hi, /wdg/,

I'm working with Azure Table storage. It's not relational and supports very basic operations. I'm running into a few limitations that would could be solved by using a relational database, and nearly every scenario I can come up with for a database requires a relational database.

Can someone tell me, what is the use case that something like Azure table storage sought to solve that relational databases couldn't do on their own?
>>
File: 1496807999233.jpg (192 KB, 1280x738)
192 KB
192 KB JPG
>>64165697
>Thats crazy expensive
yeah that's what I meant. Do you need that though? You could just as well serve it from one central location at that size still.
I am convinced though that there is no point planning for scale too early. You have no idea what your usage and your actual bottleneck is going to be.
Chances are the same infrastructure that handles 10 people a day also handles 1000 a day without much difference. (+ some extra storage space)
>>64166150
mongo, express, angular and node.
Glad I could help you anon.
They got pretty lucky with having a stack name that rolls of the tongue so easily.
Even MERN sounds good... what are you going to do with Vue though.
MEVN doesn't sound nearly as nice.
>>
File: 4chan_cors.png (27 KB, 1460x188)
27 KB
27 KB PNG
did someone mess up or is it just on my end?
>>
>>64167132
you messed up.

you need to add those headers to receive/send information.

that's a classic error, every person faces for the first time
>>
>>64167217
this is just the automatic thread updater from within this page, that's giving that response.
>>
>>64111986
How the fuck do I make a working register and login form with mysql and PDO? Every fucking guide i've searched doesn't use that fucking shit and nothing works.
>>
File: mockup.png (41 KB, 1917x1042)
41 KB
41 KB PNG
I'm noob. I want to make a small site which stores tasks I do over day. Tasks should be individual elements which can be dragged and droped to switch places, able to close and add new task bubbles, and the state should be saved. Maybe have tabs, I'm not sure. What's the best stack I can achieve this functionality? angular, react + jquery libraries for drag drop? Or some additional libraries?
>>
>>64111986
<center>hi</center>

No that's not the proper way to do this. You need to not use deprecated tags and utilize CSS. Now for your shitty website you type:

<style>(or css package)
.center{
text-align: center;
margin: auto; //:^)

}
</style>

<div class="center">fuck why is this so much harder to do now fuck you.</div>


Seriously I get that they wanted to keep CSS and html separate and remove styling tags from html but fuck man <center> was so simple and easy to use and for every website I make the same dumbass code maybe even call it .c instead of .center to make it easier to type for all codes.

<span class="c">Eat shit W3C</span>
>>
>>64167217
>>64167132
what I am wondering is, if that is some kind of filter or supposedly malicious traffic, then why can I still post and load complete threads?
Just can't update from within a thread.
>>
File: Houjuu.Nue.full.959670.jpg (365 KB, 1800x2000)
365 KB
365 KB JPG
How would I go about creating something like a random background on each time the page is loaded?

Basically I want to make a gallery of sorts, but using the BG. I want to randomize it so that each time you access the site, there's a chance that the background displayed will be either A, B, C, D.. etc.
>>
>>64167763
Select randomly from an array of URLs.
Set the chosen URL as the background source.
>>
>>64167763
- pick random number and assign to variable
- if variable equals this number, get this url as background
- if variable equals another number, use this as background
>>
Fuck, WP development is a nightmare. The issue is not the WP Core itself, it's mixing your custom code with all other plugins that do whatever the fuck they want.
>>
>>64166606
>MEVN doesn't sound nearly as nice.
They could do VENM, pronounced like "venom". Or require that the stack be run only on OpenBSD or openSUSE, in order to get that 'O' in the acronym.
>>
>>64165750
>>64165750
>>64165750
>>64165750
>>64165750
bump
>>
>>64169088
Onkeydown, pass event as parameter, then check if event keycode is equal to 13 (keycode for Enter),

Like so:
onkeydown={this.checkKeyCode(e)}

checkKeyCode(e){
if(e.keyCode === 13){
handleSubmit();
}
}
>>
File: web.png (136 KB, 1920x1080)
136 KB
136 KB PNG
Is there any retard proof course?
I'm stuck at this shit from FreeCodeCamp for ages.
I can't find out how to centralize DIVs inside each other.
pls help.
>>
File: web2.png (1.02 MB, 1920x1080)
1.02 MB
1.02 MB PNG
>>64169744
I'm trying to make it look like this.
>>
File: t3_5f5kte.jpg (243 KB, 853x1280)
243 KB
243 KB JPG
>>64169744
Hope the course didn't tell you to use inline styles.

Look over https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Don't need to read it all, just enough to get an idea.

Then complete http://flexboxfroggy.com/

This will solve like 95% of all your positioning problems.
>>
>>64169744
#parent{ 
text-align: center;
}
#child{
display: inline-block;
}


or

#child{
margin: 0 auto
}
>>
File: proggggg.jpg (61 KB, 750x420)
61 KB
61 KB JPG
>>64171367
>>
hello guys i know some javsacript and a little bit of react + redux
what do?
>>
>>64171818
Start building things from day 1.
Code that actually applies to things that interest you, or that you would like to exist.
It won't even feel like you are 'working' in a sense. If it actually feels like a hobby, like a game, then you won't believe how fast you can progress.
>>64172233
see above.
You learned JS and React with some kind of vague idea what you ultimately would like to do, right?
>>
>>64167432
no one really has an opinion?
>>
>>64172356
do you want it with a real backend or just in the browser using localstorage?
React or Vue would be a good fit for the UI imo.
I saw this library a while ago
https://shopify.github.io/draggable/
but seems quite full-featured, so maybe a bit heavy for simple drag-n-drop
>>
whats the difference between cloud architecture and non-cloud architecture?
>>
noob question

What's the best tool to minify css / js?

I know a lot of the online tools for it minify it in different ways (e.g. some wont' remove the last semi-colon in styles etc)

Is there an easy way to minify files server side so you work with a normal file but when a user loads the site they see a minified version? To save the job of keeping 2 files (e.g. styles.css and styles.min.css)
>>
>>64165750
If keypress ======13 ...
>>
>>64172502
it needs a backend sadly, so I could save my settings in some db i suppose. I'm gonna look into this library, I figured I going to need some. Thanks for the recommendation
>>
>>64172560
a build setup usually does this for you.
You develop as you would normally, and once you want to make a version public you run the build process and let Webpack, Gulp, etc. bundle and minify your assets.
Webpack can look intimidating, but once you created your own basic config it's all good again.
>>
>>64172316
no i just want at least 50$/month salary :(
>>
>>64161660
>still doesn't work for me
I guess I'll stick to simple uploading in php without any js. I-it's bloat anyway!
>>
>>64172560

Ideally you do what >>64172779 said.

Here's a boiler for gulp: https://github.com/cferdinandi/gulp-boilerplate

Basically, once you have installed everything, you just write all your code in the src/ directory, and it compiles to the dist/ directory.

You can also install something like mod_pagespeed on your server and it will minify resources into a cache. Although just be aware that some resources can be cached for hours and fall out of sync if you're pushing rapid changes, so make sure you learn how to dump the cache too.

>>64165590

Look in your themes functions.php file, scripts are added with:

wp_enqueue_script( 'my-script', 'my-script-url' );


If you are using a theme made by someone else, learn how to create a child theme: https://codex.wordpress.org/Child_Themes

It lets you extend the functionality of the parent theme.

You can modify the parent theme directly, but when the author updates it your changes will be lost, so bad idea unless you are authoring the theme yourself.
>>
File: 1266889020746.jpg (56 KB, 382x299)
56 KB
56 KB JPG
Fuck Chrome, I swear to god.

I'm trying to make this page looks nice on mobile, but Chrome keeps overflowing with scroll. I was sort of? able to fix it by changing the viewport, but now for some reason I'm only getting "the viewport was truncated to its numeric prefix." error. Now that has stopped working too.


Why is it such a pain in the ass to make things look nice on different, modern browsers? I don't even know why its overflowing. It seems fine on Firefox.
>>
>>64173711
>>64154412
Okay ! I managed to find a way, I don't know if it's a good way or not, but at least it works.

    var input = document.getElementById("picture");
var file = input.files[0];
var http = new XMLHttpRequest();
var formData= new FormData();
formData.append("file", file);

http.open("POST", "php/test.php", true);
// headers
http.setRequestHeader("Content-length", file.length);
http.setRequestHeader("Connection", "close");

http.onreadystatechange = function() {
if(http.readyState == 4 && http.status == 200) {
alert(http.responseText);
}
}

http.send(formData);




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.