« first day (1639 days earlier)      last day (3312 days later) » 
01:00 - 18:0018:00 - 23:00

6:00 PM
Anyone else gets ~ls's output on running just l in bash?
 
> -bash: l: command not found
Also, took me like 10 seconds too long to realize my shell was in Prelude -_-
 
hmm, for some reason I get almost what ls gives, but better with l. weird.
@BenjaminGruenbaum os?
 
osx, but I can test on a fresh Arch box if you'd like or an ubuntu one
All just an ssh away
 
@AwalGarg It's often aliased to ls -l by default in a config file
 
Would be cool if you can do in Ubuntu :)
@copy it is not like ls -l, just a minute.
 
6:04 PM
Run alias to see what aliases you have
 
if directory contains a folder foo, and file bar, ls gives foo bar and l gives foo/ bar
alias l='ls -CF'
o_O
I don't remember defining one
 
Yeah, your distribution did that for you
 
hah! there are some more good ones :D
alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"'
nice
 
Shell scripts are beautiful
 
true <3
 
6:08 PM
@copy Shell scripts are like women.
They're small, beautiful things.
 
good analogy, difficult to understand too.
 
But when they start to bloat, or when you invoke their rage, may God have mercy upon thy soul.
 
but but... two shell scripts can live happily together!
 
How ugly is this:
return Promise.all(projects.map(project => {
			return new Promise((resolve, reject) => {
				fs.readFile('projects/' + project + '/project.json', {encoding: 'utf8'}, (error, project) => {
					if (error) {

					} else {
						resolve(JSON.parse(project));
					}
				});
			})
		}));
 
@AwalGarg Your point?
 
6:10 PM
dat formatting...
 
@NickDugger Promise.promisifyAll(fs)
 
promisifyAll?
I'm not using a promise lib
 
@NickDugger promisifyAll and Promise.map :P
Use a promise lib
 
I don't want to use bluebird lol
This is a personal project. I want to use the least ammount of other people's code as possible. Right now, the only thing that I'm using that isn't mine, is EJS, becuase I don't think my templating language is stable enough
 
@NickDugger Bluebird and babel are no brainers for pretty much every project.
 
6:14 PM
Babel, sure, but I don't see Bluebird as the necessity that you guys do.
 
@NickDugger It's superior to native...
Also your promises, by default, come from Babel
So they aren't even native
 
That's only if you include their promise polyfill, which I don't
 
You do by default if it's node/iojs.
 
I'm like 83% sure that's not true
 
> All subsequent files required by node with the extensions .es6, .es, .jsx and .js will be transformed by Babel. The polyfill is also automatically required.
 
6:24 PM
Run console(Promise) and see what it prints
 
I'm not requiring babel in that fashion
 
I'm using gulp-babel, and when I look at the generated code, it has nothing to do with Promises
I'm pretty sure that it's not touching the promises
 
People fixing their OS to work with my emulator: jira.reactos.org/browse/CORE-8803
 
6:31 PM
hi, I am new to jquery/javascript and am stuck. I have n words and I have to change color of the clicked word only. Coloring the clicked word is easy but I don't know how to uncolor the last clicked word. Help!
 
@thePetProjectProgrammer 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.
 
@NickDugger What theme do you use??
 
Monokai Dark Soda
 
In my computer, that font looks like it hasnt anti aliasing
 
let promisify = function(fn) {
    return (...args) => new Promise((resolve, reject) => fn(...args, (err, value) => {
        if (err) { return reject(err); }
        return resolve(value);
    });
};
 
6:36 PM
Now look at you
 
let promisify = function(fn) {
    return (...args) => new Promise((resolve, reject) => fn(...args, (err, value) => err ? reject(err) : resolve(value)));
}
@BenjaminGruenbaum Even more concisely :P
@NickDugger the above is a pretty close implementation of Bluebird's promisify
let fileReadAsync = promisify(fs.fileRead);
Then
 
Need a try/catch
 
m59
I'm quite new to react. What's the equivalent of an attribute directive from Angular or a decorator from Ractive?
 
return Promise.all(projects.map(project => readFileAsync('projects/' + project + '/project.json', {encoding: 'utf8'}).then(JSON.parse)));
@BenjaminGruenbaum Right, in case fn() throws
let promisify = function(fn) {
    return (...args) => new Promise((resolve, reject) => {
        try {
            return fn(...args, (err, value) => err ? reject(err) : resolve(value))
        } catch (e) {
            return reject(e);
        }
    });
};
 
Hey guys
I have this code:
$(window).on("hashchange", function() {
	var hash = window.location.hash;
	hash = hash.replace("#", "");
	alert(hash);

	if(window.location.hash != "") {

	}
});
I want to hide all elements with the id other than the specified id value in the hash variable
 
6:50 PM
If you have more than one element with the same ID, your HTML is invalid
oh wait
I see what you want
just do $("div").hide(); $("#" + hash).show();
 
Thanks buddy.
I figured it, but thanks anyway.
 
I'm not your buddy, pal
 
hello people
I have a group of 5 number input fields
I need to allow the user to set a max of 100 across all the fields
I'm using angularJS
and I'm failing
 
On change, sum up all of the values
 
yes the sum isn't the issue I'm using a foreach tio add them all up
 
6:56 PM
$(window).on("hashchange", function() {
	var hash = window.location.hash;
	hash = hash.replace("#", "");

	if(window.location.hash != "" && window.location.hash != "all") {
		$(".work").hide();
		$("#" + hash).show();
	}

	if(window.location.hash == "all") {
		$(".work").hide();
		$(".work").show();
	}
});
 
my issue is when they hit 100 I need to not allow any more
then i also need the users to be able to deduct the amount
 
Guys, I was trying to display all elements with .work class when the hash is equal to 'all'
 
like I said, detect on change, and maybe on keyup
 
But it doesn't after all elements are hidden
 
Use oninput
 
6:57 PM
@HassanAlthaf why are you hiding everything and then showing everything immediately afterwards? Redundant
 
No, it is a portfolio work display
 
@copy I think theres a browser support issue
 
It depends on the user.
 
I have Angular watching my view so no worries about capturing the input value change
 
6:58 PM
@HassanAlthaf this code makes me wanna cry.
 
@HassanAlthaf $(".work").hide();
$(".work").show();
make no sense
 
@NickDugger Only if you care
 
just show them
 
Yup just show doesnt work
So I tried that
 
you aren't listening
I have things to do
 
6:59 PM
:/
I got my hash to "#design" which should hide all elements because there is nothing.
But when I make my hash "#all" it doesn't show anything back with the .show() method.
 
I may or may not just have had a heart attack: I was just done having a shower, as always got my towel to dry myself a bit, used it to cover my genitals as I was getting from the shower to my room (that's about 15 meters), put my pajamas really quickly and got the towel back to the toilet. I know that's really not what you want to hear, but here comes the interesting part: as I was putting the towel on the towel-handler (?), I saw something crawling up the side of it. One. Leg. At. A. Time.
the first thing I did was obviously throwing the towel onto one corner of the toilet...
 
spider?
KILL IT
 
then the thing came out: it was about a 3*4 cm spider with some pretty petrifying hair
now it's somewhere under the washing machine
 
kill it right this instance
We do not let spiders live.
ever.
 
I can't believe I covered my genitals with a spider
I hope the spider hopped on after that
 
7:06 PM
When I was a camp counselor, people would get upset that I would kill spiders outdoors, but I don't care who lives where; if you're a spider, you die.
 
Thats just too harsh. :/
Insects have the right to live.
 
Nope
Disgusting little things
death to all
 
Wow..
 
I just threw the spider out of the window with a sheet of paper, hoping it won't come back
 
m59
Does attaching 1000 event listeners perform worse than attaching 1 event listener that fires 1000 functions?
 
7:16 PM
@m59 very likely
everytime an event listener fires an event object needs to be created, that's the way I see it
and they're pretty heavy objects I think
 
m59
ah, true.
 
@towc Every time a function is called, a separate scope object with context is also created. They are also pretty heavy.
But I don't know which one is heavier.
 
@AwalGarg the functions would still need to be called
 
Yes but their scopes will be separate, right?
 
@AwalGarg would that make a difference?
 
m59
7:20 PM
I'm making a jsperf
 
good idea
oh well, going to watch the leaked eps of GoT finally
 
I am not quite sure but what I see in developer tools when working with lots of closures, I think yes.
 
I don't know much about it, I could be wrong...
 
I know the least..
 
m59
hmm, just occurred to me that I don't know how to write a perf for this.
 
7:23 PM
@m59 create elements, create functions, assign?
 
m59
need to trigger window resize
 
dispatchEvent?
why just resize?
 
omg love it so much
 
m59
the queue seems to be far faster than multiple events
 
7:49 PM
@m59 the latter is better
First rule of js in the browser: the DOM is slow.
And when I say slow, I mean 50 event listeners crash IE8
YMMV
 
Can someone just redo the DOM already?
 
m59
lol
 
AFAIK, React also uses a queue system for event listeners.
@FlorianMargaine second rule? ;P
 
!!wiki helicopter prison escapes
 
A helicopter prison escape is made when an inmate is taken from a prison by means of a helicopter. The helicopter's vertical lift is ideal for prison escapes because of the limited space to land and take off in prisons. This list includes prisoner escapes where a helicopter was used in an attempt to free prisoners from a place of internment, a prison or correctional facility. One of the earliest instances of using a helicopter to escape a prison was the escape of Joel David Kaplan, nicknamed "Man Fan", on August 19, 1971 from the Santa Martha Acatitla in Mexico. Kaplan was a New York businessman...
 
7:58 PM
@SomeGuy
 
8:09 PM
Hey guys,
How to use SlideUp to hide an img in a div without moving the div
It just moves from its place
I use this code:
$(".work img").on("mouseover", function() {
	$(this).fadeOut("slow");
});
 
oh wow people are still using jQuery?
 
Yup.
Cuz jQuery is easy to use.
 
@BenjaminGruenbaum I have forgotten jQuery API.. I haven't use it for 2 years now
 
@BenjaminGruenbaum baaah
 
8:24 PM
I answered like 4 questions while capped today.
I suck
 
Poor man
 
m59
@AwalGarg do you use React? I could use a buddy to talk things out with.
 
8:46 PM
Oh hi there
 
9:02 PM
Anyone with experience with Chocolate Chip UI?
 
9:24 PM
@HassanAlthaf some combination of .animate + visibility: hidden
 
9:48 PM
I'm writing a canonical dup on vanilla DOM manipulation. There are like a million questions on looping thru a NodeList, which should I link to? Also, the others should be closed as dups.
 
@Zirak Your mom told me to remind you to bring home milk
Classy lady. Always lookin' out for others.
 
m59
10:03 PM
hmmm... React seems to have some bad global like things.
mixins: [foo, bar] <-- bar can wreck foo, can't it?
var foo = {
  importantThing: // etc
}
var bar = {
  importantThing: // screw you, foo
}
Yep. It will throw an error if you try to use both mixins.
wow this is awful.
 
@Loktar Do you know of a way to attach an event listener to a set of elements without using a loop?
 
10:18 PM
@monners delegation brah
 
@phenomnomnominal are you with @monners right now?
 
@phenomnomnominal Attach to parent and test target on event?
 
in his bed et al?
 
@FlorianMargaine Don't be jealous
 
I mean, you're both in the same country, you guys must be like 5 minutes away from each other
 
10:19 PM
I'm home now :(
 
@FlorianMargaine That's not how Australia works
 
You underestimate how big Australia is though.
 
@copy ... that's now how almost any country works.
@phenomnomnominal really? I thought it was smaller than my village, damn
 
It's only just bigger
 
You were in Australia again?
 
10:24 PM
Anyway, good night. And enjoy your lunch meal, @phenomnomnominal
And @monners
 
@FlorianMargaine au revoire
 
@monners yeah but in Newcastle so it doesn't really count
 
Why?
 
Frank Turner concert, and my sister lives there
 
Ah. Makes sense. I've gotta go to Adelaide this weekend for a family thing myself. No other reason to go to a place like that though.
 
10:37 PM
Hi. Can someone please tell me why I'm getting an "Uncaught TypeError: undefined is not a function" on line 56? pastebin.com/Cp6A4bFv
 
@Grafics 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.
 
Is it somehow viable to check for a cached version of, say, jQuery from a list of CDNs?
 
01:00 - 18:0018:00 - 23:00

« first day (1639 days earlier)      last day (3312 days later) »