« first day (1954 days earlier)      last day (3217 days later) » 
00:00 - 16:0016:00 - 00:00

00:03
@Lemony-Andrew you can start working for caprica six
I work for lord caprica
she is the best boss on planet earth!
@Lemony-Andrew you get a buffer - just read it?
00:41
@BenjaminGruenbaum that's a good episode, you'll also enjoy the skytanic episode
01:09
so guys I decided to start a new SPA using postgress (basically an online booking system), is there anything that should stop me in my tracks and go with mongoDB instead?
Well, isn't postgres relational?
yeah
i have most experience with ms sql
but its ms so not cool
01:25
@SterlingArcher postgre also has a key-value store
google: hstore
so can I develop my spa+postgresql inside a single vagrant vm ?
I suppose I need to use docker in this vagrant vm?
wow!!!!!!!!!!!! jetbrains.com/datagrip/
01:45
@KendallFrey hah I'm impressed :P
I've fleshed it out a bit more here:
http://stackoverflow.com/questions/35531209/how-to-deploy-a-spa-with-postgress-database-in-single-vps
02:10
How would you guys position the diamonds using trig functions? jsfiddle.net/hmfxmvvs/6
I asked a question about it too but it seems that its not so easy to accomplish stackoverflow.com/questions/35531028/…
tried something new: jsfiddle.net/hmfxmvvs/7
Ok I definately got it now: jsfiddle.net/hmfxmvvs/8
02:55
@Asperger The exact value you're looking for is 1.19175359259
:)
@KendallFrey hey : )
@KendallFrey eventhough I found out a solution on my own by getting the position of each divs vertex points I wonder how such things can be achieved using a trigonometric solution
How did you get that exact value? I mean did you use a trig function?
tan(50)
I see but why 50?
because that's how much it was rotated by
(with x and y coords swapped)
so tan gives you the ratio between x and y offsets to keep it in line
45 degrees was the rotation
03:02
but if you know the exact distance you want the offset, you still want sin/cos
@Asperger in that one, yes
I see
also, Math.tan takes radians, not degrees
What if I take for left Math.cos(45) * offsetLeft
and for top Math.sin(45) * offsetTop?
try it
just use radians, not degrees
ah sorry what I said was crap xD
Ok so I just convert it to radians then
03:07
Hi Kendall
<3
hello bb
It might as well not be possible with trig but just with calculating the vertex positions.
@Asperger radians bro
so instead of Math.sin(45) I say
Math.sin(0.7)?
Math.sin(Math.PI * 0.25)
03:10
Oh crap...my bad
or Math.sin(45 / 180 * Math.PI)
You are doing the conversion there the results is kind of the same but the position is still off so my logic must be wrong.
how many of you guys use BaaS vs own server?
with the shut down of parse.com its left a bad taste in many devs using BaaS
B___ as a service?
03:20
??
margin: auto was messing with it
lol well that was funny.
Im definately never ever going to close my eye on css when working with js again
03:45
I have a bunch of items that I want the user to be able to see a brief description
was thinking of hover but then I remembered mobile
04:00
ooh, i checked boostrap and found tooltips
i love bootstrap!
04:44
Hey, do you guys have a sample on how you guys structure your "isomorphic" apps?
Kinda fighting on whether to put client side src in "static" dir or just the dist version of in "static" dir.
05:00
@BenjaminGruenbaum what?
@KendallFrey imgur.com/a/xaRzG neat
why choose big Endian over little endian or visa versa
ttj
ttj
05:21
hi, quick question here. I'm setting up gulp-uglify and it's outputting an empty file. It happens when I enclose the code in a function. How can I prevent gulp-uglify from "optimizing" the whole script away?
(function() { /*code here*/ })(); // outputs an empty file
/*code here*/ // without enclosing function, outputs correctly. but not what I want.
lol that sounds funny. "Uglify can compress your code so well that it literally takes up 0 bytes!"
ttj
ttj
lol
"i removed all your ugliness"
I haven't used gulp myself so I wouldn't be of much help. I've gotten it to work fairly easily with grunt though.
People seem to scorn that though
ttj
ttj
ahh well I find gulp easier to set up
I'm missing something here. It works in my office.
05:47
Holy crap I'm dumb, I have mistaken links preload on Chrome for IE prerender for hours now
Woo figured out my problem with buffers. Apparently the program I was using was adding extra overhead, some sort of encryption maybe, ontop of my base buffer causing some weird side effects.
 
2 hours later…
07:43
Is there a JS/Node/Ecma(6) idiom for passing long list of arguments to a constructor? For example

`user = new User({ name: 'foo', age: 22 });`

I'd also like todo something like

`apiService.getUser(1234)` and simply `apiService.getUser(1234, { optional_arg: true })`

How would the method definitions look like and how are the parameters typically parsed/mapped to instance variables?
08:36
@randomguy Yeah sure you can do that.
You can do Object.assign to mix in two objects - Object.assign(this, properties)
@Loktar @jhawins you run redux in production right?
no, we use reflux currently
Oh ok, do you use webpack?
yea
You probably use react router too right?
in one project yea
08:44
I want to look at how bundling works - and all the online resources point to very unreasonable and outdated examples.
As in - bundle per route.
ah well, the project we use react router for is about 6 months old
and we just use one bundle in that one
I understand how it could theoretically work - and we have code that does it with systemjs which I read, but I can't really find good webpack examples.
Oh, bummer
we do mult bundles in our current project, but it isn't a spa
I just make UMD bundles and load them via script tags in the required section
it's a HUGE existing .net app.. so implementing react slowly
eventually will reduce the amt of bundles over time
hmm
Oh, so you bundle with asp.net, that wouldn't work for us.
I'd expect webpack to make bundling partial assets trivial, but I'm not sure what's the flow like - online examples are mostly terrible.
no, we bundle with webpack, but just include them in the specific view
one sec, I can throw up my config here, it may or may not help
but meh
08:48
oh, thanks
So it's not a SPA?
no
kind of lame how we have to do it currently
in this existing app
hmmm
well, thanks anyway :)
woah.. I didn't know it one boxed gists.. yeesh
then we have a prod/dev config that just adds/overrides a few things, but nothing relevant
but yeah that is dead simple what we're doing with that
nothing based on routes or anything
everytime we write a new section its just added to the entry, they all use the same set of common components as well, ect.
It's just baffling that there are no solid examples.
yea, multi bundling is kind of hard to find from my experience
that is supposed to be one of webpacks strengths
alright bed time, good luck man, hope you find something!
08:54
thanks, night.
@Abhishrek airtel launched great broadband plans at my area \o/
@Abhishrek when are you free for some ui help? will take about half an hour over skype
tonight around 8
@Abhishrek IST?
09:05
yes
 
2 hours later…
it spares you to understand Android java
but "fast" ?
it reduces the development time though
crl
crl
Who knows a bit about shadow dom? I'd like to inject an img element at the beginning of a link jsfiddle.net/crl/u6q8nstm just like a.pdf::before {content: "some shit"} but with html content instead of text
11:09
@AwalGarg if you are around gimme a call now ?
@crl never heard of that
i'm not sure what's advantageous with adding html at :before eg
@KarelG that sounds like my domain :p
here is an example you want salutations for names :P
or icons in front of names
or icons in front of *
crl
crl
@KarelG you can do that?
@Abhishrek sure
11:12
use hangouts though @AwalGarg ._.
crl
crl
I believe hangout can be a verb now
@crl lol
@crl wanna hop in ?
crl
crl
well I'll use a shitty font icon rather and ::before
@Abhishrek another day, want to finish something
Alright!
Using the EC6 Map object:

users = new Map();

When using the map.values(), I get back an iterator. I'd like to collect all users emails like so

users.values().map(user => user.username)

but unfortunately getting the error TypeError: users.map is not a function
Ah, got it. So it shoudl be [...users.values()].map(user => user.email)
crl
crl
I guess you could convert to Array (Array.from or [..., but are you sure you want a Map if you end up doing this?
Map and map are quite different, despite the ressemblance
I use Map as a hash to map users by their id (ID => user object). I want to use map to easily collect all user's emails from the Map.
crl: thanks for pointing that out. In this case, we want the different behavior of Map and map. But I can definitely see how that could be confusing to someone, so valid point. :)
crl
crl
you could use an object also, I don't know well Map, sorry, and then Object.keys(obj).map(k=>obj[k].name)
var obj = Object.create(null) // or {}
or you iterate on your Map values with a for of, and push it in a new array
11:31
Cool, thanks
@randomguy You can use Array.from(map.entries()).map(callbackFn)
crl
crl
framacarte.org/en looks nice (hm probably in French)
11:46
@MadaraUchiha Array.from(map.entries(), callbackFn)
@BenjaminGruenbaum Even better.
11:58
@randomguy Paste, CTRL+K, Enter
// Assume this is the first time I'm writing tests in Node. I'm writing a small JSON API. What is the recommended setup to write end to end tests with multiple HTTP calls inbetween? For example

    POST /users/register
    POST /play
    GET /users/me

// I need to pass the token returned from /register to the next requests. Finally, assert the response from /me has gamesPlayed increased by one.

// So instead of

    get('/register').then(() =>
        post().then(() =>
            post().then(() =>
crl
crl
yield maybe, dunno how to do it tho
@randomguy You want async functions, but those aren't out in node yet (they are in babel)
crl
crl
node --thereshouldbesomethingtorunasync
12:01
it("should do stuff", async () => {
  const res = await get('/register');
  // ...
});
@randomguy that's not how you'd write promises, I hope you realize that.
// Promises are never this:
a().then(() =>
  b().then(() =>
    c().then(() =>
       d())));
// Promises are:
a().then(b).then(c).then(d);
// Or if you must
a().
then(() => b()).
then(() => c()).
then(() => d()); @randomguy
I should have not used .then. The point is that a callback is provided when the request finishes, and you need to write the next request in sequence, so you have to do it inside the callback.. resulting in a callback soup.
get('/register')
  .then(() => {
    // do stuff and return promise
    return post();
  })
  .then(() => {
    // do stuff and
    return post();
  });
@randomguy When you return a promise from within a .then() the next .then() handler will wait for it.
That's kinda the point :D
12:04
Ohh, that's actually not too bad.
crl
crl
@randomguy you can avoid the ballback hell
fortunately
@randomguy Moreover, most testing frameworks allow you to return a promise from the test function, to mark it as asynchronous
so you can do this:
it("should do stuff", () => doStuff().then(result => assertSomething(result)));
Do you guys know of any practical examples of chaining (http) calls like this? I see then used in chai, but to me it still looks like a callback soup

var agent = chai.request.agent(app)
agent
  .post('/session')
  .send({ username: 'me', password: '123' })
  .then(function (res) {
    expect(res).to.have.cookie('sessionid');
    return agent.get('/user/me')
      .then(function (res) {
         expect(res).to.have.status(200);
      })
  })
@randomguy Don't nest .then()s.
I guess the nested could be chained after the first .then? That is

post.send.then.get.then?
Ah, that makes sense, thanks
12:16
.then(res => {
  // expect
  return agent.get('/user/me')
})
.then(res => {
  // expect
})
I forgot : Should I need to encode data when posting json ? content type is :application/json
(by encoding I mean only the value part)
12:43
Is there a bluebird trick for process.nextTick ?
Do I need to escape dash character - using back-slash `` in the regex?
I mean is which one is correct? (actually both of them works for me, am I missing something?) Well, which one?
/\-/
/-/
Linux guys, I need a quick incantation
I have the following structure in a directory:
nameA/
nameA.xml
nameB/
nameB.xml
...
I want to move all of the files into the respectively named directories (1:1 ratio guaranteed), and also name all the xml files to whatever.xml
@RoyiNamir no, of course not.
@Abhishrek you would never need that with bluebird, you'd do that for synchronizing things - promises take care of that for you. That said if you must Promise.try(/* runs in next tick */ })
@Mosho someone just tried to take your drawers and I had your back :P
@MadaraUchiha I can show you a 4 line python script that does that, although it's probably a lot quicker without it.
13:00
@BenjaminGruenbaum Thanks. I had blackout.
fs.readdirSync('.').filter(function(el) { return el.indexOf('xml') < 0; }).forEach(function(name) { fs.renameSync(name + '.xml', name + '/wahtever.xml'); });
@BenjaminGruenbaum I just wanted to wait for next tick
Fuck bash, I don't know why I even bother with it anymore.
so that my sandbox provider won't kill my server
@MadaraUchiha yeah, that works.
13:01
I ended up with await PromiseThatResolvesOnNextTick();
Thanks for the try thing :-)
I wonder if they took await from C#. ( MS requested users for their opinion for naming this thing).
find . -type d -maxdepth 1 -exec mv {}.xml {}/whatever.xml \;
@MadaraUchiha ^
@Abhishrek why?
@Abhishrek that is incredibly dumb.
I just found it intresting :P / just wanted views on that.
13:10
no shared memory.
@BenjaminGruenbaum I am using webtask.io they don't support extremely cpu intensive tasks
Also, why the heck did you need nextTick with promises?
@Abhishrek how is that even remotely related?
so I had to back off when uglifying code so just did await nextTick();
Either you want to yield to the event loop in which case nextTick doesn't help. Or you need to synchronize things in which case it won't help because promises are also synchronized.
I don't think you quite understand how nextTick works.
^ Probably
13:13
var nextTickQueue = []; // this is actually in CPP
runSynchronousCode(nextTickQueue); // this can push to nextTickQueue
while(nextTickQueue.length !== 0){
   nextTickQueue.shift()(); // this function can push to nextTickQueue
}
Although I think they are using nextTick to run watch the sandbox. They gave me event loop blocked error from the sandbox container.
nextTick doesn't actually defer anything.
:o oh!
I think what i did worked cause they were using .nextTick themselves to monitor. and I just pushed behind their callback.
regardless, what should I use in that case ?
When I want to yield to the event Loop ?
crl
crl
damn, the new pdf reader of chrome can't select text..
or my pdf was shitty, dunno
@crl link ?
13:19
@crl i have misread what shadow_dom does
crl
crl
hmm private file, for some public organism
oh selection works now on another similar file, nvm
pfft, @crl IIRC you can set non-copyablility in pdfs
hi JS, I have a question.

the following is a nice way to apply different functions depending in a ternary way on variable 'a':
window[a?'function1':'function2'].apply(object,['params']);

How would I translate this to jQuery functions? like the following but which doesn't work yet:
$[something?'addClass':'removeClass'].apply(obj,'class');

I've also asked it here but people who misread my post hijacked the question http://stackoverflow.com/questions/35535214/apply-jquery-function-to-object-based-on-string?noredirect=1#comment58760507_35535214
crl
crl
ok
@Hacktisch you are confusing array key access, [...] with method argument access: ( ... )
at jQuery, it should be $( ... ) , not with square brackets
13:29
$('addClass').apply(... doesn't work either, my jQuery line of code was just an example btw
jquery pseudocode
not sure if jQuery has .apply() .. lemme check
@Abhishrek .delay(0) probably.
Or setImmediate
@KarelG wtf
Okay :-) Thanks!
yea apply is native js but i'm searching for a jQuery way to achieve this
@Hacktisch yes, but a really dumb way, you could just () it.
13:31
nope. You have to use it on native javascript objects
@Hacktisch jQuery is a JS dom manipulation library.
just extract it from your jquery object
@KarelG please tell me you didn't really check..
@KarelG because jquery objects aren't javascript objects?
13:31
i don't know all jQuery functions
A "jQuery function" is just a function.
jesus christ.
Why use jquery?
I mean its all possible with base js
the think is, i want to use jquery functions like addClass and removeClass in the ternary part
@BenjaminGruenbaum A "jQuery function" is just a function for jQuery objects
so to rephrase the question how do you pass a jquery function to apply
13:32
@Hacktisch I can write you those functions in 5 minutes
if you see it differently, then it's for you
Some simple regex is required
well im working on a site that alreayd has jquery so why not use it when its there
Oh thats why
Unless you wrote the entire site yourself and just use those few dom functions
because then jquery is overkill
13:34
i know im not a js noob
im interested if i can achieve apply with jquery funcs
Evenmore if you use libraries for libraries for a library named jquery
@Asperger because "base js" doesn't behave the same in all browsers
evening peeps
@FlorianMargaine but what I used to do is write little polyfills and fallbacks and it works great
crl
crl
it's fine if browsers don't behave the same, as long as they work (a few polyfills)
13:35
please help me with my question, i dont need advice on what methods i choose to achieve what
!!ping
crl
crl
> i dont need advice
@MadaraUchiha didn't receive any communication from them yet :(
right im gonna figure it out on my own
13:41
you're asking help, but refuses any advices ?
just get your native js object from that jQuery object and apply apply(...) on it
i am asking for a specific answer to a specific question, not useless advice like 'dont use jquery' or 'use jquery'
crl
crl
> useless advice
fun guy
crl can you explain yourself
Wait a second
why dont you post a question`? It looks like you want fast answers without having tried anything
Also if you had enough knowledge in javascript you would understand what JarelG was saying
it tried, didn't find solution, and yes i poster a question stackoverflow.com/questions/35535214/…
13:44
Then KarelG already answered your question
Where can I chat with a user that asked a question if he does not have enough rep yet?
I know what karelG says, you can just do $('jqueryobj')[0] to get a native object
but i was to know how to pass a jquery FUNCTION to this object, the way i specified
*want
@AwalGarg Let me check
Oh, I missed that
Looks like the position got closed by the time I referred you
Sorry :(
@MadaraUchiha np, thanks anyways :)
I've so far faked "persistence" by using `var users = new Map();` in index.js where the node/express app is ran. I'd very much like, if possible, to postpone thinking about the persistence layer for now.

However, it would be convenient to initialize users with a test user. Anyway to structure the application or somehow conveniently pass the new User({ username: 'test' }) to the index.js's users in a test?
crl
crl
13:58
a config file maybe
@Hacktisch ah ... Lemme check if i can figure it
Some options I've considered: add another HTTP end point to add test users, use a file that the server loads from when starting, or just bite the bullet and implement persistence.
Can I chain these two lines to together (one continuous line) ?
var Names = [];

Names  = $(this).map(function() {
			return $(this).text().replace(/\s/g,".");
		}).get();
Names  = Names.filter(function(item, pos) {
			return Names.indexOf(item) == pos;
		});
@Hacktisch you have to unbox, then rebox it ...
meh, terms
crl
crl
Node.prototype.css=function(style){
	Object.assign(this.style, style);
	return this;
}
noJQ.css({color: 'red'})
14:09
:P
By the way, im trying to figure out how to create the grid so that it fills the entire screen. Any ideas? jsfiddle.net/testopia/xzxe6y5k
Im wondering if I should should do some collision detection. If div has no element adjacent to a border then take a div and place it there and so on succesively.
But hell im not sure : /
crl
crl
recurse in all direction and stop when pos is outside window limits?
with document.body.offsetWidth
crl
crl
hmm that sucks, you shoukd just do loops, well dunno because oyu rotated it..
but im not sure about recursing in all directions
ya the thing is rotated. I got a function for it though
My computePosition function takes care of it.
14:20
Hi guys, I'm looking for a specific piece of JS to visually "build" simple lines of code. For a web application I'm working on I want my users to be able to assign values to fields condition based. Basically I'm looking for something like jQuery QueryBuilder (querybuilder.js.org), except that this plugin doesn't include variables (I could use this plugin for if statements, but it's missing a variables feature). Does anyone know a project that comes close to what I want?
I just need to find a way to tell the program: hey if that div is surrounded then go to the next div and place divs next to it.
I might as well use a reverse loop and then collision detection
But hell this might as well become an an uneven distribution
By the way, im giving out 100 reputation in 2 days for those who can show me a technique or a tip: stackoverflow.com/questions/35537069/…
14:33
Hey guys, I'm having some issues with angular 2 over here. The problem is that, *ngFor doesn't seem to work. I use Angular2. Am I doing anything wrong?
@underscore Lol, I remember you telling me that you don't know how to use Angular2.
14:54
since nobody is noticing: happy birthday to me :D
4
@towc console.log('Happy Birthday');
crl
crl
if I have a replacement map: {small: 2, large:6, huge: 20}, how can I do those replacements on a given string that'll contain one of those keys? say "hello large man", hmm nvm, I have do the loop anyway
@towc you're born on the same day as me ? Happy birthday for you too :-)
Happy Birthday @KarelG!
5
crl
crl
15:10
var m= {small: 2, large:6, huge: 20}
var re = new RegExp('('+Object.keys(m).join('|')+')');
"hello large man".replace(re, x=>m[x])
@KarelG congratulations
@redelschaap Is it for a client?
crl
crl
oh Firefox (47) has a nice console color picker now
If so then you should maybe consider avoid taking jobs you cant code on your own.
@crl they do? wow nice
Its unfortunate that firefox market share is going down : (
'Come over,' she begged. 'I need you right now!' 'Just turn it off and on again,' he sighed. He hated these late night rebooty calls.
No not directly for a specific client, more for a webshop API platform I'm working on. I could build it myself, but since that would take some serious time I was hoping that there was a similar project somewhere
15:22
Hmm lets see
what exactly does the project need? I mean the exact features needed for the visual code
If I had time I could speed code a prototype for you just for fun.
Let me explain it with an example. I'm gonna use this for a product feed import tool, so shop owners can update their product database with their supplier's feeds. Let's say a shop owner wants to import a product feed that contains 4 fields: id, name, price and weight. Now price will be based on weight, so I want the shop owner to be able to "build" the price like this:
price = if ({{weight}} > 50) { {{price}} * 3 } else if ({{weight}} > 25) { {{price}} * 2 } else { {{price}} }
Where the "price = " part will be static on the webpage, and the rest will be generated by the code builder.
Happy Birthday @KarelG
Happy Birthday @towc
thanks
15:39
thanks ben!
when did that happen O_O ?
wonderful does it have dev tools ?
Not sure, I tend to stay clear of Apple stuff :p
Damn, Now I miss my iPad
15:53
Does for...in Statement work on IE7? (in this link says yes and in this link says no, so which one?)
how to call querystring(GET) and body data(POST) with one name :D ?
is there something better than 'data'
00:00 - 16:0016:00 - 00:00

« first day (1954 days earlier)      last day (3217 days later) »