« first day (1112 days earlier)      last day (4061 days later) » 

17:00
@BenjaminGruenbaum But, I'm probably not out of line asking for this month's rent today?
@Shmiddty Yeah, no verbal agreement was made about the rent afaik, and it's also not documented anywhere :P Seriously though, if you don't want to be a dick just talk to her.
@BenjaminGruenbaum I've tried and tried
The best way to do business in general is to just be very direct.
Everyone has to know exactly what deal is being made and who's getting what and everyone has to benefit.
I even had an agreement written that let her forgo rent in the event that she move out by the end of the month
Joe
Joe
or very passive and change the locks when shes out
17:01
but she refused to sign it
@BenjaminGruenbaum A similar situation is when some people assume that browser APIs like setTimeout and alert are part of JavaScript. Not sure if it's worth educating people here, or if it's best to just ignore this false assumption.
Communicate, seriously - it's a lot better. In 99.5% of cases you can reach a better agreement by conveying what needs to happen clearly. Is she renting the apartment from you directly?
@ŠimeVidas Yes, exactly :)
She's my ex.
we share the apartment with one other person
the situation is shitty
17:03
That changes the situation entirely. You should have probably started with that.
Are you on good terms?
if it weren't for the other person, I would just break lease and move out
@BenjaminGruenbaum not any more
seriously, I've tried to talk with her, I've tried to help her out and be reasonable.
even after we broke up, I was willing to let the verbal agreement stand, but then she started neglecting that
How's this for an oxymoron: "Riot is a manifesto for vanilla JavaScript and jQuery."
@Shmiddty I don't want to sound like a dick here but I probably am. If I were you I'd do one of three things - leave, call a lawyer, lock her out. Then again I don't want any interaction with an ex.
so after some arguments, I wrote up an agreement that basically said she wouldn't have to pay rent each month if she was out by the end of the month, but she would have to pay on the 1st if she wasnt.
17:05
@Loktar 200w solar panel hooked to a separate battery that would charge throughout the day
@Esailija Why the happy face?
was my idea
pre-warm the interior
but that would cost $$$$
@BenjaminGruenbaum riot.js :D
@phenomnomnominal yeah saw that earlier, uses jquery
so its not 1k liars.
17:06
Yeah full of shit
@phenomnomnominal WTF is that?
They solve nothing, the data isn't really bound.. you have to write the presenter instead..
Someone's idea of a joke
!!afk smoke
@Shmiddty Why are you leaving me!?
They do binding based on id, they have sequential IDs instead of keeping track of dependencies. WTF?
17:08
people are fawning over it though
look how many stars and forks it has on github already lol
> jQuery API is beautifully designed and all parts of the library are extremely useful.
todo.on("remove", function(items) {
      $.each(items, function() {
         $(this.id).remove()
      });
})
WTF?
riot.js is a troll lib right?
giggles loudly
It has to be
17:09
I mean...
   // Render a template with data
   $.render = function(template, data) {
      return (FN[template] = FN[template] || Function("_", "return '" +
         $.trim(template).replace(/\n/g, "").replace(/\{([^\}]+)\}/g, "'+_.$1+'") + "'")
      )(data);
   }
> I felt my jQuery code was spaghetti code (I blamed it for the wrong reason) that is why I looked for Angular. But Angular is a complicated beast if you try to do more than “hello world”. Since my time to learn JavaScript frameworks is very limitted I shyed away to go “the angular way”. Riot seems to be what I'm looking for.
:(
antonpug3h
Can't wait to give this a try. Every year we just seem to get these wonderful things coming out that are lighter, faster, smaller, and beautifully simpler.
Never trust anyone called anton
// click on a navi element
$("#filters a").click(function(e) {

   // skip link's default behaviour
   e.preventDefault();

   // change the hash part of the URL
   $.route($(this).attr("href"));

})
whyyyyyyyyy
$(this).attr("href")
are people fucking stupid!
@Loktar Reads as - "Coding is hard and I don't undersatnd SoC or DI, can I just do jQuery and pretend I'm coding well" ?
17:11
@FlorianMargaine :D
it is troll imo
I dont think its a troll.
if they remove jquery as a dependency, they'll get way over the 1k limit
it is 420 bytes gzipped or something
you can easily implement crappy event listener and not hit 1kb
17:12
@Esailija he does the self = this trick you love so much
HOLY SHIT DID I JUST SEE A delete THERE?
@BenjaminGruenbaum what annoys me that he calls it a "style" as if it does the same thing as prototype
people who do that can fuck off and die.
lol I just stopped doing that
I got too used to supporting old IE vs's
"or the object constructor {} " - that's not the object constructor - that's an object literal.
new Object() <- the object constructor
@Esailija can you give me a quick example of promisifying this? github.com/Ralt/fastjs/blob/master/lib/fastjs.js#L44-L48
with bluebird, ofc.
17:14
still, better than jtypes.com
these people have pretty designs
so misleading.
@FlorianMargaine it doesn't look like parse conforms to node callback standard
yeah, they're designers, not coders
first parameter to callback should be the error
17:15
@Esailija let's say I change that
what does it change? bluebird expects this order of arguments?
@phenomnomnominal I saw him reply to a blog post on Dr Axel's blog recently, was funny.
HOLY FUCK DUDE:
  var item = { id: "_" + ("" + Math.random()).slice(2), name: name }
it should be parse(arg, function(error, result){})
// compile the person class
var Person = $$(function($fName, $lName, $age)
{
    // set the readonly fields (cast the string arguments)
    this.firstName = $$.asString($fName);
    this.lastName  = $$.asString($lName);

    // set the public property
    this.age = $age;
},
// ##### PRIVATE #####
{
    //
},
// ##### PROTECTED #####
{
    '_age': 0
},
// ##### PUBLIC #####
{
    'readonly firstName': '',
    'readonly lastName': '',

    'getFullName': function()
    {
        // return the concatenated full name
Why the heck would he do this shit?
btw. the garden recently got a new maintainer
17:15
then you do var parseAsync = Promise.promisify(parse);
Just fuck off and write C# already!
@IvoWetzel Now fix my issue :)
@Esailija and then var res = parseAsync(arg); res.then(function(err, results) {});?
with fs or such you can do var fs = Promise.promisifyAll(require("fs"))
difference between promisifyAll and promisify?
17:17
@FlorianMargaine no.. let me write full example that assumes promisfied methods
promisifyAll promisiffies all methods on the object and its prototype chain
yeah please :)
where as promisify takes a function directly
as you can see in my code, I can handle pretty well callbacks
but I'm a little bit attracted to promises
never had to really use them though. I just implemented them once...
It's not cheating if callbacks never find out.
@FlorianMargaine what is check
17:21
@phenomnomnominal they're out of the loop anyway...
@FlorianMargaine oh nvm
@Esailija function check(err) { if (err) throw err; }
for callbacks where I don't want to do anything but still checks for errors
so you don't have any error handling then
that will crash the server
nah I just fail if there is an error
true :|
not sure what I'd want to do though... it's supposed to be a localhost server, not really a server you'll find on the web
but propose me something
I'm interested
the caller of handleFile should probably handle errors
but the way you use check doesn't allow them to do that
17:24
I'd rather have handleFile handle errors tbh
unless I don't follow you
well typically you want some ui message like failed reading file
I don't think handleFile function should do that
hmm yeah indeed
that should be either start or handleRequest
the client code would look like

handleFile.then(function(result){

}).error(function(e){
     response.write("fail")
});
.error is sugar for .catch(Promise.RejectionError, function(e){})
which are errors like I/O fails but doesn't catch programmer erros like TypeError or ReferenceError
I see
I'll change something I'll think; I won't do the watcher thing in the lib, but in the binary
and the binary will only do http requests whenever something happens
so yea something like this (assuming fastfs has promisfiied methods too)
var parseAsync = Promise.promisify(parse);
var fs = Promise.promisifyAll(require("fs"));


Fast.prototype.handleFile = function(type, fullpath) {
    if (fastfs.isPage(fullpath, this.path)) {
        var content;
        switch (path.extname(fullpath)) {
        case '.html':
            return parse(fullpath).bind(this).then(function(vContent) {
                content = vContent;
                return fastfs.targetPathAsync(fullpath, this.path)
            }).then(function( p ) {
                return fs.writeFileAsync(p, content);
oops
17:28
see, this is why I'm not sure I need promises
forgot return from second case
I don't get any gain of indentation in this case for example
why the return parse(...?
I mean, why return?
there is flat indentation instead of 2 and that's when you don't have error handling
think of it like jQuery chaining
yeah yeah
how do I write promisified methods instead of using callbacks?
or do I still use callbacks?
like what does return $(".asd").addClass("").removeClass("") return
Joe
Joe
17:30
don't use callbacks at all
This is also a fucking awful idea: runnable.com
just promisify an api if it takes only calbacks
ah
that's your function let's see
17:31
there's nothing yet
but yeah how would I rewrite the exported function
'use strict';

var Promise = require("bluebird");
var fs = Promise.promisifyAll(require('fs'));

module.exports = function(fullpath) {
    return fs.readFileAsync(fullpath).then(function(data){
        return parse(data);
    })
};

function parse(data) {
    return data;
}
note that this doesn't crash the server and lets the client handle errors
have you understood the sync correspondense promises attempt to do?
you return a promise that will call then for the client
17:34
basically think like you would write sync code
and then there is usually very direct translation to promises
having callbacks in sync code is confusing :P
but yeah I get it
you wouldn't have callbacks in sync code.. i mean the way sync code throws and returns values
for example
module.exports = function(fullpath) {
    var data = fs.readFileSync(fullpath);
    return parse(data);
};

function parse(data) {
    return data;
}
if an error was thrown - the client could handle it with try/catch
just like with promises he can handle it with .catch()
but if you have stuff like check then he cannot do anything
otoh, if you want good error handling you will have ridiculously ugly code with callbacks
yeah got it
there is example of that in the "Why should I use promises" section
if you can use node 11 then you can just use generators and Promise.coroutine
oh yeah, generators
17:39
mmmm
@SomeKittens Where were you!?
@Esailija remaining in this example, how would you write parse with generators?
'use strict';

var Promise = require("bluebird");
var fs = Promise.promisifyAll(require('fs'));

module.exports = Promise.coroutine(function*(fullpath) {
    var data = yield fs.readFileAsync(fullpath);
    return parse(data);
});

function parse(data) {
    return data;
}
@CapricaSix Brunch, I told you.
user1125394
'use force';
17:40
ioooh I see
so almost exactly same as if it was sync
1 hour ago, by SomeKittens
!!afk team breakfast
you lied, you told me breakfast!
magic :D
the return parse(data) is not made before the yield is finished, right?
It took us a while to find the place
yep
also if the read fails it will throw real exception in the generator
however, you want that to propagate to clients anyway in this case
an uncaught eexception will be turned into a rejection on the returned promise
17:42
how does the parser read 'use strict'? does it just look for the string expression that is only that? can I say, var foo = 'use strict'; then in my block foo;
??
in other coroutine code you can then do try{ var a = yield parse("file"); } catch( e) {//check e}`
you lose the typed catch clauses though so you have to use js catch-alls
var theForce = 'strict';

'use '+theForce; // luke
> To invoke strict mode for an entire script, put the exact statement "use strict"; (or 'use strict';) before any other statements.
@rlemon just "use strict"
@rlemon it looks for a string that is not part of a bigger expression and is at the beginning of a function
17:43
and it needs to be first thing in function
but it would evaluate a variable that contains 'use strict' string at the top of a function and work correct?
var s = 'use strict';
function foo() {
   s;

   // codezx
}
@rlemon No, that's not the exact statement
I feel this wouldn't work.
"use strict"; Is ambiguous and stupid.
@Shmiddty You saw that whore again, didn't you!?
17:44
@Shmiddty I agree
bare string literals (ONLY) that a function starts with are called directives. "use strict" is the only one defined by ES5
No it's at the parser level, before being evaluated
@FlorianMargaine easy mistake to make with generators is yielding everywhere - with promises you can first construct the promises and then yield afterwards so they will be done in parallel
ahh ok
user1125394
17:44
!!$ .test()
well that bones that idea
@cↄ jQuery is not defined.
var use_the_force = 'use strict'; would have been fun to use
@Esailija advantage of generators over promises?
@phenomnomnominal I don't get it
17:45
//Execute 3 async stuff in parallel

var a = somethingAsync();
var b = somethingAsync();
var c = somethingAsync();

yield Promise.join(a, b, c);

//use a, b, and c now
user1125394
!!> eval("'use strict';")//boost the bot
@cↄ That didn't make much sense. Use the !!/help command to learn more.
@FlorianMargaine depends on what's the natural way to describe your algorithmm
is it funny because she has "mother fucker" on her shirt?
@cↄ "SyntaxError: missing ; before statement"
17:46
@Shmiddty I don't think so. Perl does it too, it's an easy way and quite obvious. I don't see the ambiguity
^ in the above example if you just yielded on all 3 calls they would be done sequentially
@cↄ "use strict"
but now they are all done in parallel and your code continues after they are all done
user1125394
there the bot will be performant
@Esailija yeah I get that
17:46
@FlorianMargaine well generators code is a bit lighter on syntax
you don't have to return and function(){} all the time
@cↄ no. It doesn't work with eval
@rlemon It's funny because she's having peanut buttery sex with your mom
Ah yeah I see
I won't use them for this project though, I need a broader compatibility. But it's nice to know
@Shmiddty Code review?
Wii U Karaoke has completely uncensored songs
nice
17:50
All three people with the Wii U are going to be so happy to hear!
@SomeKittens hmm?
hello everyone here
I'm stuck with timeago.js, somebody please help...
@FlorianMargaine Why a string expression instead of something else? It's arbitrary.
like JS in the past?
this is my fiddle.
http://jsfiddle.net/sunnykumar08/Kw6rJ/
17:52
landbefore.js ?
I can't get the accurate timeago
@Shmiddty it's backward compatible
if I mention the time just before now, it always says-"about 5 hours ago"
@Shmiddty Caprica pull request: github.com/Zirak/SO-ChatBot/pull/110
please help, I'm stuck.
17:53
@Sunny its working for me
@FlorianMargaine so is an inline comment
says 5 minutes ago for the last one
@Sunny It happens sometimes, especially with a bad timer on your computer
For the life of me, I can't convince my Win7 partition that it's in CA now.
why not 501337;?
it either says it's in NY, or (of all things) Hawaii.
17:54
any recomendations for the best way to send http cache? (my website is still at development, so it will change a lot during it's first weeks, should I care about cache?)
@Shmiddty easier to read
@Shmiddty Compilers tend to ignore comments.
i'm trying to fully optimize it
//strict mode powers ACTIVATE
@Loktar: no the last time is 2013-11-01T17:59:17Z and it is saying 5 minutes before which should be around 3 hours ago PS.
@SomeKittens: PS the fiddle once.
17:55
its in the future for me anyway
current zulu time is 17:56:14
where can I see the bookmarks of this room?
@Loktar: oops, can you suggest any alternate?
@Sunny zulu should be the same for everyone
whats that say for you?
@Loktar haven't tried yet, I'm right on it.
it says - a minute ago
now check your fiddle
> less than a minute ago
is the last one for me
before it was set in the future like 5 mins though
17:58
@Sunny it appears that timeago doesn't correctly handle future times
^ I assumed it didnt handle the future at all
so, how does it calculate, from zulu?
thats what I figured the issue was
Hi @Sunny
it has a way to handle future time, should I try to activate it?
17:59
I need your a bit help on design UI block of book and chapter
@Sunny go for it
yeah I would activate it
ACTIVATE THE FUTURE!
@Abhishek: hi
OMG ITS SO BRIGHT

« first day (1112 days earlier)      last day (4061 days later) »