« first day (1746 days earlier)      last day (3197 days later) » 

9:00 PM
@php_purest You can look at something without putting your cursor on it... You need to learn design basics, because what you've created is a disaster
 
that's the hottest thing anyone's ever said to me
 
@php_purest I am making an app to make apps so I can make apps while I make apps.
 
@rlemon Which is also why I avoid writing a lot of javascript >.>
 
i know, but it aids in reading
 
9:00 PM
I want you to put your packets in my server
@php_purest No, it's distracting
 
@SterlingArcher Literally 8 hours late
 
Stop trying to justify it; it's terrible
 
@AwalGarg no, i won't be your QA for that
 
@php_purest listen Kevin, I'm trying to help but you're not listening to me and continuing to think that what you are producing is quality work. it is not, and you can improve, but you have to fucking listen to people who are telling you shit.
 
Does nobody else here watches the strain ?
 
user3119231
9:01 PM
@rlemon & others. If you use windows and have troubles with node.js - create a .bat(ch) file and isert this (edit the path to your ones where your javascript file is) start cmd /k node/Users/Maurice/Desktop/Webserver/server.js | Now you can start node.js stuff with one mouse click.
 
@JoshLeBlanc I don't even know what was going on 8 hours ago
 
@Abhishrek Does the strain I put in your mom count?
 
!!afk setting my horse on fire to put out the duck floods.
 
user3119231
BTW I'm not the only one who have the node.js issues
 
@Maurize I hated node on windows
get a linux VM
 
9:01 PM
Give up, lemon.
 
i believe it was jacob nielsen that said to put some sort of hover effect on items to help users read them
 
@rlemon If you ever get the urge to dive into ruby, try installing nokogiri on windows. It's a wonderful experience that will take up your entire week
 
@JoshLeBlanc FLagged.
 
He's from MN, I feel obliged to help him realize how terrible his work is
 
@php_purest Please be :(
 
user3119231
9:02 PM
@rlemon yeah, sucks. I mean how much time is wasted till I got this to run.
 
@Abhishrek Is it a white flag?
 
node on windows is literally hitler
 
@php_purest FUCKING STOP... Your work sucks, get over it, and we can move on to make it better
 
new whatif btw
 
@JoshLeBlanc i flagged your message
@OctavianDamiean sig TERM ?
 
9:03 PM
@Abhishrek no
 
why do hyperlinks have a hoverstate?
 
why that hatered for poor windows ?
 
user3119231
however for the ones who need to run node.js on windows I've pasted the .bat code already
 
today microsoft launches its new os
 
because it is shite
still shite
 
9:04 PM
@AwalGarg there is a computer shop here by the name "Microland", mean seriously Micro Land !
 
user3119231
@Abhishrek o/
 
ohh, yes, windows 10. I want that.
 
@Maurize \o
 
@php_purest you hover over links to click on them, you don't hover over text to read it; it's not the same thing... just stop
HAMMERTIME!
 
HAMMERTIME!
 
9:04 PM
yes, cap, I know
 
HAMMERTIME!
 
user3119231
"Download Windows 10" Icon armed and ready for take off.
 
i was told by some ppl at the nerdery it helped you read the text if you have hovers on them
 
@php_purest Well, then the Nerdery is wrong, because that's fucking dumb
 
Hey guys
 
9:07 PM
How about we move on?
 
they were QAs
 
Hello, picture of a cake.
 
@php_purest I've designed many websites, are you saying that my experience means nothing? Clearly you're better off on your own
 
@Nick Should I hover over an image too, so that I can see it better?
 
@rlemon can we autokick him now?
 
9:07 PM
@php_purest work with the google material design team. They are in need of more people like you.
 
@php_purest I'm like 78% sure Nick's actually a frontend guy who recently learned javascript. You could learn UI from him
 
@JoshLeBlanc If recently means a year and a half ago, then yes
 
what's javascript
 
I was a designer before then
 
That counts as recently, yet
At least, I learned JS 2 years ago and I consider it recently
 
9:09 PM
but you never stop learning
 
You don't. Especially when your employer has you working in a different language ever 3 months
 
 
does CSS count as a language
 
9:10 PM
I am recursively adding elements to a div. E.g.:

while(cond) {
     var obj = document.createElement("a")
     //stuff
    document.body.appendChild(obj)
}

I want to store the number/postion of each created element, but within the element, not using an array. obj.position = i doesnt work as it is updated to the last value at the end of the loop. Any ideas?
 
@JoshLeBlanc I think you mean a "different javascript framework every 10 minutes" :-p
 
i.e: All the .position 's are equal to 8, rather than 1,2,3,4, etc
 
@ʞɔᴉN Somewhat
 
@Deep are you sure? because most DOM setters cast value to string.
 
9:12 PM
The URL is hilarious on its own xD
 
my coworker just sent this to me and we're laughing so hard the office knows
 
What is Promise/A+? Baby don't defer me. Don't defer me. No more.
5
 
I think I might have oversimplified, actually. I want to call a function, with the object's positon as an argument. (I.e, the first A tag should do myFunc(1), the second should do myFunc(2) and so on)
 
:24733769 *defer
:p
 
9:14 PM
get educated
 
use php
 
kill yourself
 
Use PHP after you kill yourself.
 
either one.
 
are we doing word association here?
 
9:15 PM
what?
 
I used to get scolded when I joked and said, "kill yourself"
not fair
I want recompense
 
@Deep that's a famous problem in javascript. google "javascript closures in a loop"
 
alright, thanks :D
 
@Nick I'm special, in every way imaginable
 
@deep also, see developer.mozilla.org/en-US/docs/Web/Guide/HTML/… for attaching arbitrary data to elements
 
9:17 PM
@OctavianDamiean very hurtful
 
truth hurts, I know
 
Awesome, thank you!
 
PHP is awful. I seriously wanted to kill myself after trying to use it.
 
Why didn't you kill yourself then? Always do what you seriously want... :)
 
Make like Shia Lebeouf, and just do it
 
9:19 PM
Recent studies have shown that killing yourself has severe negative side effects in 100% of the cases. True story.
 
not all cases
 
I could totally impersonate @OctavianDamiean
 
@AwalGarg it would smell
 
Whoo got my first feature work at new job
#applesauce
 
so proud of you
 
9:23 PM
what's features work my precious?
 
it's when he gets featured on the front page of codepen
 
@OctavianDamiean Well, work on a new feature, instead of a bugfix
 
I get featured in crack whore magazine
 
I love that magazine.
 
9:25 PM
 
Back do' ho...
 
user3119231
"cannot find module socket.io" ? wtf installed it with cpm
 
Yea, I got that and the Meth Head Review.
 
LPTR: how do I ask the barista at a local coffee shop on a date?
 
@Shmiddty Wanna go on a date? No? Ok.
 
9:27 PM
don't ask her to go for coffee..
 
Bring her a kitten
 
and ask her to grind it up and run hot water over it
kitten tea.
 
@Shmiddty "Do you want any toppings Sir? Yes, I want you on top of meh babe! :smugface:"
 
@OctavianDamiean You're gonna be very lonely in later life
 
OP success
 
9:29 PM
coffee doesn't have toppings..
 
@Luggage clearly you are not drinking the right coffee
 
No, clearly I am.
 
luggage drinks pleb coffee
 
Real coffee, not melted coffee ice cream
 
does your coffee has a fancy long name?
 
9:31 PM
No. It's called coffee.
 
then you're not hipster enough ...
 
you're doing it wrong
 
latte's are so mainstream
 
*latté
You're a failure of a hipster.
 
@AwalGarg hah. I don't actually branch out with my javascript library knowledge very much. Dunno why
 
9:32 PM
I'm rolling my éyés at you.
 
What can I say? I like my accented characters.
 
I don't know why there are so many cringe albums on imgur but I'm snorting
 
haha
vagin, what is?
 
@CallumBarclay Vagina
 
user3119231
9:35 PM
where's da mistake?
 
user3119231
var http = require('http'), fs = require('fs');

var app = http.createServer(function (request, response){
    fs.readFile("client.html", 'utf-8', function (error, data) {
        response.writeHead(200, {'Content-Type': 'text/html'});
        response.write(data);
        response.end();
    });
}).listen(1337);
 
@JoshLeBlanc I know, 'tis a joke
 
oh :(
 
He said vagin a, what is vagin?
 
russian gin
 
9:36 PM
He'll never know
 
@JoshLeBlanc So vodka.
 
Kappa
Gin's really good
I didn't really like alcohol at all until I found gin
"This World is currently full"

Fuck off ffxiv, be less popular
 
@Maurize What's the error?
 
user3119231
 
That's not an error in the code provided
 
9:42 PM
It could be. response.write()
 
What's data?
 
1. What's in 'data'?
2. You aren't handling the error from fs.readFile. that might tell you why data isn't what you expect
 
user3119231
<!DOCTYPE html>
<html>
    <head>
        <script src="https://cdn.socket.io/socket.io-1.3.5.js"></script>
        <script type="text/javascript">
            var socketio = io.connect("127.0.0.1:1337");
			socketio.on("message_to_client", function(data) {
				document.getElementById("chatlog").innerHTML = ("<hr/>" +
					data['message'] + document.getElementById("chatlog").innerHTML);
			});

			function sendMessage(){
				var msg = document.getElementById("message_input").value;
				socketio.emit("message_to_server", { message : msg});
 
user3119231
this is client side
 
No, don't paste the file. We don't actually care what's in it. Let me rephrase
Is data a string that you expect or some other value?
I suspect it's null and 'error' tells you why
like file not found, etc
 
user3119231
9:45 PM
this is 1:1 from tutorial... lol
 
So? That doesn't mean that looking at your variables isn't still the first step in debugging.
 
user3119231
seems like a good tutorial. not. I will continue learning tomorrow
 
user3119231
thank you, anyway
 
omg, just fucking console.log(data) and console.log(error)
2
nevermind
don't ask for help if you ignore ALL questions people ask you
 
Top tip: ignore none, we can help if you answer :)
 
9:57 PM
hmm
there's a name I know somewhere... reactr.io
cc @SimonSarris
 
hehehe
> "Reactr is really a great thing. Probably the best thing ever. I know this because I spend most of my time in cafes or doing photography. Also, I wrote a book. So trust me when I say that I know things"
2
 
10:23 PM
thats amazing
 
user image
6
 
At least link to commitstrip
 
no
 
@FlorianMargaine isn't being tracked by @Feeds ?
 
Not in this room afaik
 
10:35 PM
So i have an event handler listening to a touch device (touchmove) and if the user clicks on the container, another div shows (previously hidden). However, if the user continues to touch the element and moves outside of the constraints, the div class starts flickering (hide and show)
would anyone reasons for why this happen?
 
@SophieRhodes you didn't use a toggle by any chance?
 
@phenomnomnominal yes i have
uh oh
 
So I'd say that is being fired on the touchmove?
 
So the toggle initiates when touchmove is active, when user lifts, then toggle if off
 
@rlemon every wondered why none of enterprise ever sent a distress call ?
 
10:48 PM
because Picard isn't a pussy
lol
 
maybe it is obvious but i don't see it atm, how mocha "it" function know that assertion in provided callback ends with true or false
 
@SophieRhodes I can probably help you more if you can make a JS fiddle or something that reproduces the problem
@Srle an error is thrown if the assertion fails, so the function just knows whether there was an error or not
 
ahhh so assertion libs throws an error on fail, it is logical :D
 
yep, normally that's how it works
 
11:08 PM
@rlemon not just picards none
 
good night
 
11:28 PM
anyone know what the best practice is when working with express.js and returning error codes (500/401). My middleware seems to throw an error with the status code, whereas sendStatus(401) seems to return no error, but a response with said status code.
 
You decide what YOU want to return. For example, if you have a REST API you may return a json block with the error details and a status of 4xx or 5xx depending on the error
or, if you have a more traditional web site, you may return an html page with the error
The key is to catch/handle errors so you can choose how to deal with them consistently.
proper behaving middleware shoudl pass the error up the chain to the error handling middleware, not return a result itself.
that's done by calling next(error) inside function(req, res, next) {}
 
I love Megadeath
 
@Luggage I'm not sure I understand. my exported modular functions never use next(). They send res.sendStatus() or whatever to return their callbacks.
am I doing it wrong?
 
depends. Do you want to construct an error response separately inside every single middleware that can have an error or do it once?
I highly suggest just passing an error to next() and then have a SINGLE middleware that knows how to send an error response. Then, later, when you decide to change it (and you will) you'll have only one place to do so.
 
so JWT is returning ian error when my request gets a callback with (error, response) but whin I use sendStatus(401) error is null, and response contains the error
I like the idea, just know very little about building middleware for this
 
11:38 PM
then do more than .sendStatus(). that only give a code.
 
nvm, I'm actually wrong
 
res.status(500) //set result code
    .send("blah blah blah");
 
but I do want to look into your middleware idea more
if you have a few minutes, would you mind the architectural discussion?
 
Sure. I'd start with expressjs.com/guide/error-handling.html but I can answer questions.
reading that is a lot faster than me typeing and it's a lot easier on me
That shows how to make an error handling middleware, among other things.
 
1 message moved to Trash can
@deltree Please don't post unformatted code - hit Ctrl+K before sending, and see the faq.
 
11:41 PM
this is the scaffolding I use to structure my codebase github.com/DaftMonk/generator-angular-fullstack which builds out the REST api on top of express.  An example method might look like
exports.index = function(req, res) {
  Thing.find(function (err, things) {
    if(err) { return handleError(res, err); }
    return res.status(200).json(things);
  });
};
 
Every time someone posts unformatted code an angel gets it's face punched.
well, handleError() is a good start. At least you aren't duplicating that code.
 
each REST method has it's own return methods
I think you're right about 401s though
 
exports.index = function(req, res, next) {
  Thing.find(function (err, things) {
    if(err) { return next(err); }
    return res.status(200).json(things);
  });
};
next is a function in express. call it without a value to say "i don't want to handle this, check with the next middleware)" and calling it with an error says "this broke, pass it to the next ERROR middleware"
 
next error middleware...I don't know what's next on my express stack...how would I know that?
 
but.. it does the same thing as handleError() mostly.. so.. it's just a restructuring..
all middleware is checked in order. you have things like bodyParser, i assume?
The order of your app.use()'s
 
11:46 PM
I see it now, it's deep in some config files
so I should put my error handlers into a module I can put in app.use and then never deal with errors in the modules that are outside of that scope
 
mostly. you still need to pass the error: next(err).
 
right, I get it
wait...
how does it know it's an error I'm passing? You said it intelligently uses the next "error middleware" for errors.
 
can I see your handleError()? use a paste site if it's really long
my code example above ^^
 
function handleError(res, err) {
  console.error(err);
  return res.sendStatus(500, err);
}
 
the docs don't show a second argument for .sendStatus() expressjs.com/api.html#res.sendStatus
try .status(500).send(err.message);
also, normal errors don't serialzie to JSON very well if that's what you want.
I got distracted with the middleware thing. I'm back on the error contents, now. :)
 
11:53 PM
the multiArg was a typo
 
Nope.
 
oh :/
I was j/w because I had the perfect gif to use if so
 

« first day (1746 days earlier)      last day (3197 days later) »