« first day (1556 days earlier)      last day (3395 days later) » 

9:02 PM
@BenjaminGruenbaum might be a stupid question, and to be frank I'm still not 100% on how promises work.. but can I emit an event prior to the promise being resolved/rejected?
 
@rlemon what do you mean emit an event? There used to be a progression API but it didn't work - usually you'd just make the function take a callback in addition to returning a promise that works fine - if you have a function that returns several times that's an observable (event emitter) and not a promise.
 
var foo = bar().then(function() { console.log('here') });
foo.on('something', function() { console.log('there') });

function bar() {
  return new Promise(function(resolve, reject) {
    if( something ) this.emit('something', 1)
    // some async resolve.
  });
}
this is what I was thinking about btw.
 
You can make a progress an event emitter but I'm wondering why. What does the event signify?
 
well I don't have a need for it right now, but I was curious. say for example my serial port listener. I would like to emit an event when data starts coming in
I can resolve when data is finished, but I have no way to pass back when it starts
(without some major re-thinking, or nasty stuff like passing into the function the document and making the updates there)
 
Take a callback in addition to returning a promise or use an observable instead of a promise
 
9:06 PM
so the callback approach is not breaking the idea of promises?
 
Use event emitter, it's very useful
 
@rlemon not really, no
 
ok, good to know
 
Also, there is observables, just like a promise is a timed value an observable is a timed iterable.
 
also, should I read the Promises/A+ spec? is it worth it? will I gain this amazing understanding of promises?
or is there a better resource out there
 
9:08 PM
I read it yesterday (implemented an actual library and needed to pass the tests), didn't learn anything.
I was impressed since the test suite is over 800 tests
 
lol
so.. don't read the test suit :P
 
I implemented a promise library in 69 LoC - was fun
Got bored without internet
 
AKA just let the NSA backdoor your code
 
hwat?
 
If I keep just A+ stuff (remove delay all and catch) it drops down to 60 LoC
 
9:09 PM
@BenjaminGruenbaum booze
 
I wanna do less
@rlemon no booze, was in class
 
I ordered my ingredients for my next batch of beer. should be here wed.
after that I'm gonna make some brandy
:) mmmm brandy
 
I just made a batch of Soylent that has alcohol in it. Solves all of your daily needs for surviving and getting drunk.
 
just need to find 10lbs of fruit for cheap
 
9:10 PM
^ promise library without internet
@KristopherIves that's actually pretty clever
@rlemon send me beer
 
Yeah but kinda messes with ur mind drinking something to both survive AND get drunk
AKA if you want to just survive without getting drunk, well, you're hosed
 
@BenjaminGruenbaum for the cost of sending it too you, you can brew your own
 
@rlemon yeah but that would be much much less cool
 
$150 (CAD) gets you started with a kit that will brew 18-22L
 
Terrorism
 
9:12 PM
then $40 for ingredients for each batch forward
 
Send a batch to me, I'll distribute it among all Europeans in this room
Still too expensive, probably
 
@copy it's not light
also, I'm not sure of the legalities of shipping home made alcohol
:?
 
Just bribe someone
 
this is what I have FYI, works really well
I was surprised
well Cap is telling me to not buy beer tonight and to not get drunk on hangouts
what a let down :(
 
9:21 PM
yea, I'm not listening
 
@rlemon nice
 
@BenjaminGruenbaum you should get on hangouts tonight
@BartekBanachewicz I was skeptical because I've never made beer before, but I followed the directions and it turned out to be a pretty good beer.
2.5 weeks and I had 18L of the good stuff
 
Actually I'm going out with some friends in about 20 minutes
 
I have two jquery ajax functions, one nested in the callback of the other, and I want to return them as promises so I can call them as a function and define the .done() callback for the second ajax call. Something like this pastebin.com/W4t2gz8Y
 
and I didn't have proper temp control during the second fermentation step. so it could have been better if I did
 
9:23 PM
@NathanJones put a "return" before the $.ajax that you have nested and use .then instead of .done
 
@BenjaminGruenbaum just out of curiousity, if i don't define a callback with .then, and I just call the function that returns those promise objects, will the ajax calls still be run?
 
@NathanJones yes, of course.
Promises use return values, if you call a function that returns a string but don't assign it anywhere - will the function still run?
 
How do you write tags here again?
 
<tag> or code: [tag:tag]
 
And what's the fancy tag for close vote please?
 
9:31 PM
cv-pls
 
15
Q: Chat Easy Input Tools - Provides keyboard shortcuts for common text formatting commands

rlemon About Provides keyboard shortcuts for common text formatting commands, reducing the dependency on mouse usage. Current version does not have a configurable set of hotkeys but later versions will. How to use. All of the following commands are run if the user has focus in the chat input area. ...

alt+t
 
haha, far shot here, but are there chat rooms for database stuff?
in particular CouchDb?
 
Yes, but you have to insert into for every line
 
it's related to JS, so you can ask here.
 
9:36 PM
[tag:tag] works but how is <tag> supposed to work?
 
it isn't
html isn't parsed in the chat
 
Ah ok
 
@Phil We (and other chat rooms) know stuff, just ask
 
okay haha
 
4 mins ago, by rlemon
it's related to JS, so you can ask here.
 
9:38 PM
you forgot the ol' @
 
did I need one?
 
to make the bing noise ;)
 
BING
 
I prefer to think of it as a google noise
badum-tsch
 
@rlemon What's this: insert_wrappers('*:', ':*', 'emote');
 
9:40 PM
:makes these:
 
I have a list function that isn't working at all. players/_design/players/_list/profile/all/ - that is the database URL (just testing for now).

This is my _design doc:
{
"_id": "_design/players",
"_rev": "48-ec76835601adc334ee481851e6174149",
"language": "javascript",
"views": {
"all": {
"map": "function(doc) {\n \tif(doc.type == \"player\") {\n\t\tvar id = doc.current_team;\n \t\temit(doc, { _id: id });\n \t}\n}"
}
},
"lists": {
"profile": "function(head, req) { start( { 'code': '200', 'headers': {'Content-Type': 'application/json'}} ); send('send');}"
 
just a shortcut I (as well as a couple other users) use
 
Don't see anything
 
:you don't see this?:
 
yet when I hit that URL I get {"error":"{bad_return_value,{<<\"list_error\">>,<<\"not a row 'ddoc'\">>}}","reason":"{gen_server,call,\
 
9:41 PM
Its just italic
 
with :: around it
nvm.
 
yes
 
just ignore it
codepen.io/natewiley/pen/jEmWYP @Loktar this is neat
code is nothing new, but the effect is neat
 
Very nice
 
9:48 PM
@Zirak @SomeKittens @anyoneelse Hangouts tonight?
 
Sorry, gotta wake up early tomorrow
 
@SterlingArcher you need to get in on one of these sometime
 
Tonight is all about me and the greek salad that I'm gonna throw together.
 
!!afk beer
@Zirak gotta have cereal?
 
gotta get down to the bus stop
 
9:51 PM
HAMMERTIME!
 
no one?
 
TOMORROW IS TUESDAY
 
Sittin in the front seat
 
*Kickin
 
My hand is a dolphin
 
9:52 PM
I will always remember that because of the JFK conspiracy
@NickDugger What a coincidence, my hand is retarded. Let's start a relationship.
 
@rlemon yeah that is cool
 
@Loktar did you see the news? node webkit is moving to "nw.js" and is using io.js instead of node
 
weird
nope didn't see that
 
the renaming is stupid, because they didn't maintain the old links. google is slow to update
so they renamed the repo, but google still points to node-webkit/
 
9:56 PM
bleh the io.js and node.js shit sucks imo :(
 
yea, the split isn't desirable, but io.js is (using new V8)
so I'm torn
 
monday sucks
 
^
 
@Loktar someone from the HTML room is making "Neon" css toolkit - here is a old preview
 
hard to believe that only 9 hours ago, I came up with an awesome idea and my coworkers loved it
 
9:57 PM
I think it will be boss for desktop apps in node-webkit
 
not a row 'ddoc'
 
looks interesting
 
what is this
WTF
 
I remember using something like that a few years back
 
is there paid training somewhere for CouchDb?
Pluralsight doesn't have anything on the topic
 
9:58 PM
@Loktar I think it looks really slick
it's like winforms controls for the browser, and styled nice
once he finishes I wanna web component it up
add the js that would be needed to make it all 'pop'
 
@rlemon Nothing that is "like winforms" can be "slick"
 
:P
ok, that is true
 
WPF can be made slick, with enough work
 
so can HTML
 
A while back I had this idea for a UI framework that would be really simple and flexible, but it's verbose :(
 
!!afk driving to my homestead
 
I guess simple && flexible && verbose === false
 
Uh, I ran into something today, haven't checked it but I wonder:
When you assign an undefined value to a variable, will it be undefined?
 
@Jonathan What do you mean "will it be undefined"?
 
10:07 PM
@Jonathan Yes as long as it was actually undefined, but it won't remove that key from an object.
 
It will have the value undefined
 
Do you mean it as in "When I equate it to undefined, the result is true"?
 
`var foo, bar = foo;
typeof foo`
 
Which is not the same as not defining a variable anywhere
 
Sounds insanely trivial to check
 
10:08 PM
response.valid = response.valid && true; ...why?
 
Uhm, bar
 
He asked for an answer
 
I ask for gold bricks
 
@SomeKittens If it's truish, it will result in true
Otherwise the falsish value
 
There is no point where response.valid is not a bool
 
10:09 PM
(which could be false, undefined, "", 0, etc.)
 
@SomeKittens You'd rather it be Boolean(response.valid)?
 
@Zirak This is a validation checker. That happens whenever the line given passes validation.
 
Crazy you, wanting to not throw away CPU cycles.
 
It just seems redundant to me, as response.valid is set to true at the beginning.
Is there any reason to use that pattern over setting response.valid to false if there are errors and not touching it otherwise?
 
Nope!
 
10:13 PM
oh good.
/me deletes lots of code.
 
I just got this error in my console on the Google homepage:
GET chrome-search://thumb2/http://my-website.nl/ net::ERR_FAILED
What is it trying to do?
 
Why is my keyboard so much quieter with the keycaps off?
 
@SomeKittens Presumable because you bottom them out as you type
Maybe don't type so hard, bro
 
If you're suggesting we should kill all but bi-sexual agnostic Asians, I find this very offensive
2
 
LOL
 
10:23 PM
@Jonathan Unless you're a sexually agnostic Asian. In which case, we should kill you too.
 
10:48 PM
Hi there! Any experience with Travis and it's API?
 
How do I make an Atheist in Haskell?
 
10:59 PM
hey guys, im trying to create consistent striped table rows but everytime i remove a row using ng-hide, angular does not respect the even/odd classes for the background color.
anyone have any advice on how to approach this issue?
 
@KristopherIves Because they're hidden, not removed
 
@KristopherIves i am but it seems that the table row is being hidden after css is applied
 
Try adding the psuedo-selector :visible ?
 
will that work in IE8?
 
11:04 PM
table tr:visible:nth-child(odd) {
If nth-child is supported :visible should be
I'm jut suggesting it as a CSS solution to what seems like more of a CSS bug
 
!!caniuse :visible
 
thanks, perhaps i should look into ngif
 
learn you an Angular
Speaking of learning the ng, @BenjaminGruenbaum halp!
 
@SomeKittens thanks a bunch!
 
11:11 PM
@KristopherIves I can't find anything about that selector, you have a link?
 
11:21 PM
  var answers = [];
  _.each(questions, function(question){
    Answer
    .findOne({question: question.id, user: req.params.id})
    .exec(function(err, answer){
      if(err) console.log(err);
      answers.push(answer);
    });
  });
  console.log(answers); // is empty because of the async db call
can anyone help me get access to 'answers'?
cant figure out how to do a async db call in a loop
 
@Jonathan My mistake the :visible selector is not availabe in CSS it's only provided by jQuery and some other libraries that describe special pseudo-selectors
 
Ah thought so
 
In Angular you may be able to do:
 
@TylerW Use something like github.com/caolan/async
 
not(.ng-hide):nth-child(odd) {
 
11:26 PM
@som
oops
@SomeKittens i was looking at that, but couldnt figure out which bit to use. do you know which method would be used for my problem?
 
@SomeKittens what do you think of using ng-if instead for my table striped rows?
The ngIf directive removes or recreates a portion of the DOM tree based on an {expression}. If the expression assigned to ngIf evaluates to a false value then the element is removed from the DOM
 
@TylerW .parallel
@redshift That won't help you here.
 
is there a way to use ng-if to remove the row from DOM if true, rather than false?
 
I just wrote a web app
 
I just opened a drink
 
11:31 PM
it's a chat app
 
It's a Monster energy drink
 
man of few words.
 
whats the best way of cloning a DOM element in angular? I have bunch of fields to fill out, and on "add" it would add empty copy below or above previous one? or just stick to jQuery?
 
ngif?
 
@redshift ng-if="!person.leader"
 
Sim
11:32 PM
does anyone know a good site to get free html5,css3 templates?
 
@rodling This is where Angular magicâ„¢ comes in
The add button should not interact with the DOM, rather it should add another entry to whatever array you're iterating over for the ng-repeat
 
@SomeKittens that worked perfect. Thanks, buddy!
i always over think these problems and it's usually the basic/simple solutions that i just needed
 
@SomeKittens hmm.. i totally didnt even think of that, it wasnt in ng-repeat. Thanks!
Hard to transition from jquery hackines to finesse of angular :(
 
3846
Q: "Thinking in AngularJS" if I have a jQuery background?

Mark RajcokSuppose I'm familiar with developing client-side applications in jQuery, but now I'd like to start using AngularJS. Can you describe the paradigm shift that is necessary? Here are a few questions that might help you frame an answer: How do I architect and design client-side web applications dif...

 
i read things like that, and so far.. no jquery in the code, except for $.map to to turn object into array. So im kinda proud haha. But ya occasional nudge in this chat def helps
 
lol.. nice, so no jquery now
 
jQuery is dumb.
 
jQuery isn't dumb. It isn't the hammers fault you used it as a toothpick
 
Nighty
 
11:54 PM
bootstrap is weird
 
which part?
 
@rlemon Getting my site to look like in the examples
for example, I have a h1 in jumbotron, but it's not centered
 
bootstrap is weird +1
 
@BartekBanachewicz why would it be? like centered text? or centered in the page?
 
Did they ever get rid of their straight up broken syntax that @fat was defending?
 
11:57 PM
did you wrap it in a .container ?
 
@rlemon yes
 
their js is atrociously styled
but it works well
@BartekBanachewicz can I see your markup?
 

« first day (1556 days earlier)      last day (3395 days later) »