« first day (1783 days earlier)      last day (3161 days later) » 

3:15 PM
Shouldn't this work? products.map(Products.findOne) (given products is a list of IDs)
 
@corvid depends.
it may not work, for the same reason [1, 2, 3].map(console.log) doesn't work
 
why does that not work?
 
find it out
 
!!>[1,2,3].map(console.log);
 
@corvid ["undefined","undefined","undefined"] Logged: 1,0,[1,2,3],2,1,[1,2,3],3,2,[1,2,3]
 
3:17 PM
@FlorianMargaine it works in node
console implementations should be standardized, IMO
 
@corvid Context
 
@SomeKittens around?
 
Context generally referring to this? If I use lodash's _.map and pass in a this, it should work?
 
express + passport, user sessions are stored on request.user, I have an array of values on there (request.user.notifications) and once it is complete I need to remove it from the session.
delete req.user.notifications[index];
doesn't achieve this
 
delete on array?
 
3:21 PM
@corvid map has a second parameter
but yes, chances are, products.map(Products.findOne, Products) will work
 
@SomeKittens I'm not sure I understood the article you linked. :(
 
@Zirak I have a new project idea
@Zirak something purely awesome
 
share with the rest of us.
 
hey please complete the package manager you are writing :(
I want to use it
 
@FlorianMargaine it fails different, but seems to be failing on the parameters being different
 
3:24 PM
@Luggage putting your secret gpg key on an usb key, and just plugging the usb key to login, or to unlock, or to mount your encrypted disk
 
@AwalGarg you can already use it
 
Anyone ideas on how to find out what's using that memory?
 
@FlorianMargaine make it stable
 
@AwalGarg the stuff we're adding now is just perf improvements
but it works and is stable
 
3:24 PM
@Cereal right click -> go to service/process?
 
@FlorianMargaine binaries?
 
@FlorianMargaine I'm surprised that doesn't exist
 
@AwalGarg build it yourself
 
that makes it either a really boring idea or brilliant
 
3:25 PM
@Cereal then it really is just system
 
Lame
 
@Luggage there are "smartcards" and the likes, but they usually cost an arm and a leg
 
My laptop no longer charges when plugged in. It's been sitting a 76% all week. Fan's been going nonstop, trying to figure out what's up
 
i assume you'd only be sticking your private key in known usb holes?
 
OOoo...
 
3:26 PM
@Luggage oh, didn't think about that.
but yes, of course
 
@AwalGarg why not? it should set the index to undefined.
 
@Luggage well, that said
 
and you'd need a good strong passphrase.
on that key
 
@Cereal does your fan try to figure out what's wrong?
 
@Luggage meh
 
3:27 PM
@rlemon I mean why not splice?
 
19
Q: Windows 10, 'System' process taking massive amounts of RAM

NayncoreSince I upgraded to Windows 10, my system has been consuming RAM excessively I've been reading a bit and determined it's likely a driver leaking memory. So I got myself the Windows Driver Kit and tracked memory usage with poolmon: However, I don't really know how to proceed from here. Is th...

 
I'd support it, of course, but the point is to be able to stick in a passwordless usb key and bim, the pc unlocks
 
@JanDvorak Yes
 
well, you imply a situation where physical security is a concern and then putting your key on an easy to copy/steal/hide usb stick
 
@AwalGarg that isn't the problem. the problem is the req.user doesn't hold the change on refresh.
 
3:28 PM
What the hell is superfetch
 
Weird...
 
these are notifications. I dismiss it, refresh the page, it is still there, log out and log in (new session) and they are gone
if I remove them from the session they persist.
it is fucked.
or I am fucking it up
 
> SuperFetch has two goals: it decreases boot time, and makes sure applications that you use the most load more efficiently. SuperFetch also takes timing into account, in that it will adapt itself to your usage patterns.
 
@Luggage ?
 
btw, shooting down ideas is like my thing.
 
3:29 PM
@Cereal That's not the correct answer, but it's some sort of memory management
 
@Luggage of course physical security is not a concern... password are easier than usb keys to steal/brute force
 
@FlorianMargaine I am too lazy to compile :-( also did you do any documentation yet?
 
I mean, why put your key on a USB stick if not worried about someone walking away with the drive?
and if they can walk away with the HD, they can take the usb stick even easier
and that might unlock other things
 
@AwalGarg there isn't much doc
 
I'm only trying to say "the usb key needs to be encrypted and secure, too"
 
3:30 PM
@rlemon You might need to call req.session.reload(fn)
 
@FlorianMargaine well I guess at userlevel most of the stuff will be quite intuitive since it is an fs?
 
@Luggage it's easy to keep an usb key in your pocket. It's not easy to bring your hdd back home every night.
@AwalGarg should be, yes
 
@BenFortune I don't need to call it when doing other changes. :/
 
@BenFortune Yeah I'm not going to disable it
 
@Luggage I'm not saying the gpg key shouldn't be password-protected, but it's not always necessary
 
3:31 PM
@BenFortune for instance, when I update the user profile I store in the db, but then I update the session
 
so a disgruntled co-worker copies the usb during the day, then waits for you to leave.
 
			Object.keys(updated).forEach(function(key) {
				req.user[key] = updated[key];
			});
 
@Luggage a disgruntled co-worker can steal your password quite easily.
 
@Luggage how did I manage to get my USB drive copied?
 
If they key needs to stay in the PC unattended while you go poop, it should be passphrase protected
 
3:32 PM
@Luggage no no no
 
if you take it out only briefly, maybe not
 
you only plug it in to authenticate
then you can remove it immediately
 
ok, gotch
ok, so very much like a smart card. just an authentication factor
Smart-USB
 
not a dongle
 
3:33 PM
without the need for a $50 thing
just a simple usb key that everyone already has
 
Would it make sense to have my phone as the authentication drive?
 
@JanDvorak why not
 
i think so.. except some phones no longer to usb mass storage and so that other thing
 
@rlemon Nuts, isn't it? The discussion on /r/programming was interesting too
 
@Luggage oh, that sucks
 
3:34 PM
@Luggage This, my phone can't do mass storage anymore and defaults to MTP
 
a phone would be aweseom because it could also ask you to put in a pin/etc ON THE PHONE
instead of a passphrase
 
Well it can, but I need root and xposed
 
@BenFortune MTP support could be added, eventually
 
My phone can mass storage its SD card
 
totally hate baby sitting
 
3:35 PM
but for now, if I can get a simple passwordless gpg key to authenticate when putting my key in, typing enter, putting the key out, I'll be perfectly happy =)
 
Am I right that the sim card is the best kind of physical token?
 
@JanDvorak why?
 
that's same as smart-card format, only smaller
 
I plan on writing a PAM module
 
Can't you do something with ADB and SSH/GPG? :P
 
3:37 PM
It's really hard to get your sim card accidentally left open to be copied
 
that will look for usb devices, if it exists, check if a specific file exists, if it does, sign a random string with it, and verify the signature with a pre-done mapping between public gpg keys and users
 
It's stuck in your phone and your phone is mostly stuck in your pocket
 
I'll have to quite heavily use cffi
@JanDvorak you can apply the same kind of protection with an usb key
 
You can do ADB over TCP, which is nice
 
@f people are more likely to be protective about their phones than their USB sticks, aren't they?
 
3:40 PM
i agree, phone is better, but not taking out a sim card
a phone is like your wallet anyway.
 
I mean, you could always
 
i think Florian's idea should be combined with that so the private key isn't as easy to steal
of course, as soon as it's lost you have the public key invalidated, but you want some time to let that happen
 
@Luggage well, you can't really do anything about that. That's why more advanced stuff like yubikey use protocols such as FIDO U2F
it's more of a "cheap" way, tbh
 
yea. as long as it's only one of multiple factors to authenticate, it doesn't need to be as impenetrable
 
I just don't want to spend $50 over a smart card/yubikey.
this way would still be far more secure than a password, anyway
and such a cool factor too :D
maybe I should write my own filesystem for the usb keys to not be automatically mounted
... but that's for later
 
3:47 PM
passport + express question again. why does deserializeUser get called repeatedly. ?
I have app.use(express.static( path.join(__dirname , 'public')));
before the passport crap as well
apparently that should have fixed it
 
@Cereal Looks amazing
@rlemon It should do it once per request, is it doing it more than that?
 
yes
 
Is it calling it per resource?
 
how do I tell?
I logged 130 deserializeUser calls in < 10 seconds
 
3:52 PM
@rlemon you should dig in the source to find out
log the stack trace
 
@rlemon Here now
 
Will arrow functions in _.each() cause weird iteration problems? I assume it's binding this to the outer score and messing up
 
(function foo () {
    try{console.log(new Error().stack)}catch(e){}
}());
Error
    at foo (<anonymous>:3:21)
    at <anonymous>:4:2
    at Object.InjectedScript._evaluateOn (<anonymous>:905:140)
    at Object.InjectedScript._evaluateAndWrap (<anonymous>:838:34)
    at Object.InjectedScript.evaluate (<anonymous>:694:21)
undefined
@rlemon to log the stack trace ^
 
@SomeKittens hav you experienced deserializeUser calling over and over again?
 
err, this is enough:
(function foo () {
    console.log(new Error().stack);
}());
 
3:54 PM
Yup, you've got your session above your static?
 
nope
app.use(cookieParser());
app.use(express.static( path.join(__dirname , 'public')));
app.use(session({
	secret: configs.sessionSecretKey
}));
app.use(passport.initialize());
app.use(passport.session());
if I'm not using Mongo how should my serializeUser and deserializeUser look?
 
Are you using the memory store?
 
because all examples I see use mongo
@BenFortune not tmk
 
the same, mostly. You are turning a user ID or other small value into a whole "user object"
 
@rlemon paste 'em?
 
3:56 PM
could be a postgres select * from user where id = x query
 
@rlemon Huh?
If you're not using a session store, I don't think you need serialize/deserialize. I think the default memory store handles it all
Could be wrong though
 
passport.serializeUser(function(user, done) {
    console.log('serialize user', user);
    done(null, user);
});
passport.deserializeUser(function(obj, done) {
    // I don't have a memory store for the users, I should. but this *should* work the same albeit slower.
    getDb(function(client) {
        client.queryAsync({
            text: queryString,
            values: [obj.id]
        }).then(function(results) {
            var user = mutateQueryResults(results); // just ignore this, it returns the proper user object. I can verify that.
 
er, serializeUser should return the id
or callback the id
whatever
 
since you are getting the data from a db, you could serialize just the id, not the whole user object
 
ok
but that isn't why deserialize is being called on repeat right?
 
4:00 PM
shoudln't be
 
could it be that every ws request it is deserializing the user?
 
@rlemon possibly
 
fuck, okay I have to run out for an hour. but I'll be back, and If someone could eli5 how serialize and deserialize user actually work I would appreciate it
I'm not sure my understanding is correct now.
!!afk back in an hour (1pm edt)
 
I need to think about something for js13k :/
 
"You need a new app to open localhost"
The fuck, windows
 
4:05 PM
@Cereal add the protocol
 
I'll proto-call your mother
 
is there a 'standard' for a json diff?
 
just the diff editor command output?
Or do you mean a diff in json format?
 
a diff of json, in json
 
4:12 PM
what's wrong with the standard plaintext diffs?
 
i want to be ablle to apply the patch the json that is the same, but possibly rendered diffferently (maybe a different property order)
but I'm just curious if there is any diff representation that's on a 'standards track'.
 
@Luggage I faced the same problem a while ago, didn't solve it yet. good reminder.
cc @uselesschein ^^
 
I made something cool: codepen.io/ndugger/details/YyPpMm -- to change the number of doodles to load, change the limit variable at the top in the editor. If you really feel brave, set it to doodles.length -- but that will probably break
 
@Luggage I don't know anything, just like I don't know much xml diff.
Googling for "semantic diff" might help you
 
having trouble doing real work, i guess i'll convert more coffee to es6.
 
4:27 PM
@FlorianMargaine hrm?
 
@Nick takes a shitload of time to load :P
 
@towc Yeah, it's loading all 2000+ doodles
 
We made Florian blow his idea load already. He's tired.
 
@Nick no, just 250 took me about 2 mins
the internet here is pretty shitty, but still :P
You could have them display as you download them and once it's finished you loop them as you're doing
 
Hey folks! Any Backbone aficionados in here? I'm trying to figure out how to listen for two specific events, and once both events have been heard once, fire off a callback. Something like

this.listenToOnce( Backbone, ['event1', 'event2'],  myCallback);
 
4:30 PM
@towc Nah, I want them in order
 
@phenomnomnominal Did you know that @ZachSaucier made fun of you at Front Trends? :P youtu.be/oS-rFKC-Wwc?t=1529
 
@Nick it's not like we notice they're in order :P
in any case, you can still do that
have it download the first doodle, display it, once it's done repeat for the next
make the downloads synchronous with each other
 
Nah, I made it the way I want it; in order
 
the effect will be a lot nicer ;)
 
You admitted your internet is poor; the effect is fine; I can't control your download speeds
 
4:33 PM
thing is, I thought it was broken and couldn't see anything
 
@SomeGuy Is that site still live btw?
 
@towc I added text to the canvas to let users know that it's loading
 
@Nick I can't see it :P
it's just blank for me
 
@Prefix this is the same as listening to two callbacks, or two Promises. You'll have to keep your own state. e.g.:
if (event1Fired && event2Fired) {
 ...
}
 
@towc cache? It's there.
 
4:35 PM
oh, yeah
 
In any case; it's not supposed to be amazing; just interesting to see the many google doodles over the years
 
@AwalGarg I'm not sure. I think it used to be at phenomnomnominal.github.io but it isn't there anymore
 
Does anyone want to help me debug a really simple setTimeout that isn't working on Chrome, but that works on IE and FF?
 
@SomeGuy good riddance, I guess. hides
 
@phenomnomnominal ^
I liked it :D
 
4:37 PM
@Luggage Yeah I was thinking something like that, but wasn't sure if there was a cleaner way
 
if you separate the "make sure both fired" fromt he "what to do when that's true" it can still be clean.
backbone as .once(), right? make a .onceAll() that takes an array of event names and a handler to fire once all have fired at least once.
ohh, that's what you asked for.
 
We have 9 hours of college on Fridays :o
 
to ensure you arent partying
 
da hell do we have a class for "thinking skills"
holy crap this is like the zeroeth time I am looking at college schedule lol
 
@Zirak read the discussion afterwards
 
4:44 PM
to ensure that they're learning jquery
in India, they teach jQuery in kindergarten
jQuery is the foundation on which India stands
 
I am yet to attend kindergarten, then.
 
jcurry 101
 
I'm thinking of writing raw bytes to the sd* block for the usb key
it'd let me simply detect by reading the first x bytes to know if it's an usb key compatible with the auth stuff
 
untested, but should get you started on a generic way to handle what you want
ES5 IE9+
updated for syntax hilighting..
 
@FlorianMargaine What are you trying to defend yourself against?
 
4:50 PM
@Zirak inconvenience
 
spicy curries
 
@Zirak putting an usb stick in a hole is much cooler than typing a password
(and as @Luggage says, much more convenient too)
 
universal serial hole.
 
How'd it work though? Will the usb's serial be the password? Will it just be in a file on the usb's fs?
 
just look for and test a private key on the usb's filesystem.
 
4:52 PM
I don't think I understand the purpose of it
 
a poor man's smart card authentication
 
he wants to stick his stick in the stick hole
 
@Zirak the usb device will just have the private gpg key on it
 
@FlorianMargaine you stay out of this, I'm talking to Zirak, here.
 
@Luggage sorry
 
4:53 PM
:)
 
So it's an identity stick
 
@Luggage thank you :-)
 
@Prefix updated a few times since i sent the original.
 
@FlorianMargaine what if the first few bytes are storing something else (as in, some data which the user stored before you put the key in)?
 
@Zirak yes. One that mostly everyone can get quite easily.
 
4:54 PM
@Prefix and if you support browsers earlier than IE9 you'll have to rewrite using underscore or array function polyfills
 
@AwalGarg I'll show a big warning "this will bork your usb stick, you won't get your data back"
before writing the data I need to the usb stick
 
hm... nothing will stop using a partition tho
 
I finally saw the new mad max movie; it was meh. Not bad, but meh
 
@Luggage we support IE8+. but I think I can rewrite it :-)
 
4:58 PM
@Zirak switcheroo's highlight for the selected tab in the list of tabs should be darker
 
commented some more.
 
5:14 PM
@FlorianMargaine oh.. passphrase the gpg key, but let the computer you are pluggin into cache the passphrase in some manner to keep the convenience factor
* stick in USB stick
* host downloads GPG private key, prompts for passphrase
* host encrypts it's OWN key and stores on USB stick so further use on that host doesn't need the passphrase.
 
				console.log('updating user');
				console.log(user); // user.notifications = [];
				req.login(user, function(error) {
				    if (error) {
				    	return console.log(error);
				    }
				    console.log('succcessfully updated user');
				    console.log(req.user); // user.notifications = [];
				});
but on page refresh
 
That indent tho.
 
req.user.notifications is the previous value
@Callum deal with it
 
http://www.commitstrip.com/en/2015/09/03/its-important-to-give-back/
CommitStrip - Blog relating the daily life of web agencies developers
It’s important to give back
CommitStrip
1441300796
 
USB thumb drives need unmolestable unique IDs..
 
5:27 PM
LOL figured out my setTimeout bug. traced it back to the client using an old version of jQuery with this bug: bugs.jquery.com/ticket/9678 Good times.
 
@FlorianMargaine still feel like helping the lemon?
 
new thing if anyone cares codepen.io/towc/details/wKBgod :P
 
@towc If that works how I think that works, that's really clever
 
It's a map of the sexual relations of Lemon's mom.
 
@Cereal how do you think it works?
 
5:33 PM
!!magic
 
(∩ ͡° ͜ʖ ͡°)⊃━☆゚. * ・ 。 ᵀᴴᴱ ᴳᴬᴹᴱ
 
I did it, sort of
used async listeners
/cc @BenjaminGruenbaum
 
@towc Balls bounce around randomly. Lines drawn based on proximity, forces applied based on proximity.

So you don't actually construct anything manually, it just all happens automagically.
 
@BenjaminGruenbaum: please explain your down vote. — bcmpinc 2 mins ago
^ lol.
@BartekBanachewicz huh?
@Luggage well, with two promises you'd just .all and with callbacks you'd use a similar tool like async.
 
@BenjaminGruenbaum I basically rewrote async-profiler into js
something my colleague didn't have time to do when he evaluated async listeners for our purposes
 
5:39 PM
what is an async listener?
 
@Cereal they spring to each other if they're within a certain distance
and then I draw the line
 
@towc replace the balls with cookies, and set one of the balls to my gravatar. that's like my dream world.
 
where does passport.deserializeUser get its values from? what passes it the object and done?
 
@AwalGarg ;) I could actually do that
 
> Congratulations! Your Talk Has Been Selected for Angular Remote Conf!
4
 
5:42 PM
but that will take out the fun for you, go change code for your dream world :D
 
@towc yeah. Really cool result from simple rules
 
@towc well, add some hot chicks too while you are at it ~_~
 
@SomeKittens is there a way to setup passport such that it doesn't run deserializeUser on a given path? it turns out it is calling it every time a ws request gets forwarded
(when I fall back to long polling)
 
@rlemon handle the ws stuff before the passport middleware
 
5:47 PM
I'll try, don't know if I can
it is the ws proxy
that is defined in the router.
 
@SomeKittens congrats!
 
@rlemon express.io?
@AwalGarg Thanks!
 
@SomeKittens it is my crazy setup
I've fucked myself again
@SomeKittens other question, which could just solve this one as well.
 
@SomeKittens Well done! Looking forward to seeing it.
 
passport.deserializeUser(function(obj, done) {
  // where the fuck does obj come from?  I can req.login(newUserObj, fn); and this ALWAYS reports the initial user session from first login
});
 
5:55 PM
@rlemon whatever done is called with is what's used as the key in the session store
 
yes, but where does obj come from?
it isn't req.user
at least, it doesn't line up to my altered req.user
 
er, I think it should be req.user
 
// I've altered req.user directly, doesn't do shit on page refresh.
// so I passed a new user object to req.login(), and inside of the callback I see the correct object in req.user
req.login(newUserObject, function(error) {
    if (error) {
        return console.log(error);
    }
    console.log('succcessfully updated user');
    console.log(req.user);
});
// however when I log obj in the deserializeUser method, It never has the new user object, it always reflects the original user session object from when the user initially logged in.
hopefully that all makes sense
 
@BenjaminGruenbaum it's a thing that registers every asynchronous action
 
@BartekBanachewicz ?
 

« first day (1783 days earlier)      last day (3161 days later) »