« first day (1622 days earlier)      last day (3309 days later) » 

12:01 AM
@CSᵠ What do you mean by first level?
 
nothing much, just have a success there
 
@CSᵠ like echo json_encode("success");
 
echo '{success:true}';
 
12:21 AM
@whitehat101 hmm that gives an error haha SyntaxError: Unexpected token s
 
I forget, Strict JSON requires quoted object keys
echo '{"success":true}';
echo json_encode(array('success'=>true));
 
AWESOME THAT WORKED!!!
 
12:37 AM
i need help with JSON encoding / decoding :(
 
@jord49 Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
am i correct in thinking in order to get values from a javascript array, to update a mysql database i: convert the array to JSON, pass it to the php file, then update the database from there? (i need to use JSON not just PHP)
 
Morning Folks
 
 
3 hours later…
3:24 AM
How do I check if an element has a pseudo class? I know you can do something like querySelector(':invalid') but I'm not sure how you would do something like that on the current element.
 
3:44 AM
having trouble with some JSON. when I say console.log(output[0]), I get the following. And I cannot figure out how to get any of the attributes, like id or name.
Object {lordimrhial: Object}lordimrhial: Objectid: 22421317name: "Lord Imrhial"profileIconId: 517revisionDate: 1427334346000summonerLevel: 30
 
that's a bummer
 
@m59 thanks
 
crl
4:02 AM
@Jhawins even better version with ropes youtube.com/watch?v=EBEQmU-0bp8
 
btw, I had already committed the changes on svn and the changes are distributed to everyone. I am already badly popular to change an implemented code several times. So, I will take your suggestion and use in some other future project.
 
Is there a bluebird equivalent of Q's allSettled?
 
@SomeKittens Ah, I should have searched better. Thanks man :-)
 
5:17 AM
anyone used github oauth?
 
@argentum47 yep
 
can I have two homepage url's ?
like test.lvh.me/ , test.t.proxylocal.com
for one application
, or ; doesn't work.
 
No, just make two applications
 
:( , then that would be two keys. ok. np. I will manage :P
 
5:36 AM
Dahm it! I thought that I had come up with some great ideas for language features, turns out that most of them are already ES6 or ES7 proposals!
 
5:53 AM
I have a issue using backbone
nvm
 
that descalated quickly
 
6:08 AM
@argentum47, not sure if you still care about the oAuth stuff. But you may be able to add test.lvh.me as in your hosts file if test.t.proxylocal.com is just for local testing. IIRC oAuth callbacks are client side.
 
@Mr_Green found jhandu baam / moov ?
 
nah was making things complicated. found something simple
 
@BardiHarborow ow. ok will try that. thanks
@Mr_Green hi. whassap
 
@argentum47 hi
same working on backbone
browserify and gulp
 
nice. I have to learn to use gulp too. I have seen most react stuff using gulp.
I am having a css problem. my footer is not sticking to the bottom.
 
6:15 AM
huh? sticks to bottom for me? or am I not understanding?
 
umm, maybe you have a larger screen. try copying the whole <users></users> twice or thrice..
I mean large enough to make a vertical scrollbar appear
 
All the icons fit on my screen. The issue you may be having is that you screen is not as wide/hegh so you get a scroll bar, and when you scroll it leaves it floating in the air??
At least, that is what happens when I shrink my browser window.
 
Hey guys, perhaps one of you can find a hack to solve the following problem:
2
Q: JavaScript sets and value objects

Aadit M ShahI want to create a set of value objects in JavaScript. The problem is that in JavaScript equality is based on identity. Hence, two different objects with the same value will be treated as unequal: var objects = new Set; objects.add({ a: 1 }); objects.add({ a: 1 }); alert(objects.size)...

 
@BardiHarborow when you scroll does the footer stick to the bottom ?
 
nope.
@AaditMShah, solution coming in a min I think.
oh wait, misunderstood.
 
6:27 AM
that's is the problem. Inspite of bottom: 0; it goes up
 
maybe have a look at the bootstrap example footer sticky (doesn't require bootstrap though).
 
ok
the example getbootstrap.com/examples/sticky-footer makes me sad, why they don't have to left: 0; :(
ok, I added that left: 0; and its working, the main part was the bod{ margin-bottom: 60px; } thanks
 
6:52 AM
hi folks!!
 
hi folk
 
is there any way to access the html element without javascript?
 
yeah
the language of your backend must have xpath or alternatives, example nokogiri for rails
 
@AaditMShah you want deep matching ?
 
 
2 hours later…
8:52 AM
@darkyen00 No, relations with complex data types wouldn't be in the first normal form. Shallow matching will do.
 
9:08 AM
why aren't u using something like Immutables ?
or can { a: 1 } can come from two completely different sources
 
Seems like a weird idea to have two different objects that happen to have the same properties and values to be 'the same object'. They aren't the same.
 
@RoelvanUden if you're getting multiple JSON responses from a server somewhere, some of which describe the same data object, is it not reasonable to want to be able to have a Set containing them and not have the same object twice?
 
10:04 AM
why is this undefined in chrome, :
   range = document.createRange();
        var sel = window.getSelection();
        range.selectNodeContents(el);
selectNodeContents
 
10:35 AM
what is el ?
 
@SecondRikudo I want to generate ember data models from json api
 
"A clever person solves a problem. A wise person avoids it."
 
. nvm
 
I read it from quotes of albert einstein. :p
 
i used an other definition of "avoid"
preventing it would be more wise :p
hmmm
 
11:00 AM
This article is a list of articles that are themselves lists of articles that are also lists of articles on Wikipedia; i.e., the articles linked each index numerous lists on a topic. == General reference == Lists of academic journals Lists of important publications in science == Culture and the arts == === Literature === Lists of books Lists of 100 best books Lists of The New York Times Fiction Best Sellers Lists of The New York Times Non-Fiction Best Sellers Publishers Weekly lists of bestselling novels in the United States Lists of bookstores Lists of LGBT figures in fiction and my...
 
what did you have dug up ?
 
should I get my new mac from apple store or here: google.co.uk/…
save about 50 quid..
 
11:22 AM
Guys, I've got a simple problem I don't quite understand. I'm adding characters to either the start or end of a string using a function until a desired length is reached. On return I get a typeof String, but when the string is long enough that no characters need to be appended/prepended, I get a return typeof Object - why is this?
 
11:36 AM
How does react do that? return (<the html structure> ), without any " "
is that too a lexer of some form like jison
 
@argentum47 a compile step
@Dan make a fiddle illustrating the issue
 
compile step!!. I mean I havn't encountered such things before
 
@BenjaminGruenbaum jSFiddle isn't working. Here's the code;
String.prototype.padString = function( len, pad, onRight )
{
    var string = this,
    	pad = pad || "0",
    	onRight = onRight || false;

    while( string.length < len )
    	//work out which end of the string the padding should be applied
    	onRight ?
    		string = string += pad :
    		string = pad + string ;

    return string;
}

console.log( typeof "2".padString( 2 ) );
console.log( typeof "23".padString( 2 ) );
 
format ?
 
Yeah, I still don't get it! Why doesn't a backtick work?
 
11:46 AM
just Ctrl+A and Ctrl+K
 
Cheers
 
Why not string = onRight ? string + pad : pad + string;?
 
@poke Yes, that's OK, but still doesn't get around my return issue.
 
this is an object.
 
I was wondering why the concatenation returns a string, but no modification returns an object
 
11:55 AM
You should probably use var string = this.toString().
 
ah, rather than var string = this
 
String.prototype.test = function () { return this; }
console.log(typeof("asdf".test()));
 
@poke I didn't actually know that...
Well, I would have assumed it would be a string object, but that doesn't help me understand why the concatenation returns a typeof "string" not "object"
Oh, because this method is called on a string object in the first place...
 
@Dan just don't extend string.prototype
 
That’s because typeof(new String()) === 'object'
 
12:00 PM
@phenomnomnominal So if this was a regular function the return type would be a string anyway?
 
if you made it return a string and don't fuck around with this then yep
 
@phenomnomnominal Would you recommend one or the other? I thought the prototype implementation would be fine for this.
 
It's almost never a good idea
 
Strange I see this in many SO answers.
Maybe a function on my own Object instead.
 
Modifying built-in objects is always somewhat dangerous.
 
12:03 PM
Because this could wreak other plugins or something?
 
yes
var padString = function(string, options) {
    var options = options || {};
    var len = options.len || 0;
    var pad = options.pad || "0";
    var onRight = options.onRight || false;

    while(string.length < len) {
    	string = onRight ? string + pad : pad + string;
    }
    return string;
}
 
This this because of naming collisions or something?
 
And because you'll eventually forget you ever modified the prototype and somewhere in the future end up with inexplicable awkward bugs you can't figure out how or why etc ;-)
 
Ah, I see, another valid point.
Whilst learning jS I would like to do it all properly, so I'll leave the inbuilt object alone!
 
@Dan JSHint freeze option set to true would smack your face off for trying to modify built-in objects, so if you're not using it yet... ;-)
 
12:07 PM
hi
Does anybody know of a library/function to resize images inside a canvas with antialiasing?
 
@RoelvanUden I'll check it out. Thanks for the help guys.
 
@Azevedo FabricJS can do this, but I'm pretty sure AA is controlled by the browser.
 
@Ben: oh. thanks. I'll look into it. I think browser handle only <img> elements.
 
I have a strange problem in chrome and in opera... after sometime, I cannot edit delete type anything in the console. its like locked
 
argentu: I love Firefox!
 
12:20 PM
@argentum47 Happened to me
 
what did you do ?
 
killed it
 
ow. :P ok.
@Azevedo ok that's fine. but I am very accustomed to chrome and its console. pkilled it
 
Something that didn't change since the old days of Netscape 1 (maybe Mosaic) : browsers are still big bags of bugs. All of them.
 
12:41 PM
is twatter oneboxing broken again
 
Pair programming? Two times zero clue is still zero.
it doesn't like https:// for some reason
 
time for a meta bug report
 
Hello, can anyone suggest me a good node promise library
 
as Twitter force redirects to https now, it's not really useful anymore. Who really wants to delete that extra s from the protocol just to onebox it in here
 
12:44 PM
@black-perl iojs ;P
 
@black-perl have a look at github.com/petkaantonov/bluebird
 
@GNi33 Thanks
 
it was started by a then - regular of the room and is contributed to by regulars in here (or at least one)
 
@GNi33 Can you point which will be better Superagent ot request
?
 
so you can directly ask questions about it in here with a good chance of people knowing their stuff about it
 
12:45 PM
*or
 
@GNi33 Hey, I contributed a fix to a typo in the doc too !
 
I didn't check the commit/contributor history, I just know that Benji is on it on a regular basis, sorry ;)
 
0
Q: HTTPS Twitter links don't onebox in chat

Bartek BanachewiczThis is similar to this problem. Evidence. Not sure if the case of just Twitter or other sites too.

@GNi33 'xactly
 
we stumbled over this problem before
I think it's an issue with oneboxing in general
images and so on, let me check
 
https is for scrubs
 
12:48 PM
eeeh, whatever
 
facebook images do not onebox because of their shit urls
 
add #.jpg to onebox them
 
nope, that works
 
@rlemon should be on thispltlife
BRING THAT TUMBLR BACK :(
 
12:50 PM
I don't know anybody outside of work that programs, except for one friend (but I started programming first, so I tell him that java sucks)
 
@BartekBanachewicz it's on codinglove
only with PHP instead of JavaScript
 
^
[I] felt it suited js as well
 
if I were forced to write PHP profesionally I'd change careers
 
I'd still do it, if the money was right. I'm a sellout
 
I'd rather fix cars than PHP code
 
12:53 PM
I actually enjoy it
 
After fixing one of those you feel dirty with grease on your fingers, aching back and terrible memories. The other is a car.
 
@BartekBanachewicz how should one explain the grease?
 
php developers are greasy
 
@NickDugger I have a friend, but he does windev
 
@JanDvorak you don't wanna know
 
12:57 PM
so I've stopped talking to him
 
lol
also hi florian
 
I think I wasn't here for quite some time actually
sans occasional "JS sucks" hidden in my twitter urls
 
coldfusion is tops
 
JS payed for my house :D JS is awesome.
 
12:59 PM
@NickDugger tell that to @SterlingArcher
 
see the problem with me and programming is that I don't do it for money
well, didn't.
 
I do it for a career. I enjoy it, but money is important.
 
Most people don't, but the money is nice
 
maybe not the most important, but it is important.
 
I'm happy when I get to program, so there's that too
 
1:00 PM
strangely I give less fucks about code in my codebase at work than in the internet chat
 
How do ES6 classes work with Node's module pattern?
 
How do ES6 classes work?
 
@BenFortune export class Foo
or
export default class Foo { whatWhat() {} }
 
@NickDugger Thanks. Would I still use var module = require('module') or import * as module from 'module'
 
Oh wait... with Node's module pattern?
I derped
 
Yessir.
 
Not entirely sure if this would work, but you could try module.exports = class Foo
or just define your class, and at the bottom of the file, do module.exports = MyClass
The latter is what I do
 
I do the latter too.
Actually, does the import/export of ES6 tie in with node/iojs's modules?
Probably best I just try it actually instead of procrastinating.
 
1:21 PM
@BenFortune Not yet
 
Wonder if sublime has a linter for es6 yet
 
@BenFortune if you use babel, you can use es6 imports/exports
it'll translate to commonjs modules
 
@FlorianMargaine Can babel interpret at runtime or does it need to be compiled?
 
compiled
 
Looks like I finally have a reason to use grunt then :p
 
1:31 PM
a makefile is enough, but sure
 
Does it work with importing internal modules? fs etc
 
don't see why it wouldn't
it just translate import foo from bar to var foo = require(bar);
or something similar
 
Awesome
 
use gulp
smaller learning curve, faster to set up, faster, etc.
 
1:46 PM
WTF?! I just updated sublime, now I can't change languages
 
yay french forever
 
no "plain text" for ejs files is the worst
 
@FlorianMargaine fukin steam website
 
@rlemon sublime wants you to use jade
 
YOU SPEAK NORWEGIAN NOW
 
1:49 PM
@FlorianMargaine ew, I hate jade.
at least ejs feels natural in the context of HTML and js
 
yeah but sublime wants YOU to use jade!
 
Handlebars ftw
 
rebooted and it works
who knew turning it off and on again would actually fucking work?!
 
you rebooted the whole computer?
 
nahh, just sublime
 
1:51 PM
@FlorianMargaine you work with Vagrant on a regular basis, right?
 
but rebooting the pc would be fast anyways, Ubuntu + SSD === 4 second boot
 
@GNi33 yeah
 
how do you usually handle databases inside the vm?
 
hello. somebody used Modernizr before?
 
i mean, is vagrant halt the way to go to keep stuff intact when shutting down the vm?
or do I need to do something else?
@Vlad yes
 
1:53 PM
var options = {
    method: method,
    headers: {
        Authorization: `Client-ID ${this.options.clientId}`
    },
    json: true
};
I already love ES6
 
I need to detect whether it is an old browser. I am making a canvas game, so it will not work in lower than IE9 and probably other old browsers.
I also use HTML5 audio, I mean the game uses sounds.
 
detect canvas support
 
What things should I select in modernizr website?
 
Modernizr is feature detection, so, detect the features you need :P
(Or just sniff user agent to exclude old crap you know is a problem)
 
wondering how hard would it be to roll your own feature detection
 
1:56 PM
Also Safari doesnt play audio if there is not Quicktime installed on the client computer, so it would be good if know it is Safari 5
 
yeah... use modernizr
 
@JanDvorak it is hard, plus you can spoof that navigator thing
:)
 
@JanDvorak depends on the feature
 
I don't care about the user agent
 
@Vlad yeah, just use Modernizr and don't care about the actual browser
if the feature is there, use it
 
1:58 PM
@GNi33 canvas and web audio
 
Does anyone know of a good resource for learning BackboneJS?
 
if it isn't, provide a fallback or display a message stating that the user is browsing with a rock
 
@GNi33 vagrant halt is like doing poweroff in the machine
it's fine
 
ok
I love Vagrant so far, I need to dig deeper
 

« first day (1622 days earlier)      last day (3309 days later) »