[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

/wdg/ - Web Development General

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 314
Thread images: 38

File: 1496845010511.png (731KB, 824x553px) Image search: [Google]
1496845010511.png
731KB, 824x553px
>Getting started
Get a good understanding of HTML, CSS and JavaScript.
MDN web docs offer a good intro (independent of your browser choice)
https://developer.mozilla.org/en-US/docs/Learn

>Free online courses
https://www.codecademy.com/
https://www.freecodecamp.com/
https://www.bento.io/

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

>Resources
https://developer.mozilla.org/en-US/docs/Web - General documentation for HTML, CSS & JavaScript
https://stackoverflow.com/ - Developers asking questions and helping each other
https://caniuse.com/ - Check browser support for front-end web technologies

>Youtube channels
https://www.youtube.com/user/TechGuyWeb - Traversy Media
https://www.youtube.com/channel/UC8butISFwT-Wl7EV0hUK0BQ - freeCodeCamp
https://www.youtube.com/channel/UCO1cgjhGzsSYb1rsB4bFe4Q - funfunfunction
https://www.youtube.com/learncodeacademy - codecademy
https://www.youtube.com/derekbanas

>in-depth comparison of VPS hosts
https://www.webstack.de/blog/e/cloud-hosting-provider-comparison-2017/
>>
File: homero_simpson.jpg (14KB, 320x240px) Image search: [Google]
homero_simpson.jpg
14KB, 320x240px
First for PHP
>>
Anyone here tried out PHP 7.2? What is it like?
>>
Need help Anons. I want to have a popup of somesort, that works when i click a table cell, but doesn't have any ID's attached and is unique for each table cell, is that in any way achieveable?
>>
>>61777633
i.e.
<td class="active"> <!-- first cell -->
<div class="speaker"></div>
<div class="title"></div>
</td>
<td class="active"> <!-- second cell -->
<div class="speaker"></div>
<div class="title"></div>
</td>


When i click on the first cell i want the popup to show the content of the first cell, without using any ID declarations, and when i click on the second cell i want the popup to show the content of the second cell, still without using any ID's, simply because i have like 1000 of these cells.
>>
>>61777633
>>61777686
sounds like a job for Vue or React list-rendering
>>
>>61777715
Is there any other way to pull it off, with pure JS or jQuery? I don't know, maybe onclick and opens a child div with certain class, is that possible? I'm a total webdev newb :(
>>
>>61777793
How are you creating the cells currently?
Are you looping through some array, creating the elements and setting their content via JS?
In that case you could add the click eventhandler in the same step.

I would still recommend a view library for this though.
>>
>>61777149
>>61777514
Pleaae stop using that dinosaur
>>
Does an event listener exist in JS for when a particular element has incremented to a certain number value?
>>
>>61777881
I make them by hand, and don't want to put ID's by hand for every cell as well, and the site is pretty big and i don't want to break it, so adding additional libraries is kinda not what i want to do.
>>
>>61777149

i'll soon take enroll in a bootcamp and PHP will be in the courses
it's still out there stop acting like Node.js is taking over it's not. PHP is still the most popular
>>
>>61777978
>I make them by hand
You are causing yourself much more work than necessary in the long run I would say.

In regards to the problem though, if all the cells share the same class, you could get them all via getElementsByClassName, add their content to an array and set an onclick eventhandler with an index as its argument on the cell element.
When the cell is clicked you then retrieve the content from the array at the specified index.

let elements = document.getElementsByClassName("your-class-name-here")
let contentArray = []

let showContent = (index) => {
console.log(contentArray[index])
}

for(let i = 0; i < elements.length; i++){
let element = elements[i]
contentArray.push(element.innerHTML)
element.setAttribute("onClick",`showContent(${i})`)
}
>>
>>61777950
>when a particular element has incremented to a certain number value?
DOM elements don't have numeric values, so I have no idea what you're asking.
>>
>>61778086
This is a pretty retarded way of doing this.

document.querySelector('theContainingTable').addEventListener('click', ({ target }) => {
console.log(contentMap[target.getAttribute('data-idx')]);
});
>>
>>61778194
Addendum after having actually read OP's retarded requirements:

const contentArray = [...];
const elements = document.getElementsByClassName('cellClass');

document.querySelector('theContainingTable').addEventListener('click', { target } => {
const index = elements.indexOf(target.closest('td'));
if (index === -1) return;
console.log(contentArray[index]);
});
>>
>>61777686
Attach click listener to td. Listener will have trigger td as context (this).
>>
>>61778047
Still popular? Yes.
Steadily declining in popularity? Also a yes.
Obsolete in the forseeable future? No. There will be lots of pajeet-tier legacy codebases that will need work. I don't know why you would willingly get into PHP now.
>>
Is learning Node in 2017 still a good idea?

I played with Ruby and PHP (eew) and feel like learning something new, but I can't decide which technology to learn. Is Node + Vue a good idea?


>>61777950

Mang, just put some "if (x > value)" at that point where the increment happens.
>>
>>61778290
>.closest
huh, never knew that was a thing
you seem to know what you are talking about, but at least make sure your examples work

document.querySelector('table').addEventListener('click', (event) => {
console.log(event.target.closest('td').innerHTML)
})


for (let element of document.querySelectorAll('td')) {
element.addEventListener('click', (event) => {
console.log(event.target.innerHTML)
})
}


>>61778492
yes
>>
>>61778492
There is no stopping the Javascript hype train, it's here to stay, go for it
I'd recommend React instead of Vue though, the latter generally is considered babbys first framework and has not managed to gain as much traction as React
>>
>>61778509
>at least make sure your examples work
Why would I do that? I'm not going to give a line reading to these greedy plebs. And why did you remove my destructuring?

Adding click listeners to a thousand elements in a loop is full-on retarded.
>>
>>61778414
because there is work out there for it

not so much for node.js
( even though i'm dabbling into it on my own time )
>>
>>61778576
If 'there is work out there' was the only criterium you should probably specialise on Wordpress
I'd rather look around for a job than work with PHP though.
(being a special snowflake and only looking for Haskell work or some shit is the other side of the spectrum, that's not any better)
>>
>>61778642

i tried to (wordpress)

i felt like a fraud
>>
File: btu.jpg (17KB, 207x253px) Image search: [Google]
btu.jpg
17KB, 207x253px
>>61778524
>the latter generally is considered babbys first framework

It's true though, that React and Angular are way more prevalent. Definitely the better choice when it comes to finding a job.
Personally don't like JSX though and Vues single-file components are really nice to work with.
>>
Is it normal for devs to never come in on time.

I work 8-5 at this dev job and my past dev job. Both times only one other person arrives within 10 minutes of it being 8. People always show up 30 minutes to an hour late.

Wtf is going on? I got to work 5 minutes ago and the lights were off.
>>
>>61778735

perfect job for me

i'm always 5 to 10 minutes late
>>
>>61778735
Back when I worked in an actual office I was between an hour and two hours late pretty much every day. Still work for the same company, but fully remote now.
>>
>>61778735
i always come late but i try to catch up during lunch break and stay a bit after hours
>>
>>61778757
>>61778768
So this is the power of White Collar?
>>
>>61778524
Vue is generally considered superior to React. Also for both of them the popularity curve will be similar to Angular- be unknown, become known, become popular, become overcome by superior competitor. React is near the top of it's popular phase while Vue is that superior competitor still growing.
>>
>>61778735
It depends on company but at smaller not corporate ones that kind of flexibility is pretty normal.
>>
If you are at work and you are reading this then clear your throat.

Pretty sure someone here is lurking right now.
>>
>>61778842
Is it actually superior though? I use it and like it, but have yet to use React.
My beef with React was the way you had to write the Mark Up. Seemed like it was reinventing the wheel.
>>
File: qqqqqqqqqqq.png (19KB, 1198x156px) Image search: [Google]
qqqqqqqqqqq.png
19KB, 1198x156px
I'm learning by making a simple site, i set the menu to fixed position, but i can't make the content below stop overlapping, if i use padding or margins i cant get it to work on different resolutions.

Any tips?
>>
>>61777686
if you prefer oldschool jQuery, try $('td').click(function() { var texthere=$(this).text(); $('.popup').text(texthere); $('.popup'>>or however you named it).fadeIn(); });
might have some errors, didn't work with this in a while. also id your table if you want this to happen only to this table.
>>
>>61778991
Dont use absolute positioning for container elements.
>>
>>61778524
>>61778693

Thanks for the replies..

I had a brief look at React and Angular and React look kinda nice. But from what I've heard Vue is more easy to get into and that you can learn in in a few days. Meanwile React seems to have this completley new (and probably challenging?) philosophies like Flux/Redux and is more of a completey ecosystem of it's own.

My point is:
I'd like to learn a simple but complete stack based on JavaScript. MEAN was the thing a few yaers ago, but I really don't feel like learning Angular.

So what should I learn?

Vue + Express + Node ?
React + Redux + [...] ?
Something else?
>>
>>61779072
>So what should I learn?
I like and use Vue, so obviously that's what I would recommend, but you could easily be as happy with React.
>React + Redux
The equivalent would be Vue + Vuex, though I would leave state management libs aside, if you are just starting with the view library itself.
>stack based on JavaScript
Node, like you said
>>
>>61779200

So "Vue + Vuex + Node" would already be a complete stack?
Or are there other components I would need to include?

I'm just trying to find out what specific things I need for "the whole package".
I can imagine doing a Vue project and then learning React later. But I just don't get how all those tiny things are connected. AFAIK today stuff like Babel and Webpack are mandatory for a JS stck, right?
>>
Are we all weird?

I've only met 1 normal web developer before.
>>
Which is more futureproof, Python and Django or Node.js?
>>
>>61779280
Redux or Vuex are more like extension to React and Vue. Not related to the stack.

A "stack" would be something like (database + webserver + view-library or template-engine + backend)
With Node as backend, popular choices are MongoDB, express and Angular/React/Vue, doesn't mean, that you have to pick those.

>Babel and Webpack are mandatory for a JS stck, right?
You can use Webpack to bundle your code and automatically transpile with Babel, but it's by no means mandatory.
But it's necessary if you want to use Vues single-file-components.
https://vuejs.org/v2/guide/single-file-components.html
>>
>>61778976
React fucked up development process in several ways making it PITA to learn and develop in React.
>>
>>61779339

think about it
staring at a screen all day is really weird
and I'm pretty sure it fucks with your brain
>>
>>61778842
how could Vue be superior when it's basically Angular 1 all over again?
Even the Angular people finally understood that two-way bindings are shit for mostly everything. Especially when your app grows beyond following some tutorial you'll be glad you went with a highly scalable solution as React instead of Angular 1.5

Also why bother learning some shitty custom directives? Just write ES6 with React.
One day both React and Vue will be obsolete (the latter probably earlier), but as the React interface is basically non-existant you will have no problems adapting to whatever comes next.


>>61778976
You don't have to use JSX if you don't want to.
I see litte reason not to once you're used to it, though

>>61779718
It shouldn't take you more than a few days to grok React, it's simple.
You don't need to learn anything else in the beginning, you can write perfectly fine React apps without Redux/Thunks/Sagas/whatever.

I work on a large React SPA (20k LOC) and 90% of the code is stateless/functional, which makes it super easy to debug and reason about the code.
Good luck managing that when you've got two way bindings shitting everywhere
>>
Any recommendations for learning Rails other than the Odin Project?

Been working through Odin and while it's been alright so far I still feel like there's gaps in my knowledge due to how sparse some of the lessons are.
>>
>>61779450
vanilla JS isn't going anywhere anytime soon,
python is the same.
can't go wrong, python has more use cases outside of webdev, node/JS will be more important in webdev

learn both better
>>
>>61779814

I found "Rails 4 in action" pretty good, they cover many topics in an easy way. There isn't a "Rails 5 in action", but v4 and v5 are more or less the same.


>>61779494

Thanks a lot for clarifying.
I always thought FLux/Redux is a methodoly which is mandatory for writing good React apps..

But I have still problems to map the classical MCV modell (of something like RoR) on the JS tools.

I know what databases are, but for the rest, is this correct? :

Vue-router or React-router --> Routing
Vue/React --> View/Templating (chainging the DOM of the website)
Node --> Bare Backend
Express --> Backend extension to make it usable

Any other core component I forgot to build something like an image board?
(I'm not planning to build one, just as example)
>>
>>61780044
Thanks.
>>
>>61780044
>Express --> Backend extension to make it usable
You can still use Node as backend together with some other webserver if you wanted.

Those parts together will let you build whatever you want pretty much, but there will always be certain solutions more geared towards specific projects.
>>
Oh my...

>Hackers Hijacked Chrome Extension for Web Developers With Over 1 Million Users

>Now just yesterday, another popular Chrome extension 'Web Developer' was hijacked by some unknown attackers, who updated the software to directly inject advertisements into the web browser of over its 1 million users.

https://thehackernews.com/2017/08/chrome-extension-for-web-developers.html
>>
>>61779339
Most people either enjoy working with people (teachers, psychologists, physicians, etc), or working on concrete things (say, designing buildings, making cars, etc, etc). We do either. So that's put us in the other camp, with those who like working on abstract things, like ideas, art, or software.
>>
>>61780428

That was some deep shit right here..


>>61780313

Cool, thanks!
>>
>>61780887
Yeah, basically we're are in the same "3rd way" camp as artists and philosophers.
>>
>>61779072
>get node
>get the react starter app
>takes no knowledge so far since any info is provided
>try to add an express server as backend
>hint: use proxy in package.json of your react app

With express running you can do your first crud api app.
>>
>>61780344
Anybody who installed that shit is retarded anyway.
>>
Guys, where should I buy my domain name? I've already chosen my VPS provider, thanks to the OP, but I have no idea of what to do for the domain name. They are so diverse, I have no idea of who should I trust.
>>
>>61781530
namecheap
>>
>>61781530
I've got 4 domains from Gandi and I have zero complains, they give you free SSL for a year and their prices are pretty competitive.
>>
>>61781530
>>61781563
I've been buying mine through AWS route 53, but I think they actually just resell Gandi. So Gandi is probably a good option.
>>
Wish I had mates irl into web development.
>>
Installed Morgan to log http requests, It worked fine yesterday on a PC but now on a Mac it is doing everything twice, what's wrong?
>>
File: 1497992234773.jpg (44KB, 347x375px) Image search: [Google]
1497992234773.jpg
44KB, 347x375px
>>61776565
I am doing a filterable 4chan frontpage in react. It grabs json from 4chan api of a set of predefined catalogs. Json gets fetched using express api. I can display the data, the images tho won't show in the browser only their alt. I use:

<img src={`http://i.4cdn.org/{board}/${thread.tim}s.jpg`} alt="{thread.tim}" />

Is there something I'm not considering? Oh, I also tried Iframe only pictures that where cached showed up while they didn't show up while using img tag
>>
>>61782812
i have an app that started doing that yesterday...
>>
>>61782854
had the same issue

referrerpolicy="no-referrer"
>>
I am using mozilla console and spreadshit for learning js. Is there better text editor to use that will simulate a console without bothering any browser?
>>
Give your honest opinion on Bootstrap. Are you guys contrarians who continuously rebel against what is popular or do you appreciate Bootstrap and its intuitiveness?
>>
>>61777883
Just stick to your millennial fgt shit bitch boy.
>>
I could listen to Brad Traversy's brutish-but-smooth Boston accent all day
>>
Are databases as service a meme or the future? I'm currently testing Mongo DB Atlas and it is pretty nice.
>>
Thinking about C#. Should I use .NET Core 1.0 or is 2.0 mature enough already?
>>
File: 1445377217382.png (568KB, 617x850px) Image search: [Google]
1445377217382.png
568KB, 617x850px
>>61783612
>Are you guys contrarians who continuously rebel against what is popular
Weirdly enough seems to be completely opposite to regular /g/, or else people here would give a shit about making stuff work without JS. Basically /wdg/ is full of relatively normal people, combined with the 4chan-ingrained deep hate for pajeets.
>>
>>61783774
>Basically /wdg/ is full of relatively normal people
Which is why it's actually shittier than the rest of /g/, an already low-tier board.
>>
Apologize for making web 2.0 crap.
>>
File: barbara-palvin.webm (3MB, 1920x1080px) Image search: [Google]
barbara-palvin.webm
3MB, 1920x1080px
>>61783226
thx that was the hint needed! have a waifu
>>
>>61783993
its okay, it allows to collect ez cash
>>
Im finishing codeacademy Html&css course, where should i continue to study html and css?
Im intenting to start studying JS on codeacademy, but honestly im still feeling like just above begginer level, like i know some stuff, but i dont feel confident in my html and css skill at all.
>>
>tfw using templates from various YouTubers for web design portfolio since you can't be bothered to make your own designs and just want to get some money through Upwork
>>
>>61784168
Just start building shit. Learn bootstrap. You can take those bootstrap examples (https://v4-alpha.getbootstrap.com/examples/) and just build your own portfolio etc. This is what i did before i got comfortable with css and html.
also codepen.io is a nice site if you wanna see how other people might've done something
>>
What is the most complicated thing you made in basic JS?
>>
File: smoothed.png (68KB, 1373x620px) Image search: [Google]
smoothed.png
68KB, 1373x620px
I worked a bit more on that 4chan stat site I posted here before.
Started calculating board activity and added a timeline to compare boards over the last week
The board-list also contains more boards now. Basically everything that isn't outright nsfw or image generals like /c/, /wg/, etc.

Would be interested in some feedback, especially regarding the layout and usability.
Not fully happy yet with the buttons above the timeline graph, but I couldn't think of something better so far.

http://chanstats.info
>>
what type of personal information should i put on my github portfolio?
>>
>>61784522
What's the difference between posts per minute and activity?
>>
>>61784330
My email obfuscater. :^)
>>
>>61784574
I wrote an explanation on the bottom of the page.

Activity is the current posts-per-minute rate relative to what the board usually gets as max during the week.
So if a board usually tops out at ~20ppm and is currently at 30 because of some happening, then that would be an activity rate of 150%.
>>
i miss XML
>>
>>61784673
what are you using for the graphs?
>>
>>61784767
chartjs

I looked at D3 initially, but figured that it's too much, compared to what I actually needed and went for something more basic.
>>
File: nice .jpg (108KB, 499x488px) Image search: [Google]
nice  .jpg
108KB, 499x488px
>>61784522
I can't be bothered to read your post, but keep up the good work my man.
>>
>>61783774
>Basically /wdg/ is full of relatively normal people, combined with the 4chan-ingrained deep hate for pajeets.

I think /wdg/ is good because it's people who actually program, as opposed to a large chunk of /g/ who just argues about Intlel vs Ayyymd.

It's hard to pinpoint why it's better than /dpt/, but I think /wdg/ is a more specific and smaller group, so people here have more in common to talk about.

>>61784330
Probably a scraper I built in Electron for a streaming site.
>>
>>61784522
Why did I always figure /a/ was the second largest board by a significant margin?
>>
File: 1501639341578.jpg (90KB, 563x675px) Image search: [Google]
1501639341578.jpg
90KB, 563x675px
>>61784522
this is actually very usable and looks real good
good job
>>
I'm trying to grab a JSON object from a server with jQuery, but Chrome gives me:
> No 'Access-Control-Allow-Origin' header is present on the requested resource.

I'm using:
$.ajax({
type: "GET",
url:"http://exampleurl.com/data.json",
xhrFields: {
withCredentials: true
}
}).done(function(data) {
console.log(data);
});


I was trying to use $.get before, but same issue. All the fixes found on Google do not fix the issue.

What do I need to add here?
>>
>>61785043
>it's people who actually program
No it's not.

At least eighty percent of the posts on /wdg/ are from wannabees trying to cash in, about to wash out of their first app after the tutorial hand-holding session ends.

Another ten percent are just web developers (as opposed to actual programmers), and not even decent ones. They stick around because answering questions asked by the wannabees makes them feel important, big fish, small pond.

The last ten percent are actually decent programmers who are just here to tear apart the garbage code samples of the former group, bitch about the industry, debate any actually interesting topic which (rarely) comes up, and shitpost.

It's actually a pretty accurate cross-section of the whole web industry.
>>
>>61785186
use a CORS proxy
>>
>>61785186
This is a cross-origin issue. Your hostname is different from the hostname you are sending the request to, and you haven't configured cross-origin resource sharing.
>>
>>61785186
>make api call to your server
>let your server fetch the data
>let your server return the fetched data to you
>>
>>61785215
I did this and removed the xhrFields from the function, all good now. Thanks nice anon.
>>
File: 1496550351657.gif (948KB, 200x200px) Image search: [Google]
1496550351657.gif
948KB, 200x200px
I FUCKING HATE WEB DEV AKA WEBSHIT REEEEEEEEEEEEE

BUT IT'S THE ONLY VIABLE PLATFORM TO ACTUALLY MAKE SHIT ON OTHER THAN MOBILE WHICH IS EVEN GAYER REEEEEEEE
>>
>>61785043
/dpt/: NEETs circle jerk about things they don't understand
/wdg/: jaded professional (as in it's their job) programmers
>>
>>61784148
webfaggots do "everything is webapp" for free too, they simply don't know anything else
>>
Why is just one of the images on my site 404ing? It works fine on my machine and I ran it in chrome incognito cuz caching. The image is on my github (and I'm using github pages). Why?
>>
>>61785347
/wdg/ is just another, more specific /sqt/. Generals are garbage.

>>61785432
Look at this trash. They should all be banned. This isn't fucking StackOverflow.
>>
>>61785316
Use Enterprise, Luc. God loves desktop and binary protocols.
>>
Is there a way to make ObjectIDs in Mongo smaller? I need my users to use an ID for several purposes but the IDs in Mongo are too big, copy pasting is not an option.
>>
>>61785591
You can use whatever you want for IDs.
>>
>>61785432
Is the src of the image an absolute path or a relative path?
>>
>>61777883
PHP best for the web
>>
OP, you forgot to mention our Discord server:

https://discord.gg/wdg
https://discord.gg/wdg
https://discord.gg/wdg

We even have a special invite link with our name
>>
DDD or UXDD?
>>
Is it possible to complete colt steele course in one month? and more important: is it worth it?
>>
File: fff.png (36KB, 123x128px) Image search: [Google]
fff.png
36KB, 123x128px
>>61785753
what's the point of a discord server, when the thread already sometimes dies before reaching 310.
Now you have some anons posting in the thread and some on discord.
>>
>>61785883
Well the discord servo is permanent, it never gets pruned.

So it allowed us to post lots of learning resources that people could still find even months after they've been posted.

And, ofc, we have lots of other goodies, like a shitposting channel, where people can relax if they feel so.

Still, the server is primarily about webdev and you can join to ask advice or just to talk about webdevv.

https://discord.gg/wdg
>>
>>61785936
The server is SFW, ofc. We try to enforce this rule as much as we can.
>>
>>61785936
Now I just lurk, but the folks @ the server are pretty cool.
>>
>>61785883
Because /wdg/ is trendy and needs to follow the hot meme. It's basically >>>/r/eddit.

>>61785936
>botnet
>#javascript but nobody actually knows what they're talking about
>none of the good aspects of 4chan but all the bad
Kill yourself.
>>
>>61785975
>#javascript but nobody actually knows what they're talking about

Feel free to enlighten us.

>>none of the good aspects of 4chan but all the bad
Such as? You deffo know all about it, considering you haven't been a member yet.

>>botnet
So don't blow your cover, just shitpost. I'm sure the NSA and the Zionist kabal are interested in your opinion about webdev.

kek
>>
Any javascript wizards down for some testing on my site?
>>
>>61786110
>deffo
>ofc
>kek
>members
I'll pass, thanks.
>>
>>61786123
drop link?
>>
>>61785936
man you seem like a nice person, but that didn't really explain why there is a need for one.

>discord servo is permanent
Pretty much the idea behind generals like /wdg/
>learning resources that people could still find even months after they've been posted.
Eh, I mean there is the OP already, which should contain the basic information to get people started.
Too much information is also not good though. Like that list of hundreds of programming books, that used to be included. Many irrelevant and people still posted about those, because they wouldn't know which ones to pick.
>Still, the server is primarily about webdev and you can join to ask advice or just to talk about webdevv.
That's exactly what the thread is for though and /wdg/ is already the slowest general on /g/ I think, when you compare it with /dpt/, /csg/ and even that watch-general.
>>
File: cellular g-phone.png (222KB, 500x806px) Image search: [Google]
cellular g-phone.png
222KB, 500x806px
I have a cousin who just opened a bar in Washington state, she needs a simple mobile web page I told her id make for her.

Im more of a Java/C/Python kinda guy here, I can do basic html, I run my own web server, but not gonna lie no experience with mobile web pages and html is not really my forte.

How should I go about this?

I was thinking a python script that would parse the client's http request header for device information, and based upon os (Android, ios, etc..) would return an appropriate page.

Does this sound like a decent method or is there something HTML native i should know about that can do this for me?
>>
File: ancient_trap.jpg (25KB, 254x354px) Image search: [Google]
ancient_trap.jpg
25KB, 254x354px
>>61786256
dude use a cms, pick a responsive theme change colors and add logos
enjoy your cousin not having to bother you each time she wants to edit content
>>
>>61786256
Sounds like a job for squarespace.
>>
>>61786207
Because when you're on a server where people have tags and you know who knows his shit, you can ask them personally. And not just once.

A discord server is a more permanent version of this thread, which gets pruned. We're still anons, but anons you can address.
>>
File: 1470486988363.jpg (165KB, 354x642px) Image search: [Google]
1470486988363.jpg
165KB, 354x642px
>>61786297
>it's reddit
>>
>>61786256
Ideally you should design a site that looks good on both mobile and desktop, using a percent-based layout. Essentially just make the width of the content a percentage, and let things stretch with their content in terms of height.

As far as detecting mobile devices, there are two different methods. You can do it on the clientside, with CSS @media max-width rules, which specify that a certain set of CSS styles will only be applied if the devices width is lower than the specified width.

Or, on the server side, you can check the HTTP header for the user agent string, which will tell you what browser/device they're using.

But realistically, if you don't know HTML/CSS and web design type stuff, you might just wanna go with >>61786286 and a prebuilt theme or something.
>>
>>61786286
im checking out different cms's now. do you have any particular suggestions I should check out first?

I see wordpress on the list, but i see my web server get scanned 10x daily from russian and chinese IP's looking for wordpress management files. I hear it has several vulnerabilities.

>>61786288
have you used squarespace before?
>>
>>61786382
Thank you sir, you are a gentleman and a scholar!

this is what I was looking for, I would rather take the time and learn how to properly do this myself rather than letting something do it for me.
>>
>>61786323
Can you send direct messages in real time on reddit? Never been there, so I've no idea.
>>
>>61786386
>have you used squarespace before?
Yes.
>>
>>61786386
i use wordpress
popular open source apps will allways get scanned by botnets looking for unpatched versions to use known exploits on
but since it's opensource those are supposed to get patched and the autoupdate feature is on by default so you shouldn't worry about it
>>
>>61785626
Relative path; every other relative path I used works including others in that same directory
>>
>>61786297
If I wanted usernames I wouldn't be on 4chan.
>>
>>61786473
Try renaming the image filename and requesting it with that new name.
>>
File: ????????.png (45KB, 240x303px) Image search: [Google]
????????.png
45KB, 240x303px
>>61786458
Is that supposed to be a good thing?
>>
Arguments against ORMs?

I tried raw SQL instead of SQLAlchemy and find myself writing a lot more code. Why would anyone not use an ORM?
>>
>>61778047
Everyone resents PHP, NodeJs is better in every way.
>>
>>61786640
>SQL
Found your problem.
>>
>>61778735

At smaller shops and among senior devs at larger companies, yes, this is common.

I always come in early because I don't like staying a minute later than I have to. I'd rather be home early and have more me time on weekdays than take my sweet time during the morning commute or sleep in another five minutes.
>>
>>61786640
>Arguments against ORMs?
It's significantly less efficient and more restrictive
>>
>>61785753
I tried bieng friendly on there
I got insulted and got some racist banter thrown at me

never again

next time I'll just visit /pol/
>>
>>61786640
maybe you need some specific vendor sql function
good orm libs let you send raw sql requests as well tho
>>
>>61786617
Yeah, you can also have a voice chat in a voice channel.

Can reddit do that??? I thought soo
>>
File: 4568227.jpg (50KB, 273x319px) Image search: [Google]
4568227.jpg
50KB, 273x319px
>usernames for anonymous website users
god you turbo-faggots should just stay on reddit
>>
>>61786853
>calls other faggots
>post the picture of a guy who was literally snorting coke off dicks

Yeah, ok..
>>
>>61786698
this === true

>>61786640
Why aren't you using a NoSQL database, /wdg/?
>>
>>61786896
>Why aren't you using a NoSQL database, /wdg/?
ACID compliance and denormalization
>>
File: 1481687094532.gif (101KB, 400x371px) Image search: [Google]
1481687094532.gif
101KB, 400x371px
>>61786892
The point stands, as it were.
>>
>>61786904
>ACID compliance
What's wrong with BASE compliance?
>>
>>61786936
The BASE guy is always
Basically Available (to new relationships),
in a Soft state (none of his relationship last very long)
and Eventually consistent (one day he will get married).
>>
>>61786892
You just don't know how to party man.
>>
>>61786256
>>61786286

Go with a cms my man. It'll be way easier for you in the long run.

But if you do want to design and build it yourself just use Bootstrap. It'll handle all your responsive needs if you use it correctly.

But honestly I've been down this path many times before and it's just so much easier to set up a simple site using Squarespace and then giving access to the user so they can change any little things they want.
>>
>>61787006
>t.sexless marriage
>>
File: 1469499924692.png (368KB, 1038x370px) Image search: [Google]
1469499924692.png
368KB, 1038x370px
>>61786837
>It's like reddit, with double the cancer!
>>
>>61787198
>he fears human voice interaction

>voice chat == cancer

Yeah, ok, again. Keep at it, tiger
>>
>>61787282
Nice try, FBI.
>>
>>61786640
as far as I remember rightly I've read once that you can do more detailed queries using raw sql
>>
>>61786892
>2017
>being this insecure
>>
>>61787934
I just pointed out the irony of it.

I don't give a sht.
>>
>>61787907
True. You also make the database do the work and present result rows on a platter rather than manually filtering/unioning/uniqing/reducing/sorting objects in the frontend, which can be nice.
>>
>>61787120
I'm considering this for a client. But I don't know which drag'n'drop cms to use? Why are you going to squarespace
>>
File: IMG_0559.jpg (2MB, 4032x3024px) Image search: [Google]
IMG_0559.jpg
2MB, 4032x3024px
>nb4 high contrast bg
>>
>>61788155
If your ORM can't do this then it's shit.
>>
>>61788338
what the fuck are you doing
>>
so

what do you guys think of ruby on rails
>>
>>61785756
XDOMFGLOLDD
>>
>>61784952
>chartjs
My man.
Chartjs is really nice when you just want some damned charts.
>>
>>61784522
>/tv/
Anyone know what that spike was? I'd guess GoT or something (8/6), but dunno.
Other than that, really nice job. Are you storing the data temporarily in a DB or something?
>>
>>61780044
Eh, more explicitly:

Vue-router, React-router, or (gasp!) Angular-ui-router --> changing what happens when you click a link. This CAN be broadly described as routing, but it's often use to make stuff like SPA's.

Vue/React --> React is often described as just the 'V' in Model-View-Controller (MVC). It's a LITTLE more than that, but it's certainly not designed to be an entire MVC solution like Backbone or Angular.

NodeJS --> Another JS runtime, separate from that of a browser. That's all it is. It's often called the 'back-end', but don't make the mistake of assuming that's all it does. For example, you could write a Node script that appends the word 'penis' to all your file names. It wouldn't be a back-end, in that case.

ExpressJS --> Calls itself a 'web application framework'. It basically makes writing servers/back-end routes in Node more easy. You can certainly create a server in Node withOUT express, but this just means you don't have to deal with quite as much of the middleware.
>>
>>61788719
Its slower than most web frameworks on Perl and doesn't offer much other than prettier looking syntax. Ruby was a fix for a Perl problem that no longer exists. I honestly don't see the point in using Ruby for anything at this point. If you don't want to use Perl, use Python or JavaScript. Ruby doesn't really have at the table anymore, in my opinion
>>
>>61786640
Raw SQL allows me to think a little more freely. An ORM confines me to solving problems around the ORM layer, and in most cases, writing raw SQL is only a line or two longer. In the more extreme cases my code usually ends up more succinct, because raw SQL allows me to utilize my database drivers in ways that are difficult to emulate via chaining a bunch of ORM methods together. ORMs are really only helpful when you don't have a working knowledge of basic SQL derivatives and a lack of access to the internet for problems outside of your wheelbarrow
>>
How does one write an application that's HIPAA compliant? The guidelines are verbose, but sparse when it comes to technical details. Is there any information about being HIPAA compliant that's geared toward developers?
>>
>>61789409
>backbone
>designed
kek
Seriously, though, I never could see the point of Backbone. It always seemed like an extra level of indirection that didn't actually *do* anything.

>>61790111
ORMs tend to act a bit like schemas on the top of SQL.

>>61790131
>spelled HIPAA correctly
The technical details depend a lot on your database, your framework, your usage patterns and scope, etc. For example, encrypting data in transit could be satisfied easily by HTTPS. Encrypting data at rest can be done a number of ways, depending on how you decide to structure your data and what database you're using. Maybe you have an ORM that can encrypt on the fly. Maybe you start up a microserver that loads patient data from the db as encrypted JSON and passes around access rights as encrypted keys to the JSON decryptable only by the users who should have access to them. I don't remember whether just having the whole db on a LUKS filesystem unlocked at startup by an administrator password would satisfy that requirement.
There's a best practices document out there that might be helpful, possibly published by CMS, and I don't remember that it was too verbose.
>>
@ AMAZON ALEXA ANON

My skill got approved, how do I get free shit?
>>
Is wordpress reasonably secure out of the box? Or should I tinker with permissions or anything else
>>
>>61790737
Fill out the form here:
https://developer.amazon.com/alexa-skills-kit/alexa-developer-skill-promotion

Before you do, read all the terms and conditions on that page and make sure you've done all the stuff it says you have to. Like entering tax info and stuff, in the developer account portal.

Then you should get an email saying "skill promotion confirmation" pretty soon. But the actual thing doesn't ship for a while. I submitted in July and I haven't gotten mine yet.
>>
>>61790928
Thanks for the swift response mate.

Didn't see anything about tax info on their promo page, but I'll enter it all just in case. Also, I unknowingly used a skill template. Kek. I copy and pasted code from github without realizing that's precisely what it was. You think renege? My app still says "Custom" in the skill builder thingy. Oh well.
>>
>>61790505
>Seriously, though, I never could see the point of Backbone.
I've never actually used it. But then again, I'm an angular fanboi. So what do I know
>>
>>61791085
>Didn't see anything about tax info on their promo page
Huh. I entered it in at one point, but maybe I didn't have to, or they might have changed it.

>Also, I unknowingly used a skill template.
Was it one of Amazon's skill templates?

Last month it said that only skills based on the fact skill template were ineligible. What template did you use?
>>
>>61791289
It was the fact one kek. I was looking on github for example code, found it, and blatantly hijacked it not knowing amazon authored it. They said only custom are eligible. My skill does say Custom on it though, I guess we'll see if they dig into the code.
>>
>>61791388
I'd imagine they'll probably check it. You can try though.
>>
File: 1460598861252.jpg (118KB, 406x364px) Image search: [Google]
1460598861252.jpg
118KB, 406x364px
im running wiby.me, the one man search engine of /g/

Successfully completed migration from Apache to nginx over the weekend. Got the microcaching feature setup. Dynamic pages are set to cache for 5 mins. The site is way faster I'd say more than twice as fast. Also moved from php5 to php7 which helps a bit with the speed gains I think.
>>
Anyone worked server rendering using React? Trying to increase my time to interactive as my app takes a a little long to boot up.

I'm considering trying Next.js but they don't seem to include service worker support.
>>
>>61792242
Damn anon! I thought about your thing just the other day, found some nifty sites a while ago. keep it up
>>
I just moved my website from cPanel to Ubuntu 16.04.

What are some good tools to monitor performance/stats etc?
>>
>>61793172
grafana/collectd/statsd*/graphite**
*not etsy's
**use a clone, the python version is an albatross
>>
>>61793212
thanks family
ill have a look into them
>>
I'm curious, how many of you guys have college degrees?
>>
>>61793408
High school and all sorts of independent study masterrace reporting in
>>
Are teamtreehouse paid courses worth it?

I've been through the HTML and CSS courses on Codecademy and freeCodeCamp, also the basics of JS and jQuery but I feel like I'm hitting a wall, with all the handholding, and that just digging myself into the rabbit hole could overwhelm me considering I'm tight on free time.

What should be my next move?
>>
>>61794064
whatever you do don't pay money for learning material
you should learn a server languge and sql now
>>
>>61794132
Right now I thought about just making some websites to get practice, I already learned on my first try than doing shit on the codecademy console means nothing.

My main concern is known when I know enough of a language, like HTML, CSS and JS to put on my resume that I actually know them.

And after all, I just started two months ago on my free time after work so I'm still pretty green.
>>
File: 1497116546474.png (55KB, 217x190px) Image search: [Google]
1497116546474.png
55KB, 217x190px
>>61785031

>>61789253
it's the weekly GoT spike. Some other on /vp/ with that pokemon reveal I think and /x/ from that abduction-video larper.
>DB
Yes, switched from lowDB to levelDB recently.
Storing the normal stats calculated from the catalog and also some meta info like which board was checked last, each boards newest post ID and a list of current thread IDs, so the server can continue right where it left off in case of a restart.
>>
Idea for Javascript masters: code an online game called 'Floofykins' where the user names a 'Floofykin' creature (think Pokemon) but then the creature is taken away by an adversary and the user has to retrieve it by navigating through a maze of choose-your-own-adventure type interactive tales.

I would do this but I am making my own online Javascript RPG at the moment.
>>
C O M F Y
J A V A S C R I P T
>>
>>61793408
I do but in a field completely irrelevant to this. It was two months ago now when I found out my passion is in web development. I'm 24 and with a multitude of qualifications in fields separate from one another.
>>
>>61794064
>Are teamtreehouse paid courses worth it?
Nope. Tried it. The instructors aren't that great, and you don't really learn much it's basically in this format of watch video > do an easy multiple choice > voila you now fully understand quantum computing
You really do need to just dig into a project and learn as you go. You will make mistakes, but as long as you're open to continuously looking back and improving, it's optimal way to learn.
>>
learn your CSS selectors
https://flukeout.github.io/
>>
>>61796854
mozilla spergs back at it with the ugly art
>>
I'm working with express now. Using the application generator tool. It seems like the default template engine is pug. How can I make it so it lets me use natural html instead?
>>
>tfw you finally work out that every problem encountered can be solved if you just read through the code you have written and understand what it is doing line-by-line
>>
>>61793408
I don't.

Paying 60 grand and spending 4 years for a piece of paper seemed like a bad investment.
>>
install bootstrap locally or link it to the cdn offered through the site.
>>
>>61797553
CDN.
>>
>>61793408

I have an undergraduate history degree.

It was fun but useless.
>>
>>61797538
my 4-year degree cost $40,000 and what it proves is that I have the patience/skills to work in a large organisation plus some bonus technical knowledge.

The 'piece of paper' is the receipt that proves I'm not lying about it.
>>
>>61797506
Seems like a question you could easly find answers on the botnet.
>>
>>61798278
Well, I got paid about 40,000 per year at my first web dev job and it proves that I know how to web dev in an actual work environment.

I see the point of a degree in just about every field but web development.
>>
File: CA.jpg (138KB, 1283x918px) Image search: [Google]
CA.jpg
138KB, 1283x918px
Literally just finished the first module of learning Java on codeacademy... so far so good although this looks liek quite a step up.
Any tips for learning this? I'm keeping the summary pages and noting notes down but I hav zero coding experience.
>>
>>61798636
Common learning technique for programming. They show you something crazy and say "you will know some of this after this chapter"
It's a stupid technique.

Just continue and you will be fine.
>>
File: 1500910990599.jpg (2MB, 2317x1350px) Image search: [Google]
1500910990599.jpg
2MB, 2317x1350px
I'm working with an SQLite database in Python (sqlite3 module).

Are commits with one small insert/update supposed to take 0.11 seconds on average? If so, how do I avoid committing often while keeping the ability to rollback the transaction without data loss if an exception rises?
>>
>>61798685
Aw no sorry. I meant learning in general. Did you keep books with physical ink or am I living in the past?
>>
>>61791475
Can I go in and obfuscate my code?
>>
REACT
What's a good way for dealing with a component with many args?
I got this.



const ListSelection = ({lists, handleListChange, loadData, delData, makeNewList}) => {

if(!lists){
return <h4> Loading Lists... </h4>
}
if(lists==[]){
return <h4> No lists yet. </h4>
}
return <div>
<select onChange={(e)=>handleListChange(e)}> {lists.map((listName, idx)=><option key={idx} value={listName}> {listName} </option> )} </select>
<button onClick={loadData}> Load Book List </button>
<button onClick={makeNewList}> Make New Book List </button>
<button onClick={delData}> DEL LIST </button>
</div>
}

export default ListSelection
>>
>>61799070
I prefer learning from books.

The problem is finding a book that isn't full of deprecated practices because it's too old.
>>
>>61799342
I think the issue is that they don't want 'fact skills'. So all fact skills might not be applicable, whether or not you explicitly use their template.

You might want to just create a legit skill without their templates. I can give you some skeleton code if you want, for a skill that basically tracks how long it's been since the last time you did something. You either say "Alexa tell X-Tracker I just did X" or "Alexa ask X-Tracker when was the last time I did X"
>>
if you can't come to terms with javascript, programming just isn't for you
>>
>>61799373
You could just pass in ...rest as an arg after lists and just use res.handleListChange ect... not sure there is a great way for that though
>>
>>61799762
Please provide a code example. Thank you.
>>
>>61799778
he was referring to spread operator
>...rest
>>
>>61799882
This anon is right. Also I'm pretty sure you'd need to use babel to use this


const ListSelection = ({lists, ...rest}) => {

if(!lists){
return <h4> Loading Lists... </h4>
}
if(lists==[]){
return <h4> No lists yet. </h4>
}
return <div>
<select onChange={(e)=>rest.handleListChange(e)}> {lists.map((listName, idx)=><option key={idx} value={listName}> {listName} </option> )} </select>
<button onClick={rest.loadData}> Load Book List </button>
<button onClick={rest.makeNewList}> Make New Book List </button>
<button onClick={rest.delData}> DEL LIST </button>
</div>
}

export default ListSelection
>>
>>61799373

Use PropTypes

class myComponent extends Component {

static propTypes = {
obj: PropTypes.object,
arr: PropTypes.array,
}

render() {
// .. do stuff
}
}


>>
>>61785854
Yeah it's possible but steele's course is basically an intro/crash course on front/back end. It will teach you a little more than bare minimum for both front and back end. I'm more than halfway into it and it only took me about a month (maybe spending 2 hours a day on it). So if you dedicate most of your time to it, yeah you can though I suggest you follow it up with other courses.
>>
>>61793408
Follow up to this question: Do your employers give a fuck if you don't have a software eng/comp sci degree?
>>
>>61800311
Im doing this course rn, any suggestions on what to do next? Maybe a good php+ mysql course or anything really.
>>
>>61800467
well this course does mongo so learning another backend lang is kinda counter productive isn't it? I've been told to just take more courses on node and maybe do a course on react or angular.
>>
File: worry.png (138KB, 299x377px) Image search: [Google]
worry.png
138KB, 299x377px
Lads, I have a few hours to learn SQL for a test on codility.

what's the fastest way to do it?
>>
File: 1420099814802.jpg (13KB, 250x239px) Image search: [Google]
1420099814802.jpg
13KB, 250x239px
any asp.net fags here? What reasons are there to use mvc over webforms? webforms seems to do everything I could need.
>>
>>61802272
I've never done asp.net, however, could it be that you can implement two directional data binding in a mvc environment?
>>
whats the fastest way to get up to speed with the vue ecosystem? Also, what's a good demo project to build that would allow me to see the advantages of using a framework like react/vue?
>>
>>61800717
SQL wizards make upwards of 85 an hour.

Baaically you're going to fail.
>>
>>61802272
Webforms is basically giant hack meant to keep you away from underlying html and javascript. It fails at that for every even remotely advanced project. It's also basically deprecated. MVC is actually great framework.
>>
>>61802451
Two directional data binding is not term I would use for backend. You are probably confused about something.
>>
File: 1502057641693.jpg (93KB, 1024x492px) Image search: [Google]
1502057641693.jpg
93KB, 1024x492px
Lets say I have the following:
https://www.domain.com/script.pl/webpage/
How the fuck do I hide the script.pl part? Been searching for the answer for like five hours today
>>
Do any of you have ok experience with NameSilo? Their domain prices are pretty sweet but there seems to be a moderate amount of negative reviews on the internet. A lot of them stem from transfer issues, CloudFlare or the user not being able to pay for the domain which isn't the domain registrar's fault. However, I was hoping for some feedback here.
>>
>>61803218
Is it a static page, is it running on php, or py or something else? The only thing I can think of is configuring it in the .htaccess file.
>>
Wtf is with OOP PHP being full of comments?

5 lines of comments for every variable made.

@var @param is this shit important? It makes the code look really really bad.
>>
>>61803424
> @var @param is this shit important? It makes the code look really really bad.

Yeah, it is important. If your project is small and you're certain that it's small then I guess you can cut down on comments but in big projects, comments are life savers. Don't be a pajeet, thanks.
>>
>>61803218
what server software are you running it in?
>>
>>61802503
did you check the guide on vuejs.org?
>>
>>61802766
I guess if you were using things from the toolbox that would be true, but you still make the pages with [x]html and javascript just like any other web page.
>>
>>61802832
winguys used this to describe their wpf vs winforms, so I assumed this could also work here
>>
File: 1500840377634.gif (442KB, 441x270px) Image search: [Google]
1500840377634.gif
442KB, 441x270px
>>61803392
>>61803469
Its a perl script running in Apache. Basically the /webpage/ part in my example is dynamically created and there are a lot of them so a simple rewrite wont do.
>>
>>61803521
yeah but i was looking for something more in-depth that covers stuff like vuex and building real world applications, not just todos and tooltips..
>>
>>61803218
Url rewriting is keyword.
>>
>>61803424
Phpdoc probably. It's easily useful if you have IDE that supports them.
>>
>>61803543
The main principle of webforms is that you don't. It abstracts you away from underlying Web page creating is own way how things work that is not compatible with how web pages really work.
>>
>>61799936
How would you add "..rest" when returning component?

I assume
 

return (
<ListSelection lists={listTitles}
loadData={this.loadData}
makeNewList={this.makeNewList}
delData={this.delData}
handleListChange={this.handleListChangee}
/>
)

Is incorrect ? ?
>>
>>61803557
Makes sense in that context. Problem is that this is not how web works. Forms tries to emulate bidirectional binding and state but it's only a hack on top of normal Web behaviour.
>>
what's a reasonable amount of time to make a decent website with public communication for someone starting with no experience in JS or html?
>>
>>61804635
1 year of medium focus

6 mo of intense focus
>>
>>61803622
A mod_rewrite rule in .htaccess is probably the way to go. I don't really know how to do it because WordPress generated this for me, but my .htaccess changes "/index.php/<some page name>" to "/<some page name>"
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>


I glanced at the docs here:
http://httpd.apache.org/docs/current/mod/mod_rewrite.html#rewriterule

And the RewriteConds seem to be excluding existing files and directories. But I don't really know what the '^' and '$' characters do, so I'm not sure how the other syntax works.
>>
>>61804206
So everything beyond your first arg is '...rest', what you have is correct I think

here is an example
https://codesandbox.io/s/O3AJNrYY
>>
Any good tutorials for C#, ASP.NET, etc? Any tips on choosing between web app (.Net Framework), Core web app (.NET Core), and Core web app (.NET Framework)?

Almost every video on YouTube is by a Pajeet. Seems like a bad sign.
>>
>>61804796
This htaccess sends all requests except existing files and directories and index.php to index.php. Syntax is based on regex, that's where $ and ^ come from.
>>
>>61806401
msdn has a pretty good tutorial I think
>>
>>61803424
>Can you generate HTML documentation for this whole project, anon?
>Of course, Winston, let me run this small script
>>
File: good_night_wdg.png (363KB, 5000x5000px) Image search: [Google]
good_night_wdg.png
363KB, 5000x5000px
>>
Just starting to learn HTML/JS, I have a lot of code that looks like this:

$.get(url, function(data) {
$("#thing1").html(data.thing1);
$("#thing2").html(data.thing2);
$("#thing3").html(data.thing3);
...
});


Is this bad practice? If so, how do I update the markup more efficiently/cleanly? Willing to look into whatever meme framework is recommended if it'll get the job done
>>
>>61807461
Your server shouldn't be returning back HTML. It should rather be returning a representation of the data that you requested (i.e JSON) so you can use client side logic to determine what to render on the page.

It gets better with a view library like react of a framework like Vue but if you're new don't worry about them.
>>
>>61807461
1. Try to stay away from IDs, classes are more flexible.
2. If you're querying for static elements (they're written into the html and don't get deleted and recreated or anything), then move the queries out of your callbacks so that they are constants.
3. Depending on what the types of these data properties are, you should probably be using the jQuery "text" method instead of "html".
4. Use arrow functions.
5. Try to only use jQuery when you need it, you're getting basically nothing from it here.

const byId = document.getElementById;
const elem1 = byId('thing1');
const elem2 = byId('thing2');
const elem3 = byId('thing3');

fetch(url, ({ datum1, datum2, datum3 }) => {
elem1.textContent = datum1;
elem2.textContent = datum2;
elem3.textContent = datum3;
});
>>
Is it possible to stream a large table from a microsoft sql server with express to an angular front end seemlessly? I am getting a 200 return but no return on npm mssql
>>
Hey /wdg/, I have a potential client who wants me to do a cross-platform mobile app, problem being I only know full stack web dev with VueJS and PHP. The client's app needs a lot of phone hardware functionality such as NFC & bluetooth as well as integration with fitbit and other smart watches. I don't have time to learn Android & iOS dev and I don't want to sub-contract it as it seems like an interesting challenge. I've been looking into picking up Angular & Ionic or React & React Native. Which combo would you recommend and why? Ideally something easy to pick up and with simple build tooling.
>>
>>61807701
React Native is more of a native phone app while ionic is essentially an optimised web browser (like electron) for the specific platform.

React native is pretty new (2 years or so) but has a lot of community support. I'd first look for some Github projects that implement the native specific features that you're looking for. I'm pretty sure that there are decent solutions around. You can also use the boilerplate create-react-native-app to start off
>>
>>61776565
Hey guys, I just learned JQuery, should I learn Angular too? It just looks fucking annoying to mess with.
>>
>>61807568
My bad for being unclear, the "data" part is JSON and I'm already building the markup with that

>>61807610
Thanks a bunch, is the performance difference between using jquery and regular JS that noticeable? I also use shit like datatables so I can't drop it entirely
>>
File: 1502128310856.gif (139KB, 356x326px) Image search: [Google]
1502128310856.gif
139KB, 356x326px
>>61807701
>as well as integration with fitbit and other smart watches
dunno about react native vs angular vs cordova but you want to access fitbit and smart watches data through appropriate web services
i have an old mi band 1+ or whatever, bluetooth custom protocol is proprietary and even tho some dudes seemed to have reverse engineered it it seemed a bitch to interact with so i just have the band send data to official app, official app sends data to google health, google health sends data to my app through google api
you probably want some similar setup unless fitness gadgets suddenly started having an http rest api and nobody told me
>>
>>61807872
this is probably be going to be a pain and process might vary on a device model basis, not to mention platform (ios vs android)
>>
>>61793408
Video game development degree
Terrible decision, taught myself web Dev during last year instead of going to classes

Doing the best out of my class, Fuck game development
>>
>>61807856
>>61807872
>>61807888
Thanks!
>>
>>61807870
>is the performance difference between using jquery and regular JS that noticeable?
Performance isn't really the primary consideration here, it's your diet as a programmer. It's much more valuable for you to be getting familiar with vanilla JS APIs than jQuery APIs. Everything is build on those JS APIs, including jQuery. If your knowledge is built on that foundation it will be portable, especially when the whole industry is moving directly away from jQuery specifically.

>I also use shit like datatables so I can't drop it entirely
I'm not saying drop it entirely, just only use jQuery when there's a strong impetus to. Once you've found there's not a good native solution. jQuery is a special toolbox you can use for special jobs, but every time you use it your code becomes slightly more convoluted.
>>
>>61807701
Weex is currently based on Vue, but it doesn't have the popularity and community support of React Native or Ionic Framework, etc..
>>
File: 1432669193779s.jpg (10KB, 223x225px) Image search: [Google]
1432669193779s.jpg
10KB, 223x225px
so I'm looking through MVC documentation and it seems like it's built for really thin-client use. If I wanted to delegate most of my view logic to javascript, it would basically deprecate the V in MVC. It almost feels like the entire framework is bloated and over-complicated.
Am I thinking about this in the wrong way or something?
>>
File: 1471653771418.jpg (90KB, 640x480px) Image search: [Google]
1471653771418.jpg
90KB, 640x480px
>>61793084
Thanks anon, I'm trying to do my part
>>
File: smug drogba.png (69KB, 214x262px) Image search: [Google]
smug drogba.png
69KB, 214x262px
>>61800717
>>61802682
update:
got 79% in the test
>mfw mastered SQL in 6 hours
>>
>>61807869
Just started looking at tutorials for Angular - Holy shit this looks so complicated. Is Angular worth it?
>>
>>61808577
No. Complex data-binding-based solutions are a thing of the past. Learn React.
>>
>>61808201
The view is any visual representation of the data (model)

Web browser clients typically are exposed to the view and the server handles the model and controller (routing to the view)
>>
>>61809152
so say if I wanted to have most of the ui lifting done on the client. I would make the view as a bunch of blank dom objects, and then I would pass the model through the chtml to the js namespace to actually manipulate the page? I would prefer actual code be separated from the markup as much as possible.
>>
>>61809215
Yeah you're thinking along the lines of a view library like React. In your front end you'd have a "static site" that fetches data from your server using, the server responds with JSON data, your client parses that json and renders it in to HTML using React.
>>
How can you use chromium's dev tools to make some edits to a web page's javascript?
>>
>>61809746
Fucking watch a tutorial on youtube, what the fuck do you want from us?
>>
>>61807222
What do you want?
>>
>>61808441
Doubt. Whats the difference between an inner join and a left join?
>>
>>61810092
what's a join? subqueries is all you need, baby
>>
I'm not that good with python and the biggest hassle for me is the different versions. Is there an easy way to handle different environments and switch from 2 to 3 back to 2 easily. I mainly have this issue on my retarded windows laptop but not on my linux machine.
>>
What's the /wdg/'s recommended IDE?
>>
>>61810631
qtcreator :^)
>>
>>61810631
Any Jetbrains/IntelliJ based IDE if your business provides licences or if you're a student
>>
>>61810631
I tend to just use text editors with syntax highlighting if I can. VS code for most stuff and emacs if I just need to edit something quick in the terminal

>>61810724
Used it in the past, and it actually had one feature I really liked; alt+left/right arrow to move between words worked through camelCase names instead of just words with separator characters between them. I'm sure there are settings or addons for other editors that do that as well though.
>>
>>61810631
visual studio
>>
What's the best place to buy domain name?
>>
>>61811729
godaddy bar none
>>
>>61811758
no

>>61811729
see earlier discussion >>61781530

I think the consensus was Gandi
>>
>>61807568
Oh fuck off. There are more valid ways to get things done than your approach.
>>
>>61811779

gandi doesn't have whois protection though
>>
>>61811729
name.com is alright, was the cheapest at the time when I bought some .work/.link domains
>>
File: temp.jpg (46KB, 998x510px) Image search: [Google]
temp.jpg
46KB, 998x510px
Server noob here.

Going to be hosting multiple sites/ apps on Vultr.

What OS should I pick or does it not make much difference?
>>
>>61786640
I wrote my own ORM, best of both worlds.
>>
>>61813048
My go to is the latest ubuntu with lts, there's a lot of documentation on it case you need something extra done.
>>
>>61811809
And you named zilch.
>>
>>61813153
thanks bruv
>>
Do you keep track of your projects with a blog, /wdg/? If not, then why? School surely must have taught you about the best way to learn being to reflect on your work.
>>
>>61813182
You're welcome m8
>>
You guys (some of you) know all the js moves.

So what's the best way, most nifty way to

Object {A: {title:'a',src:'#'},{B: {title:'b',src:'#'}}}
===>

[{topic:'A',title:'a'},{topic:'B', title:'b'}]



I could use Object.keys and an old fashioned loop, but I want the best, most efficient.
>>
>>61813456
'for of' Object.keys() is fine and more efficient than a 'for in' loop.
Or Object.entries(). Whatever makes your code more clear.
>>
>>61808201
If you are talking about .NET MVC then it also works really well for creating API.
>>
>>61789409

Sorry for the late reply, but thanks..
>>
File: 1501268133628.png (1MB, 910x929px) Image search: [Google]
1501268133628.png
1MB, 910x929px
new thread
>>61813732
>>
>>61813456
The most efficient in terms of operation time is always gonna be loops. The best when you're not as concerned with operation time (if the number of keys here is less than say a hundred), would be:

// Object {A: {title:'a',src:'#'}, B: {title:'b',src:'#'}}
// ===> [{topic:'A',title:'a'},{topic:'B', title:'b'}]

Object.entries(obj).map(([topic, { title }]) => ({ topic, title }));
>>
File: 1502165899619.gif (51KB, 300x225px) Image search: [Google]
1502165899619.gif
51KB, 300x225px
>>61810631
eclipse for big projects, emacs for small stuff
Thread posts: 314
Thread images: 38


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
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.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.