[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
/wdg/ - Web Development General
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 255
Thread images: 24
File: 22-mr-robot-w529-h352-2x.jpg (91 KB, 1058x704) Image search: [Google]
22-mr-robot-w529-h352-2x.jpg
91 KB, 1058x704
Le Monsieur Robot édition

> IRC
#/g/wdg @ irc.rizon.net
Web Client: https://www.rizon.net/chat

> Tutorials & Resources
https://www.codecademy.com/ — Learn to code.
https://www.bento.io/tracks — Start here if you’re new.
http://www.theodinproject.com/ — Alternative to above, focused on Ruby on Rails back-end.
https://developer.mozilla.org/en-US/Learn/Choose,_Install_and_set_up_a_text_editor — Choosing a code editor.
https://libraries.io/ — Discover new open source libraries, modules and frameworks.
https://www.coursera.org/browse/computer-science — CompSci courses.

> Getting Hired
https://pastebin.com/4YeJAUbT/ (embed) — NEET Guide to Web Development
http://elliotec.com/how-i-got-a-job-in-web-development/

console.log(Thread.previous) // >>51211627
>>
console.log("hi new thread")
>>
Hi guys I was wondering can you recommend some book / tutorial about browser itself and its functions and options and I dont mean some specific brand of browser, I mean in general. For example I want to know what all those things in Inspect element are for , Sources tab ,Audits , Resources etc.
I want to know and understand browser inside-out.
Thanks.
>>
>>51243205
>I dont mean some specific brand of browser,
There are only 2 worthwile browsers out there and they both have similar dev tools, there's
https://developers.google.com/web/tools/chrome-devtools/
>>
d3js is cool
>>
File: 1446443904961.jpg (749 KB, 2362x1572) Image search: [Google]
1446443904961.jpg
749 KB, 2362x1572
Question from noob here.

I have to make a simple bloglike website. Site with posts + login for admin where I could add new posts.

It is homework, I do not have care about security etc.

Do I have to set mysql + php for that or is there a simpler way to code this?
>>
>>51243647
Just put it in the source file.
>>
>>51243647
>Do I have to set mysql + php for that
You know you can just intall xampp
>>
Skeleton or Bootstrap? Anything else even better?
>>
How can I find the current offset-top of the element? Nothing works... I need to do fade in animations while scrolling and I think I'll need to find a position of every element on different screen sizes and then I'll use some loop to add animation classes. Don't know if it is efficient enough though. I would rather just use some library but just can't find any, I know I've seen one on the Foundations' page before.
>>
>>51244092
I have exp just with Foundation but it is good and easy.
>>
>>51244102
have a look how jquery does it.
https://github.com/jquery/jquery/blob/99e8ff1baa7ae341e94bb89c3e84570c7c3ad9ea/src/offset.js#L76
>>
>>51243205
>I want to know and understand browser inside-out.
Firefox is open source.
>>
What is /wdg/'s favorite CSS preprocessor and why?

Thoughts on HAML and Smarty?
>>
Does anybody else use brackets?
>>
>>51244184
None
>>
>>51244016
>>51244059
I tought I could make just simple js popup + redirect to admin panel page, but where could I store posts?
>>
>>51242573
I wonder if somebody was paid to make this image.
>>
Which SQL database should I use?
>>
>>51244306
Also, is Orientdb a viable alternative to a classic sql db?
>>
>>51244184
SASS/SCSS.

I can't without nesting anymore, it's too good.
>>
>>51244184
LESS or SASS compiled to CSS
>>
I cloned a website and put it on a similar domain. how do i change it enough to avoid getting sued.

also, am i right to avoid using javascript for optimal compatibility?
>>
>>51244338
by compatibility you mean 15 year old browsers? yes
otherwise no, JS is fine.
People who actively disable JS know what they are doing and get your page working if they want to.


not experienced with stealing stuff, so no idea.
>>
>>51244164
>>51244102
http://youmightnotneedjquery.com/
var rect = el.getBoundingClientRect()

{
top: rect.top + document.body.scrollTop,
left: rect.left + document.body.scrollLeft
}


>>51244184
Less, because no Ruby dependency.
>>
>>51244421
exactly why I linked him how jquery does it and not just how to do it with jquery.
>>
>>51244421
http://sass-lang.com/libsass
>>
>>51244432
The site can be used as a general reference on common operations.
>>
File: 1432397473112.png (157 KB, 516x440) Image search: [Google]
1432397473112.png
157 KB, 516x440
I'm a front-end developer and I want to make some websites to build up a portfolio.

Any suggestions on what type of sites I should make to show off my skills? I know HTML, CSS, jQuery, Angular, etc.
>>
>>51244465
Everyone makes blogs apparently
>>
>>51244365
actually yeah, i manage a page targeted at rural residents.

also, stealing or not is gray. I'm hoping to make it grayer. It's work produced sure but i work for the person who commissioned it.
>>
>>51244487
i should clarify "work for" im not in their employ but i i am paid cash
>>
>>51244421
>>51244463
I don't know, it lacks checks and all.

For example jquerys show() replacement.
if you have an element hidden with css, resetting the display attribute wouldn't show it, hence why jquery sets it to its default value like block, table-row etc.
>>
Async functions are love.
>>
>>51244478
I guess that's an alright idea. I hoping to make something that I wouldn't need to continuously update though.
>>
>>51244681
Make a corporate page for a fake company then.
>>
>>51244465
Make a personal webpage that holds your resume and stuff dude.
You could even add an actual portfolio section later.
>>
>>51244698
Yep good idea i'll do that.

>>51244715
I already have one. My portfolio section only has 3 projects though.
>>
if javascript was a boy i would marry him
>>
Who /coffeescript/ here?
>>
>>51244766
gross.
>>
>>51244756
you'd have some sex since it takes forever to finish.
>>
>>51244781
l*wd
>>
>>51244789
i know you still want it though, dirty code whore
>>
>>51244306
MariaDB. It's MySQL, but without Jewracle, faster and 100% compatible.
>>
How do we kill NoSQL? How do we kill JavaScript "Frameworks"?

The meme has gone on long enough.
>>
>>51245467
How does it compare to postgres?
>>
Do any freelancers have any advice on managing clients sites/hosting?

I'm mostly curious about hosting and whether I should rent a VPS and set up virtual hosts for each site or if I should use some service that deals with that for me.
>>
>>51245766
Depends on how many headaches you want.

If you host their sites on your VPS then when shit hits the fan you're the one that has to get up in the middle of the night and fix it, but you can of course charge for this which might not be so bad.

Otherwise tell them to buy some managed hosting and let them handle it themselves.
>>
>>51245539
NoSQL is fine, if used in appropriate cases, for example, if most of your data is non-relational JSON. Frameworks need to die though.
>>
>>51245816
I'd like to avoid it if I can, but I really think that the data I could get from it (such as referrer links) would make it worth it, plus the income from hosting fees.

I'd really like to branch out and offer more services than just web design/dev, and if I could get the same amount of data without having to manage the server myself then that would be ideal.
>>
>>51244306
Postgres
>>
Will Bootstrap still be shit after v4?
>>
Are there industry-standard CSS frameworks other than Bootstrap?
>>
>>51246789
foundation, pure, mdl, etc.
There's no standard, there's hundreds of them.

Pick one you like and can work with and fits your needs best.
>>
>>51246789
bootstrap and foundation if you want to be a jobber. mostly bootstrap.
>>
I asked this yesterday, but got no replies
how do you advertise your website? I don't mean in a commercial way, I mean just to make it known and to find niches
>>
>>51243164
>trusting the parser to add a semi-colon
yep, its a web developer
>>
>>51246912
>not understanding 4 simple ASI rules
How are you even a programmer?
>>
>>51246912
>Holocene
>Semicolons
>>
>>51246906
Post it on a memebook group with members that would probably like your content
>>
Anyone on /g/ go through LaunchCode? Seems like a good way to get some paid work experience, but want to know if anyone has hands-on experience.

I've already applied and taken the test, waiting to hear back.
>>
>>51244228
It's from mr.robot, serie about this pleb using linux hacking and shit. He's supposed to have social anxiety but doesn't look like that at all.
>>
>>51247314
thanks
>>
File: rails-vs-laravel.jpg (24 KB, 500x300) Image search: [Google]
rails-vs-laravel.jpg
24 KB, 500x300
>>51242573

Hi guys, Rails developer here, and I'd like to address a common criticism of Rails.

How the fuck can people say that Rails is for hipsters, when I just had a look at Laravel, and it is literally the EPITOME of hipster, self-gratifying, bullshit wankery?

Laravel's CLI utility is called
artisan
. IT'S CALLED ARTISAN FOR FUCK'S SAKE. THAT'S HOW UNASHAMEDLY HIPSTER IT IS.

And when you make a new Laravel app with
laravel new my-new-app
, it doesn't say "Building application" or anything like that... no, of course it doesn't - these are hipsters remember! Such straightforward language simply won't do! Instead, it tells you that it's "crafting" your application.

Why don't these stuck-up hipster gobshites just fucking kill themselves! They are everything that I hate about web dev these days! FUUUUUUUUUUUUUUUUUUUUUUUUUU
>>
>>51247888
laravel is literally a rails copycat made for php shitters
>>
File: 1413645093332.jpg (73 KB, 884x574) Image search: [Google]
1413645093332.jpg
73 KB, 884x574
>>51247888
>>
>>51247924

Rails is functional. It doesn't have some hipstery, airy fairy website, and it doesn't have anything within it called "artisan", and it never ever tells you that it's "crafting" anything.
>>
>>51248003
?q=ruby+rails+crafting
>>
>>51248051

Those are users. The people who made Rails are not hipsters. But those who made Laravel clearly are.
>>
File: 1445268158068.jpg (47 KB, 448x463) Image search: [Google]
1445268158068.jpg
47 KB, 448x463
>>51247888
Is this some copypasta I never read before?
>>
>>51243647
You can do the login with JS and you can make it look like posts are already there with some html, you can even make it look like you're publishing posts with JS and store them in local storage lol

If you do this, it would be pretty funny
>>
File: 1437005701764.png (92 KB, 253x224) Image search: [Google]
1437005701764.png
92 KB, 253x224
>maintaining 10 year old legacy PHP app
>functions in functions
>what is OOP
Does it get easier /wdg/?
>>
>>51244465
nobody's looking at your portfolio, sad truth. If you say you have exp, they believe you. Github would be better. Build things just for the practice honestly. If they ask for a port (which they won't), direct to github
>>
>>51244756
If it was a grill, I'd marry her.

>>51246789
Just bootstrap, and some companies have their own flavors of bootstrap

>>51246906
I got a lot of hits (2000) from one person posting my site on some sub reddit
>>
How is your experience with Mithril, anon?
>>
>>51247364
Where do you live? They're headquartered here in St. Louis and I know a few people who actually have gone through them and have programming jobs. They don't seem to do much for web devs though.
>>
>>51248478
What kind of site is it?
>>
>>51248625
dumb political blog I had way back when.
>>
>>51247188

Reposting here because it makes more sense here.
>>
>>51248651
Can you even delete the root? If this is some sort of
sudo rm -rf /
situation then you're fucked.
>>
>>51248375
Or you could just put all the highlight projects of your github on your portfolio.
>>
>>51248724
I can't even remember what the hell I was trying to accomplish, but I do know that I deleted it from phpmyadmin (I'm using Wamp), and now I get a message: ERROR 1130 (HY000): Host 'localhost' is not allowed to connect to this MySQL server.

It doesn't matter too much because I'm just learning how to use Apache with MySQL and PHP, but I figured it would be a better learning experience to fix it rather than just reinstalling Wamp.
>>
>>51248940
Sounds like you'll be busy today
http://www.servaxnet.com/blog/2010/07/10/restoring-accidently-deleted-root-user-in-mysql/
>>
File: sqla_logo.png (3 KB, 300x63) Image search: [Google]
sqla_logo.png
3 KB, 300x63
How does /wdg/ feel about SQLAlchemy for Python? I've never been too good at SQL, but this feels complicated. Maybe I'm just not thinking about it from the right angle. I'm sure the scalability of my webapps would improve from me using it though.
>>
>>51248940
Well, you could try and fix it per >>51249018's link, or you could just learn to never never fuck with the root user of anything and start over.
>>
>>51244092
Materialise
>>
Any freelancers itt? I have some questions for you if you'd be so kind.
>>
>>51249029
Its good for writing sql thats pythonic

and if uwant your own ORM like djangos, you can customize SQLA for that.
>>
>>51249018
Got this to work. 'Restart All Services' wasn't restarting the MySQL process so I had to manually kill it to get skip-grant-tables to work.

>>51249065
>you could just learn to never never fuck with the root user of anything
Duly noted.
>>
>>51247888
Hipster or not, it's the only good PHP framework there is. PHP doesn't have many strengths, probably none at all, but Laravel still uses the ... least weak points of the language. It's actually quite pleasant, considering it's still PHP.

Shitfony, on the other hand... it's trying to treat PHP like Java. It isn't Java. ThecClass system may have been an insanely naive approach at cloning Java's OOP system, but everyone should see the huge flaws in PHP's implementation. Annotations don't even exist at all, yet they still desperately attempt to fake them by parsing fucking docblocks. HELLO? These are for documentation, you fucking pisskeks.
PHP "arrays" for configuration, passed as parameters are also always nice, too. Better remember all those string constants, faggot. PHP's developers know what's best for us: named parameters are SOOO confusing and proper enums are tooootally worthless. Just make some random defines somewhere in some file. This works especially well if that file is in the global namespace.
And then there's the verbosity. I hate having to edit 4 different places just to be able to log something. It doesn't even make sense semantically. My logger should not be a member of my Services. Sometimes, there's nothing wrong with a static call.

The only "good part" about Symfony are the hundreds of available bundles... that basically do nothing but emulate features that Laravel already has built in. Poorly and inconsistently at that, because different authors structure their bundles differently and introduce hundreds of dependencies for no apparent reason. Give it a try. Just install a couple of bundles. Soon, you'll also have Zend Framework, Nette and other frameworks installed because some idiot bundle author decided to call one or two functions from those and decided not to simply, you know, COPY THEM.

If it absolutely has to be PHP, use Laravel. It's a great framework and has everything you need. If you have a choice, pick a better language.
>>
>>51248324
Functions in functions is fine, if the compiler inlines them. If not, get a better language.
>>
File: magento.png (13 KB, 391x324) Image search: [Google]
magento.png
13 KB, 391x324
If I code a webpage, can I just use an eCommerce backend like Magento to add products, or would I have to redesign the entire webpage using Magento?
I'm new to web dev.
>>
>>51250070
Stay as far away as you can from Magento.
>>
Do people here actually unironically use Angular or React?

How dumb could you be to rely on JavaScript for displaying underlying page content?
>>
>>51250691
Rendering with JS is a valid choice for SPAs, but Angular is horrible. Can not say much about React. It does not fit use cases more advanced than simple templating though.
>>
>>51250691
At least it works reliably in all browsers.

Unlike, you know, HTML and CSS. Maybe in 2020 those language will do their job, but until then, we need Javascript to be their caregiver, because without it, those fucking retards wouldn't be fit to do anything except displaying text in insanely simplistic ways.

Enjoy your 20 levels deep div structures that you need to remember by heart with tons of different classes, data attributes etc. and keep using jquery, or even the raw dom APIs if you really think you do. It's not going to do you any good.

Maybe when web components, flexbox, grid layout and observers are finally natively supported in all browsers, we'll be able to live without frameworks.
But until then, the retards need their caregiver.
>>
>>51250842
So you're the bastard who loads up 6MB of JavaScript on first page load and your website takes 10 seconds for the average user to load?

Fuck you.

You are what's wrong with web dev.

Cunts sitting in Silicon Valley on their corporate gigabit fibre thinking 6MB of JS is fine because it loads instantly for them.
>>
>>51250998
Convince the cunts to download modern browsers then so we don't need all those polyfills and other workarounds.

Old fashioned 90s web development is unbearable. Especially for applications. It's literally impossible to create anything that's reusable.
Blame the web for being terrible, not the web dev. The web just wasn't made for what we expect from it nowadays.
>>
>>51250998
Not that guy, but...

>6MB
Angular itself is 144 KB (52 KB gzip) and is cached so you only load it once. It would literally load with dial-up in 1 second, and from then on would remain in cache across every angular site that uses the cdn for an entire year
>>
>>51251104
You can get your total page weight under 250kb without sacrificing on looks, you are just bloating it because you can.
>>
>>51250998
I'm not defending bloat dispatchers, but a thoughtfully-crafted web application without framework bloat can still be light and fast even with pure client-side rendering.
>>
>>51251133
Which libraries have you even seen that are that huge? The only websites I've ever seen that are that large are single page applications whose authors never heard of minimizing.
>>
>>51251184
It's not the library necessarily, it's the bloat added on by the webdev. You're right, it's usually single page apps.

I've seen websites that are several megabytes big, and they're not even remarkable.

YouTube is only ~500kb.
>>
Example: thenextweb is 3.4MB on cold load.
>>
>>51251226
Yeah, I also have a limit as to what I can tolerate.

But there's also a limit to what I can tolerate in web dev as well. It fucking sucks. It's a fucking mess. Every stupid class selector (or even worse, attribute selector) I have to add to a website is really hurting me.
Every time I have to figure out "hmm, this site has this class and that class and that data attirbute, so I'll need to use these 5 <script> tags and set up these 15 jquery addons with these objects as parameters" I almost puke. It feels weird to put them all in the main template instead, I feel dirty when I do it, but also... at peace. It's not going to break anything. I don't have to repeat 3 billion lines of boilerplate on every sub page.
Web development feels like Java development in a text editor. Java 1.2 development, where the most optimistic estimates for a 1.3 update date are in between 5 to 7 years.
>>
>>51250691
React is a meme, but Angular is the real deal
>>
>>51251810
>Angular
>not shit
http://larseidnes.com/2014/11/05/angularjs-the-bad-parts/
>>
>>51248940
Don't even bother, unless you want to grow old trying to fix it.

LAMP is such a clusterfuck to debug if something goes wrong, you're better off just reinstalling.
>>
>>51250070
You should surely not start with Magento, if you're new to webdev.
>>
>>51242573
hi guys, I want to ask why youtube proxies claim they can unblock videos in other countries but they don't. I thought it'd be too much if I made a thread about it. Thanks for the explanation.
>>
>>51252050
Reading through this, these are all just things you have to learn and things noobies make mistakes with. But once you get it, you got it.

Some are actually strictly features that I don't think the author understands their use, but I use everything he's talking about.
>>
File: 1446444059386.jpg (281 KB, 1884x1125) Image search: [Google]
1446444059386.jpg
281 KB, 1884x1125
This is what I was thinking about.

I did not code in js before. Login and redirect to administrator panel is pretty easy, but what about storing posts? Should I store it in normal txt file?
>>
>>51252948
mean
>>51248302
>>
>>51243647
You can build this with django in less than 20 minutes.
>>
>>51244306
Postgres is the best.
>>
>>51250421
>>51252235
I know already code html, css, and javascript (working on jquery) but I need a way for my clients to update their websites and don't know shit about backends
>>
>>51245766
It's quite easy to get cpanel on your vpn, it makes it super easy to manage lots of accounts and it's pretty cheap all things considered.
>>
File: linux.gif (663 KB, 414x317) Image search: [Google]
linux.gif
663 KB, 414x317
>>51244465
Github gives out a free website for the user. You could make a nice interactive portfolio on there or some simple demos to prove your worth.
>>
>>51245620
It doesn't. It's still MySQL so compared to Postgres it's that retarded kid on the playground eating shit
>>
>>51244306
Postgres. It's the only serious open source database.
>>
>>51248324
Are you me? I've been doing the same for around 9 months or so now and management refuses to move pass procedural PHP.
>>
>>51248724
Probably. Knowing mysql its just a regular table with no constraints and if you fuck yourself then you're fucked.
>>
File: 1435027672988.png (67 KB, 350x338) Image search: [Google]
1435027672988.png
67 KB, 350x338
I didn't have photoshop, so I designed my business cards in HTML as a physical example of my work
mfw this great idea was wasted because my clients don't understand it
>>
test
>>
So I was wondering about omitting tags in HTML, mainly the html tag.
Basically I know that you can't omit the html tag if you want the comment after the html tag, but I was wondering what difference it made. Is it just that the DOM is slightly different?
For example, I want to write my code like this:
<!doctype html>
<!-- A comment -->
<meta charset="utf-8">

I mostly was just wondering if anyone would care where the comment would be, unless they were making conditional comments. I just wanted to place information about the page in there.
>>
>>51255416
Looking at Mozilla's home page, they seem to put their comment after the charset declaration, so is this because of the way some browsers work and may not end up parsing it as UTF-8?
>>
>>51255105
Well, part of design is about your audience.
>>
Why doesn't this work?

https://jsbin.com/cojanijaxu/edit?html,output

It's a simple drop down in php, supposedly something is wrong on Line 8, but I can't see it

<?php
function getStates()
{
$states = array('Alabama' => 'AL', 'Alaska' => 'AL');
$options='';
while(list($k,$v)=each($countries))
{
$options.='<option value="'.$v.'">'.$k.'</option>
}

return $options;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>JS Bin</title>
</head>
<body>

<select>
<?php echo function getStates(); ?>
</select>





</body>
</html>
>>
Reminder that the best Ember.js book, ember-101, is now free.

https://leanpub.com/ember-cli-101
>>
>>51256888
Use an editor with syntax highlighting.
</option> is not properly closed.
>>
>>51242573
why do people use ruby on rails for web development over PHP?

>Honest question that I'd like your guys opinion on
>>
>>51256888
You forgot to finish line 8. Add '; to the end...
Get a real editor, you should be able to spot an error like that instantly.
>>
>>51257184
Because php is a crappy language and has tons of shit code written by shit programmers and only has 1 good framework (which is incidentally just a copycat of rails).
>>
>>51257218
then why is it used by Google, Facebook etc?
>>
>>51257218
neet detected...
>>51257184
Rails brought MVC to the internets
>>
>>51257223
Bad programmers and legacy upkeep
>>
>>51257223
Since when does Google use php?
Facebook was initially written by shitterberg in php because that's all he knew. Remember when they leaked their source code? lel thanks php.
Facebook have since then spent quite a lot making their own hacked version just to make it usable instead of switching to a better language for a reason only god knows...
>>
>>51257363
Nice explanation. It cleared all my doubts on to why Facebook would stick to XHP for the frontend of the website.
10/10 response.
>>
>>51249029

I wrote a Flask app for my office and used SQLAlchemy and it's amazingly useful. I struggled to wrap my head around it for a while but after lots of reading and trying it finally clicked. So don't lose hope, it is a relatively complex piece of software but WAY better (and safer) than working with plain SQL.

I have heard PeeWee ORM might be a little easier to get started with though. So maybe take a look at that.
>>
https://www.google.com/design/spec/material-design/introduction.html#introduction-principles

>A material metaphor is the unifying theory of a rationalized space and a system of motion. The material is grounded in tactile reality, inspired by the study of paper and ink, yet technologically advanced and open to imagination and magic.
>Surfaces and edges of the material provide visual cues that are grounded in reality. The use of familiar tactile attributes helps users quickly understand affordances. Yet the flexibility of the material creates new affordances that supercede those in the physical world, without breaking the rules of physics.
>The fundamentals of light, surface, and movement are key to conveying how objects move, interact, and exist in space and in relation to each other. Realistic lighting shows seams, divides space, and indicates moving parts.

What happened to Google these past few years?
>>
good guides on react?
>>
>>51257976
material design = skeuomorphism v2.0
>>
>>51242573
Please stop using mr robot pictures. Don't spread the cancer.
>>
File: 1445452884485.png (139 KB, 400x398) Image search: [Google]
1445452884485.png
139 KB, 400x398
>>51259034
>cancer
>>
does anyone have experience with writing mocha + chai tests?

describe("some func", function(){
it("Should do something", function(done){
setTimeout(function() {
done();
}, 3000);
});
});


this results in

  1) some func Should do something:
Error: timeout of 2000ms exceeded. Ensure the done() callback is being called in this test.


but done is being called.. I don't see the problem here...
>>
>>51259635
>3000
>timeout of 2000ms exceeded

You aren't calling done within the timeout. decrease the time of setTimeout to under 2000, or find some configuration that increases the timeout to above 3000
>>
>>51259748
That's not how it works, it means that if something takes longer that 2000 ms then you need to call done() that's why it says "Ensure the done() callback is being called in this test."
>>
File: lol_wut.jpg (48 KB, 533x594) Image search: [Google]
lol_wut.jpg
48 KB, 533x594
>>51260117
I am not sure if I have a response for you.

Just... just fucking try it anon. Either do this:
it("Should do something", function(done){
setTimeout(function() {
done();
}, 1500);
});

or this:
code]
it("Should do something", function(done){
this.timeout(4000);
setTimeout(function() {
done();
}, 4000);
});


>it means that if something takes longer that 2000 ms then you need to call done() that's why it says "Ensure the done() callback is being called in this test."
No... that's not what that means. Done needs to be used in asynchronous calls, not "when it takes longer than 2000 ms" The timeout is so that it just doesn't sit there waiting forever
>>
>>51260205
Shit, how did I mess that second one up:

it("Should do something", function(done){
this.timeout(4000);
setTimeout(function() {
done();
}, 3000);
});
>>
File: 1409335298751.png (179 KB, 366x392) Image search: [Google]
1409335298751.png
179 KB, 366x392
>>51260205
well that works.

>Done needs to be used in asynchronous calls, not "when it takes longer than 2000 ms" The timeout is so that it just doesn't sit there waiting forever
Everyone was telling me otherwise.
>>
>>51249601
I approve of your message.

Frankly, if you want to do Java-style OOP for a new project, why not actually use Java? It is almost as easy to deploy on a VPS and there are quality frameworks for it like Dropwizard. It's verbose, sure, but so is OOP PHP. At least with Java you get static typing and IDEs that generate the boilerplate for you.
>>
>>51250691
Not dumb at all in some use cases. For long-running applications it saves your clients web traffic.

>>51250998
Quality SV startup care about how their web applications work on mobile, add mobile means slower connections and limited memory. They don't use huge JS blobs on regular pages.

>>51251151
Applications written "without a framework", unless the developers are true experts, end up reimplementing Backbone, badly. It's usually a false understanding of "blast" that takes people down that road instead of using a minimal, standard framework.
>>
>>51254823
SQLite is dead serious. It was developed for the Navy, after all.
>>
v
>>
gais pls help

I've got a VPS with 1gb of ram

mysql runs out of memory and shuts down once a day

how do I fix? looks like there's already some swap allocated

I'm not a server guy but I know my way around in the terminal, any pointers appreciated
>>
>>51261831
>mysql
Found your problem!
>>
>>51261942
lowered innodb's buffer pool and I think it's stabilised, will check it tomorrow

just to trigger you some more, it's a wordpress site too so lots of php goodness :^)
>>
>>51262008
>Wordpress needs more than 1gb ram
[laughs]
>>
>>51262034
I've got a feeling it's just me not knowing what I'm doing

people host wordpress sites on the cheapest shared hosting you can imagine, with the only difference being that hosting companies know how to tune their servers for wordpress and I don't
>>
>be a decent C# dev
>write my own backend software
>more serves a second than node.js
>always uses less than 50mb (and I actually tried to trade ram usage for speed)
>affords me all the awesome .net libraries
>backend code is literally cleaner, neater, prettier than the front end code
>that awkward feeling when people are still using PHP
Why do this? What exactly do you get with PHP that any other language doesn't get you?

Is it the backend code being within the same files as the front end code? Because that's really messy, better devs have different files for JavaScript, CSS and html nowadays.
>>
>>51262082
just use the wordpress supercache plugin with mod rewrite.
>>
>>51262683
What are these guys doing wrong?
https://www.techempower.com/benchmarks/#section=data-r8&hw=i7&test=query
>>
>>51262706
Not him, but supercache isn't really an option if you want to run ads on your website.
>>
>>51262798
At least, if you rotate ads.
>>
>>51262798
why? render them via javascript.
>>
>>51262828
also, you might want to try hhvm for php to see if this improves the speed/memory usage without caching.


but generally speaking, wordpress is just bad. It uses way too many DB queries (I think 50-80 per page).
>>
>>51262828
Good idea. I didn't even think of that.
>>
>>51262782
I've seen that benchmark before, I have a little trouble believing it because it rates PHP (php-raw) so high. Sometimes people benchmark strangely and then present bad results. Maybe I've got it all wrong and PHP executes with some magic JIT that magically makes it as fast as Java.

I benchmark by simply sending a 200, no DB included or anything. I can open and close a connection in under 400ns like this (about 8000 serves a second, although I've seen it as high as 13000 serves a second), node.js does it in 1ms (about 2000 serves a second) and python, asp, etc does it in double digit milliseconds, about 20 or 30. 20ms doesn't seem like much, but it absolutely does take a toll on how many people you can serve within a second.

Again, I've seen that benchmark and I'm sceptical as fuck.

In case anyone is interested, I decided to completely FOSS my library (soon!) because I realised how awkward proprietary .dll files are. Telerik are crazy.
>>
>>51262936
They use php-fpm and Nginx on their tests.
>>
>>51262683
>be a decent C# dev
>write my own backend software
>more serves a second than node.js
>always uses less than 50mb (and I actually tried to trade ram usage for speed)
>affords me all the awesome .net libraries
>backend code is literally cleaner, neater, prettier than the front end code
>that awkward feeling when people are still using PHP
>C# is tailored to Windows
>99% of webservers use linux
>>
>>51263123
The early 00s called, etc.

Works perfectly with mono.
>>
>>51262936
Waiting on this. I use C# at work but I don't want all the ASP.NET MVC ecosystem, I want something simpler.
>>
File: images.duckduckgo.com(7).jpg (27 KB, 400x300) Image search: [Google]
images.duckduckgo.com(7).jpg
27 KB, 400x300
>>51244778
Glad I'm not the only one who thinks its gross.
>>
>>51251810
> changing core syntax every major version
> "real deal"

gtfo
>>
Does anyone have experience with Bootstrap?

How do you integrate your knowledge of Bootstrap with having to work with very different designs?

So, let's say you get all sorts of PSD designs. Some have the navbar on top right, some on top left, some have it under another top section. Headers sizes might also variate a lot both in terms of horizontal placement as well as vertical placement, both on desktop and mobile.

The problem is, Bootstrap, out of the box only provides very generic styling, so you will still have to apply a lot of extra CSS to get the design you're supposed to.

So, how does Bootstrap make the development process superfast, as some people claim? You still have to do a lot of work to actually customise all the page elements to fit the design.

Maybe I'm missing something here, but I'm trying to develop a faster method of building a site based on a PSD design. At the moment it's taking me about 3-4 days up to a week to get it 100% similar. I think it's too slow, so I'm wonder if I can use more of the default Bootstrap classes (only used the container and grid system until now).
>>
>>51263941
*I'm wondering
>>
>>51263941
CSS rules can be overwritten, no? you can do that with bootstrap, too
>>
File: IMG_20140826_172159.jpg (751 KB, 1920x1080) Image search: [Google]
IMG_20140826_172159.jpg
751 KB, 1920x1080
I'm quite new to webdev;

I want to make a webgame. It will be based on "Keep talking and nobody explodes". So I will have animations, random puzzles etc. No physics or complicated moving objects.

What would suit best for this? I know html css and a little bit of js. Do I just use pure js for example? Or are their tools that help me do this?

Thanks:)
>>
>>51264018
Yeah, obviously, but then what's the point of using Bootstrap, if you still have to write extra styling for its classes?

How does it speed up development, besides providing very basic stuff like a grid system or very generic button sets and navbars?
>>
>>51264037
By providing a grid system and button sets and navbars. It isn't there to build a website for you, it is there to give you a solid foundation.
>>
>>51244184
Sass + Jade - no brackets and semicolons, what can be better than this/
>>
how much time would it take you to develop this website from scratch?
http://nask.co
>>
>>51260564
Backbone is hardly a framework, more of a library. That said, you can easily plug it into your client, just for the Model and Collection classes.
>>51264171
3 days - 2 weeks
>>
>>51264447
>3 days - 2 weeks
including backend and everything else?
>>
>>51264629
Yes.
>>
>>51264642
it took me 2 months ;_;
>>
>>51244199
No. Atom works better for me.
>>
>>51263941
Are you using the bootstrap LESS/SASS files?
>>51264025
Check Phaser
>>
Hey guys I have a strange problem.
I needed to make a loader for page so when it finishes loading it removes loader animation and shows the page and thats ok except the google map which is on the page doesnt get loaded. The frame is there , but map itself is blank.
Now hear this , when I zoom in/out page the map instantly appears?!!
What a hell do I do to make this load properly?
>>
>>51264954
I did check phaser, but I don't know if I want to do that. I don't know if I want to use a framework like that for my first real project. Thing is, I still need to learn javascript, so for someone who already knows js for example, those option would make sense. For me, because all is new, I feel like I would get confused.

You feel me senpai?
>>
>>51260469
>But anon, that is obviously INSANE! Setting up a Java server might take like 10 minutes more because I've never done that before! PHP is easier to set up, so that's OBVIOUSLY why you should use it! Of course, those 10 minutes are more important than the hundreds of hours you'll spend fixing bugs that wouldn't even exist if you were using a different language!

...Is what PHP defenders would answer to that.
>>
>>51264954
>Are you using the bootstrap LESS/SASS files?
No I'm using the barebones Bootstrap, what's the advantage?
>>
>>51243647

Meteor.com. you can even deploy it on a meteor domain for free.
>>
>>51264171
anyone else?
>>
>>51265579
>MongoDB
>>
>>51253852
Well you might be fucked then, making a webshop without any backend knowledge is stupid.
>>
>>51265674
Thats what I hate about Meteor, let me use fucking postgres
>>
>>51257160
Ember times out every time I try to run it ;-;
>>
>>51265534
For example, you can customize the grid properties from the beginning, instead of overwritting them.
https://github.com/twbs/bootstrap/blob/master/less/variables.less
There's also Susy and other basic SASS libraries
http://susydocs.oddbird.net/en/latest/
>>51265526
He is such a troll, you had to spend 5 minutes replying to him :^)
>>
Do I have to do something to get SQLite working with XAMPP?
I have a CGI script that queries a database, and the database. It works on my computer but when I test it with XAMPP I get an error saying sqlite3.dll is missing.
>>
I'm trying to make a simple counter in Python that displays the session count every time the page is visited, but I keep getting a KeyError 'count'. Anyone mind helping this retard out?

I know that I can import collections but I want to try making it without importing it. Is there also something similar to .any? or != for Python if statements?


server.py
from flask import Flask, render_template, redirect, session

app = Flask(__name__)
app.secret_key = "mystery"

@app.route('/')
def index():
if session['count']:
session['count'] += 1
else:
session['count'] = 0
session['count'] += 1
return render_template('index.html')

app.run(debug=True)
>>
>>51243570
Indeed bro
>>
>>51266039
Don't you have to send the variable to the template as well?
>>
>>51265818
My problem is I'm looking for some way of controlling text and headers styles in a responsive way, without writing a ton of media queries for each viewport.

The Bootstrap grid is fine for this purpose, but I see no option to have Bootstrap handle text responsiveness across many devices. It's not so much just the font sizes, but also how every header or paragraph gets placed vertically to look the same on big variety of viewports. I don't have any idea how to do this without writing a huge number of media queries and just doing it manually, which sounds a bit too dumb, desu.

That's why I thought maybe Bootstrap has something to handle this problem of text resizing over lots of viewports and especially how they get positioned on the screen after resizing. Sometimes one header may have a good size responsively, but the whole content might fall short of the viewport height.

Is there anything that can handle this automatically, or do I have to write my own CSS framework to make sure I don't have to keep doing this manually on each project?
>>
>>51266099
I have {{session['count']}} in my index page. There's nothing else on it besides the bare-bones html markup.
>>
>>51266177
Yeah, but are sessions really global?

return render_template('index.html', session=session)
>>
>>51266211
Thanks a bunch anon. That didn't solve it directly but it definitely did 70% of the work.
>>
What framework do y'all use with Node?
>>
>>51267562
Express
>>
>>51265988
well you need to find it
we can all throw some money and put an ad on a milk carton
>>
>>51266151
Check Bootstrap 4 (beta) or Foundation
>>
>>51244306
DB2
>>
Finished up my manga reader and gave it proper metadata support. There's still only one series because I only have the one uploaded, though.

https://nonegiven.github.io/read
>>
>>51268732
Preload the next few images and get rid of the distracting loading indicator.
>>
if i'm doing this shit for living even after having an engineering degree, am i a failure as a person?
>>
>>51268732
Good job on the vanillaJS and... holy shit, you had the same idea! To store the images on dropbox!

A little tip to make it easier to create the links: If you use the Public folder, you'll have direct access to any file/folder you have there, with a more readable URL like this:

https://dl.dropboxusercontent.com/u/21135903/:manga/:chapter/:page.jpg

:manga and :chapter are folders.

With that URL you can have something like:
https://dl.dropboxusercontent.com/u/21135903/love-hina/1/1.jpg

As you can see, that's much more readable and easier to create/manipulate.
>>
  $.ajax({
'url': message.action,
'data': parameterMap,
'cache': true,
'dataType': 'jsonp',
'jsonpCallback': 'cb',
'success': function(data, textStats, XMLHttpRequest) {
results = data;
}
});


How do I get the data out of this? when I console.log results from outside the AJAX call it's always empty. console.log(data) inside it produces correct log. I assume it's a thread thing?
>>
>>51269399
Maybe I'll make a pref.

>>51269576
It's not a really proper strategy because basic Dropbox accounts cut off access to uploads if they get to much traffic. Works fine for these purposes, too.

Thanks for the URL idea!
>>
>>51269731
>results = data;
So you're creating a local variable in the scope of your anonymous success function and expecting that to help you?
>>
>>51269790
since it isn't preceded by var it'd be declared outside the scope of the ajax call
>>
>>51269804
Only if you actually declared it, you chump.
>>
Guys what do I study for interviews for front end jobs? I thought it would Big O notations, recursion, data structure and algo problems but I haven't gotten any like that
>>
>>51269824
I did. it still doesn't work.
>>
>>51269848
You're not getting it. Your anonymous function gets its own scope which doesn't have any variables from other scopes, including the "results" you may have declare one line about the ajax() call.
>>
>>51269917
I think I get it then. I need to pull stuff from data so what do I do instead? the ajax code is something I got off yelp's api docs I don't really know how it works.
>>
what exactly do I need to know about CSS and HTML for jobs. don't people just google this shit when it comes up or use a template
>>
>>51270581
Eh, a basic understanding of HTML and the DOM is important for any kind of design you want to do. Knowing what has priority when and how to create responsive elements is important, even when using libraries like Bootstrap. Check out the Codecademy course on HTML
>>
>>51269967
You probably want to make a callback function so you can continue your process after you've got the data that you called asynchronously.

http://stackoverflow.com/questions/14754619/jquery-ajax-success-callback-function-definition
>>
>>51270740
thanks i'll check it out
>>
js
what's the value for an empty html tag (like <div></div>)
it's not "", null or undefined
>>
>>51270853
If you're using Jquery:
if ($('#element').is(':empty')){
//do something
}


if no jquery

 var isEmpty = document.getElementById('cartContent').innerHTML === "";
>>
>>51270783
Kind of what I want except I need to pass the data I produce out of the function. The code I'm writing should take some arguments like radius and location, download a json, process it into an array of objects with elements generated from the json then pass that array out.

I need to actually pass something back out of my function, what are my alternatives?
>>
>innerHTML === "";

not working :(
>>
you guys suck. Even /dpt/ is better than this shithole full of newbies

Go to college or kill yourselves
>>
>>51271003
Why spend four years at college for a comp sci degree when most tech firms don't even require the degrees anymore
>>
Just started learning web development and need a new laptop. Looking for something 14" with a 1080p screen and maybe Linux friendly. Strong enough to run a few VMs would be nice. Any suggestions? Here's a nice young lady for your time.
>>
>>51271063
college graduates has significantly more chance on getting the job.

Its not just coding/scripting, you also learn to socialize and other things
>>
>>51271114
># fucked the syntax

what im doing is

>click x, if #div is empty, do an ajax call and fill it with stuff
>click x again, if it is not empty (ie: ajax call has been done), remove its contents

it's just like a dropdown menu

so my logic is

 if (... div is empty) { // first time you click it, it's empty by default
... ajax and fill div with stuff ...
} else if (... div isn't empty) { // second time you click it, not empty anymore
... empty/hide div ...
}
>>
>>51271131
I CANT DO ANYTHING RIGHT
>>
What do you think will be the next big thing in webdev?
>>
>>51271215
Fast and functional vanilla Javascript and DOM API with no libraries on all browsers.
>>
File: blog2-1500x750.jpg (140 KB, 1500x750) Image search: [Google]
blog2-1500x750.jpg
140 KB, 1500x750
>Had an accident and spent a few weeks in the hospital
>Completely forgot what I was learning about JavaScript

Fuck me, and just when I was starting to grasp the fucking concept. back to page 1 I guess.
>>
why is react so good?? I just made my own comment system with ratings, sort, picture uploads and it actually was fun doing it.

also, it took me only 2 days to do it.
>>
So looking at using AngularJS for a large production app being released in march/april, is version 2 going to be done/stable by then? From what I've played around with it seems fairly complete and functional, but we're in the process of hiring a frontend dev that will be using it. I don't know if it's worth the effort of finding someone that is willing to learn v2 or just write it in v1 and port it later.
>>
>>51242573
isnt that the homo from My so called life?
>>
>>51269731
>>51270926
You're trying to use both a JSONP callback and a success handler, which makes no sense. Either set up "cb" to handle the JSONP response, or stop using JSONP and do a normal goddamn JSON.parse handler on your JSON response.

>>51270977
Then the element's not empty or you're looking at the wrong node.

You could also test if firstChild is null.
>>
>>51271131
If that's all you need, then skip the dumb DOM stuff and just make a variable that holds whether the thing has been clicked/used once (and is therefore empty of not).
>>
File: 1436598463279.png (34 KB, 172x166) Image search: [Google]
1436598463279.png
34 KB, 172x166
Drawfag that's new to web development. I'm taking class to learn adobe dreamweaver, and I'm not liking the css designer. It gives me more problems than it solves, I finish most of my homework by copypasting code from googling the internet. I would like to learn how to type up all my stuff, but the book I'm going off of only teaches the designer.

I'm looking into alternatives like muse and brackets and wanted your guy's thoughts on those programs. I've already experimented with muse and I'm not sure if I like it or not. I'd mess with brackets, but I'm planning on spending 7 hours of my time on learning how to do html and css through a thing on code academy.

I'm looking in the pastebin in the OP because my teacher has been dodgy on the whole "how do you find work as a web developer" thing. She's been working as one for the 20 years so I'm guessing she doesn't know what it's like to look for work currently, and is probably just working off of a client base she's built up since the 90's. So as it stands right the only thing I can make of a webpage is to use it as a portfolio for art.
>>
>>51275801
Ok
>>
>>51276761
Hi
>>
>>51272120
can you link to any sources you used to learn it? I'm about to start a small project just to learn reactjs, looks good
>>
>>51266039
try:
session['counter'] += 1
except KeyError:
session['counter'] = 1
>>
>>51277976
https://kat.cr/pluralsight-react-js-getting-started-tutorial-t10793422.html

I used this
>>
>>51273631
its gonna be hard to port it later because the changes are pretty drastic between 1 and 2
>>
>>51271446
sure is memecenter here
Thread replies: 255
Thread images: 24

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

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.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.