« first day (1525 days earlier)      last day (3423 days later) » 

6:00 PM
i investigated darwin, the only prebuilt runing ones are old and basic. not a complete OS at all
not one you use to get work done in. it' s aproject.
 
user1596138
Go to starbucks with a mac and scarf pay $5 for cup of coffee = hipster tool;
Go to starbucks with a mac, scarf and use a coupon to buy your coffee = Smart guy;
 
user2620028
@ssube yes it makes the cars much more stable
 
user1596138
That's the only difference.
 
user2620028
@someDoge NO coupon does not make you smart..... makes you female
 
@Luggage os x is darwin-based
 
6:01 PM
Bascially I love linux commandline environment abut hated dicking with the piles of choice for GUI
 
then just run linux without a window manager
 
@ssube I know, but there is no up-to-date non-osx darwin build to use
 
or
 
user1596138
@HatterisMad Well it at least means you aren't a hipster... Seriously what hipster could ever be caught trying to save money?!
 
user2620028
@someDoge thats like saying the only reason you bought the coffee in the first place was because you had the coupon
 
6:01 PM
run a linux vm with no ui at all, put tmux on it, and ssh in
 
i still wanted a ui and don't hate windows ui
i just hated windows commandline
 
user1596138
Hipsters be like "Oh boy whatever that is that costs $300!! Sweet!"
 
osx filled that gap.
 
user1596138
Then 3 months later when it's half price they're like "Yeah well when I bought it I paid twice as much as you so suck it!"
 
@Luggage yeah, that's my setup. Windows machine (so I can get on the network and vpn), linux vm without a ui, chrome ssh extension and tmux on the vm.
 
6:02 PM
I can use linux, and i deploy my software to linux.. but.. I don't enjoy the linux gui experience, and i've tried many
 
yea, i tried that for a while, linux in a vm just to ssh into :)
 
have chrome up all day, ssh to different machines in different tabs
@HatterisMad is that a drag race car in the picture?
 
user2620028
@ssube no... i would be bored to death
 
i just use terminal on osx and openssh. no extra to0ols
and i get tabs and all that.
 
user2620028
6:04 PM
 
the osx terminal blows thew doors off even 3rd party terminals for windows
 
@HatterisMad oh shit, that looks fun
 
user1596138
@Luggage Fuck yeah
 
user1596138
Especially with TotalTerminal
 
I use the stock terminal, never needed anything else, but i'll look
Windows 10 is getting some console improvements.
 
user1596138
6:07 PM
@Luggage It's an extension for Temrinal
 
ohh, system wide terminal via hotkey? I've been wanting a Windows-R equivelent in osx.
 
user1596138
Yeah with a nice drop down. Supports tabs too
 
user1596138
And transparent background. It's nice
 
now to replace finder. I miss explorer.
 
user1596138
Nautilus works on OSX haha
 
6:08 PM
tabs and transparent backgroudn are stock
 
user1596138
@Luggage Within the slideout
 
user1596138
I meant it retains stock features
 
Ignoring stupid fake folders, Explorer in windows 7 and 8 is rquite solid. good keyboard navigation, lots of topions.
gotcha
 
user2620028
@ssube you betcha bud. They are tons of fun until you smack the wall at 100mph with virtually no safety devices. Most people that try it say they are done after their first run to the hospital.
 
I wrote the nginx config all by myself today, such great feeling! :D
 
6:10 PM
Finder actually lacks some of those. It feels dumbed-down. OSx is such a mixture of some really simplified front end apps, and then.. just one click away.. UNIX
 
I have no idea how to write server configurations :D
 
@BenjaminGruenbaum @PeeHaa is the guy who has helped me a lot with nginx. All credits to him :D
 
@AwalGarg buy him a beer next time you see him :)
He's a cool guy.
 
sure :D
 
i'm fairly new to nginx, myself, but I'm liking it so far.
I use it as a software load balancer / rverse proxy / ssl offloading.
and in my new app it'll serve files (since i'll only serve html templates, no server-side rendering
 
6:15 PM
posted on December 19, 2014

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E")); try { var pageTracker = _gat._getTracker("UA-3727700-1"); pageTracker._trackPageview(); } catch(err) {}

 
oh btw @BenjaminGruenbaum I implemented the different components thing as well. XHRs or GET requests with an additional parameter will automatically be served the bare-bones of a component immediately usable in a page, all other direct requests would be served a proper HTML page. Pretty handy.
 
Glad you figured out an architecture that works for you :)
 
thanks :D
 
ahh, the ol' "if ajax then return json, else return html"?
or partial html vs full page?
 
It'd be cool if you could get back a documentFragment instead of the html in one giant string
 
6:26 PM
@NickDugger you can.
 
whaaa? How dumb am I?
 
IIRC @AwalGarg was even the one who linked me to that, check the XHR2 documentation and how to get a Document back.
 
interesting
 
xhr.responseType = "document";
 
ok so I'm trying to hack values into a DB I don't control...
function post(url, data, cb) {
	var xhr = new XMLHttpRequest();
	xhr.open('POST', url);
	xhr.onload = cb;
	xhr.send(data);
}

function loop() {
	if( !rows.length ) return alert('done');
	var row = rows.shift();
	var data = "";
	Object.keys(row).forEach(function(key) {
	    data += key + '=' + row[key] + '&';
	});
	data = data.slice(0,-1);
	post('redacted', data, loop);
}
anyone see any faults in this?
rows is a array of objects with the data I need to populate the DB with
 
6:28 PM
var xhr = new XMLHttpRequest;
xhr.open('GET', '/index.html');
xhr.responseType = 'document';

xhr.onload = function(e) {
    this.response; // documentFragment @NickDugger
};
xhr.send();
3
@rlemon not using promises :P
 
@BenjaminGruenbaum or jQuery
I'm pretty badass eh?
 
Wait, wth. Don't starve together isn't free? I thought they always said it'd be a free expansion :(
 
@rlemon No, seriously, you implemented the whole logic yourself with recursion, a promise could've actually helped you here :P
 
true. but i'm running this on a page without them, so I would have to import it
I didn't feel like doing that
wait
i'm stupid
they're native now
!!caniuse Promise
 
I use promises in chrome just fine
 
function post(url, data){
     var xhr = new XMLHttpRequest();
     xhr.open("POST", url);
     var p = new Promise(function(resolve, reject){
           xhr.onload = function(){ resolve(xhr.responseText); };
           xhr.onerror = reject;
     });
     xhr.send(data);
     return p;
}
 
silly IE
 
This'd let you do:
 
Yeah, I'm a bit perterbed that IE(edge) still doesn't support them natively
 
6:31 PM
NOTE: Current owners of Don’t Starve will be given free access to Don’t Starve Together upon its exit from Early-Access. In purchasing the Frontier Pack, current owners get immediate access to Don’t Starve Together, and a bonus copy for a friend.
als, I didn't know there was a don't star5ve together. that's cool
 
@Luggage it's pretty recent and sounds awesome
 
I bought it, even tho I have a copy, now I get an extra and I'm supporting a kickass game
 
my only real complaint with don't starve was how some thing got repetitious, like running around by yourself
if it's possible to run a dedicated server for it, I so will be
 
well if anyone wants to get in on don't starve together I have an extra copy (if I understood it correctly)
 
never heard of it
 
6:33 PM
I'm buying it myself, currently steam sharing someone's copy
 
It's a spectacular game
 
var p = rows.reduce(function(prev, row){
     return prev.then(function(){
           var data = Object.keys(row).reduce(function(prev, key){
               return prev + key + "=" + row[key] + "&";
           },"");
           return post('redacted', data);
     });
});
 
Go look up don't starve. a Neat 2d survival game. This is multi-player of that.
 
@BenjaminGruenbaum why do I never think to .reduce :?
 
@rlemon But, will don't starve together still be free eventually for current owners? Because this entire thing has me confused.
 
6:34 PM
 
@Kippie yes, after early-access
but not before
 
Then you can do p.then(function(){ alert("All done!"); });
 
Oh, I see
 
This looks just so much better with ES7 though :S
 
a.then(b).then(c) // easy as 1 2 3
 
6:34 PM
p.then -> alert "All done!"
 
arrow functions look weird to me
 
@Kippie I did find it a little tedious with the hounds, and ended up turning those off.
Early on they were dangerous, then they became annoying.
 
True, but you need them for specific resources, don't you?
 
@NickDugger .finally(doe.bind(ray,me));
 
function post(url, data){
     var xhr = new XMLHttpRequest;
     xhr.open("POST", url);
     var p = new Promise((resolve, reject) => {
           xhr.onload = () => resolve(xhr.responseText);
           xhr.onerror = reject;
     });
     xhr.send(data);
     return p;
}

var p = rows.reduce((prev, row) =>
     prev.then(() =>
           post('redacted', Object.keys(row).reduce((prev, key) => prev + key + "=" + row[key] + "&",""))
     )
);
Or something like that
 
6:36 PM
@Kippie doesn't look like it
 
show off
 
:D
Native XHR is pretty horrible though :P
Also, I think you can skip that reduce and just .send an object
Wait no, you'd have to new FormData it and that's just as much work
 
user1596138
> Office:~ jhawins$ purge
Unable to purge disk buffers: Operation not permitted
 
user1596138
Not purge time
 
user1596138
When I watched the purge I just kept thinking of this error lol
 
:-) hipster-delorean, now has DI (for angular like services)
how does this looks
import {HTTP, Router, Service} from './../app';

class NewService{

}

Service.register(NewService);
 
doesn't the concept of require/import with an array of modules you want pretty much make classic (java-style) DI useless?
 
No, and also what @darkyen00 just showed isn't DI.
 
why do function MyService(otherService, serviceProvider, etc) when you have require otherService = import("./otherService") three lines up?
 
@BenjaminGruenbaum you aren't getting it ;-)
 
6:54 PM
Sure I'm not.
 
@BenjaminGruenbaum no, it's a service locator.
 
@ssube DI is about injecting services to where you need them so you know exactly what something needs by creating one.
 
The harder part is ensuring Service and Router are loaded
 
@ssube you don't have to tell me that.
 
But it got me thinking that requires and ctor DI are awfully similar.
 
6:55 PM
Similar but serve an orthogonal purpose
The whole concept of DI is about an object not owning its dependencies and not caring about how they're created and configured.
It allows moving configuration and creation logic away from objects that need it.
 
Right. The requires stuff seems like a subset of that, but still covers some of the most-used parts.
 
So for example if you pass your logger through DI you can decide that a certain subsystem suddenly gets a higher priority.
@ssube naa, require is just about module loading, it's not about configuration at all.
You can't customize how a module is created.
 
You don't get logic or custom factories, and it doesn't handle conf, that's true.
 
I agree with Ben.
 
It doesn't handle initialization which is the whole point of DI.
If I have to new something I got it's not DI, I think that much is obvious.
 
6:58 PM
I agree with that statement.
However, if you wrapped require with a function that did the new for you, it becomes very much like declaring your deps as ctor params.
 
Also, registering a class right after you declared it like in @darkyen00 's example is just silly... it's modules like you said which are not DI.
 
just doesn't have any of the really useful stuff...
 
@ssube oh yeah, if you pass a factory that gets called by the injector every time you inject the dependency that's definitely DI but very poor DI.
 
What's the relationship between DI and Inversion of Control?
 
You want to be able to pass the instance - that's the point.
 
7:00 PM
@BenjaminGruenbaum right, that's what I realized. It looks the same, but will instantiate way too many things.
 
@GeorgeJempty DI facilitates inversion of control - instead of a class creating its dependencies it gets them as parameters.
@GeorgeJempty people use fancy names but what it really means is just passing stuff as constructor params or via setters instead of the class creating it. If your class makes a DB query it gets the DB handle as a parameter instead of creating a DB instance - simple as that.
 
I sort of knew that but wanted a lead-in to an interesting tidbit
Inversion of Control is mentioned in the GOF design patterns book under the "Template method" pattern
 
@BenjaminGruenbaum which, in turn, facilitates providing a different implementation and makes testing so much easier.
 
The so-called Hollywood Principle is mentioned: "don't call us, we'll call you"
 
@GeorgeJempty The GoF is rather rubbish on those patterns in today's standards - we've learned a lot over the years :D
@ssube yes - but unlike what a lot of people believe DI is not about testing, code just becomes easy to test when you use DI.
 
7:02 PM
not the Template Method it's practically foundational to all sorts of frameworks
 
Is it possible to make images responsive with css? (The img element, loading a different image for different resolutions, with css only).
 
I found this in code that I'm about to rewrite
 
function (typeToCreate, dependencies) { return ( var x = new typeToCreate.prototype)l return typeToCreate.apply(x, dependencies); }
 
<a href="javascript:document.getElementById('logoutForm').submit()">Log off</a>
 
I just wrote a DI fraemwork.
 
7:03 PM
here's Martin Fowler from just 10 years ago: martinfowler.com/bliki/InversionOfControl.html
 
@BenjaminGruenbaum right. You can live without DI (it won't necessarily be pleasant), but testing without DI is really hard.
 
One possible method I see is to add all the images in the dom, and set the visibility of only one of them to on, depending on the screen size. But this causes loading additional images for no reason.
 
Combined with good interfaces(/abstraction), DI really encourages loosely coupled classes.
 
@ssube I have lots of code without DI, pretty much anything under 300 LoC doesn't get reused - just the other day I refactored code to use DI when it moved from the 'thing I wrote in 5 hours for a task' to the 'thing we'll use again' category.
@AwalGarg you can use the picture tag - it's not widely supported afaik. Otherwise you can use media queries and a div background for an image.
 
our new Eng. Manager just started this week.
 
7:05 PM
yeah, the last java app I was working on, we didn't have it for a while because things were pretty straight-forward.
 
@GeorgeJempty that's a classic :)
@SomeKittens awesome? How are they?
 
2somekittens does he have pointy hair?
or she
 
Once we added auth (and needed to fake sessions), then a database, we started building so many mocks that we had to use DI.
 
@NickDugger that's not too horrible. I can get why someone would write that.
 
Swapping mocks for DI saved thousands of lines, but did take some time (getting Guice and Jersey to play nice was interesting).
 
7:06 PM
@BenjaminGruenbaum Yeah, but I need a cross browser solution. I am already doing the css background image thing, but 1. It is not semantic. 2. It is not SEO friendly (or so I think, correct me if I am wrong).
 
Considering the alternatives, I would never write it
 
@BenjaminGruenbaum His last job was Eng Director at Salesforce. Was well done, good conversation. I felt heard.
@GeorgeJempty In real life? Only when I sleep on it funny.
 
@NickDugger I wouldn't either - but I could see why someone would at a point when facing a deadline.
@AwalGarg use JS :P
@ssube that sounds pretty typical, yeah.
 
@BenjaminGruenbaum looks like that is the only way :(
 
@AwalGarg picture tag, but browser support.
 
7:07 PM
yeah
 
If only css allowed changing img src xD
 
Over 6000 stars, seem legit :)
 
<img data-responsive-img="true" data-src-sm="..." data-src-lg="..." />
 
o_O
 
7:08 PM
then attach your events to '[data-responsive-img]' and use it's attributes for the urls
 
This channel advocates always writing all solutions from scratch.
 
Naa, just some people.
I'm just fine with getting dirty with jQuery if it gets the job done.
 
Need to store data? write an rdbms.
:)
 
:D
I'm actually learning how they work now for the first time. I've been using SQL for 15 years now but I've never actually understood how the underlying engines work.
 
7:14 PM
That polyfill is nice. I would bookmark it, but for this particular case, I guess I would just write 5 lines of code myself.
Thanks Benjamin!
 
sure thing
 
This is driving me crazy
if my JS file has this:
 
bad bad
 
when is your code being run?
 
7:16 PM
it's probably happening too early, before the elements exist
 
1 hour and 19 minute for AD !
 
It took me a moment of thinking "..what does that have to do with Active Directory?"
 
!!afk have to get some work.
 
ps ssube, BenjaminGruenbaum I have to patch that register thing up .. for now it reads the import call to register in the build step, loads them during on the fly... idk if its called di :D or not
 
@DemCodeLines go through the learn jQuery tutorial
3 messages moved to Trash
 
7:18 PM
@DemCodeLines other than what ssube said, you really should store the result of that element in a variable.
Querying the DOM is no free lunch.
 
You've got to stop asking these questions, you've been asking them for years now and have refused to go read the tutorials.
Please do so.
Protip: invert the if and the click parts. They're nested inversely.
Seriously though - read a tutorial
 
@AwalGarg until they introduce a <lunch> tag
 
!!afk actually, I think I'll go have some dinner
 
cya later ben
@ssube haha
 
7:20 PM
!!afk s/k/chat/
 
$(document).on('click', '.details#details', function() { oh well whatever
 
why would you do '.details#details'? Just '#details' will suffice
 
Still doesn't solve the problem though
 
I'm too tired to care about what the real problems are lol
I'm on a carb crash
 
user2620028
7:28 PM
you should switch to injection Nick
 
inject my food?
into me, or with something?
ceffienated pizza?
 
user2620028
Lol automotive joke.... You said you were using carbs = carburetor
 
@ssube $(function () { is present, so the code only executes when the dom is ready
 
user2620028
so the alternative everyone loves to having carbs is fuel injection
 
7:30 PM
@Luggage AwalGarg is afk: s/k/chat/
 
@AwalGarg :P
 
anyone know Warhammer 40k well?
 
user2620028
I have seen it played but never played it :/
 
user2620028
Aka i don't have money or time for your $50 figurine painting parties
 
I've played it a couple times... 20 years ago.
 
7:35 PM
A lot of the objectives for 2015 Q1 front-end involve speed improvements. I'm calling the plan "Operation: Paint red stripes on it"
 
Because red ones go faster?
 
> DA RED WUNZ GO FASTA!1!
@Luggage Exactly.
 
does anyone know enough about node and node-pre-gyp to help me force node-webkit and node-serialport to play nice?
 
That's the only think I remember about warhammer becasue some idiot friend of mine repeated it way too much.
 
user2620028
@rlemon woah node has built in support for com ports?
 
7:37 PM
not built in
but it's a package you can get
 
@SomeKittens fairly familiar yes
 
node-webkit.. A solutino I wish I had a problem for
or atom-shell
@TomW Way too late. :)
 
@TomW Where would I find good Orky fluff quotes?
 
maybe appjs.com will work better?
 
@Luggage ...because of my age? Because it's a kid's thing? Yeah, it is. I don't any more. I do still occasionally google and see what they're up to though
 
user2620028
7:43 PM
I typically think that warhammer is an older persons game... Kid's shouldn't be able to afford to play lol
 
No, because the reference that Kittens was asking for was already used. Minutes too late, not years.
oops, wrong person. corrected.
 
user2620028
I don't understand... what lol
 
user2620028
oooo ok lol
 
wish i could type.
 
10 mins ago, by SomeKittens
A lot of the objectives for 2015 Q1 front-end involve speed improvements. I'm calling the plan "Operation: Paint red stripes on it"
 
user2620028
7:46 PM
Yes he said my name instead of yours at first kitty
 
Anywho. time to go home and play Arma3 until my ass gets bed sores.
 
erm, anybody ever dealt with browserify? I've used up my google and grep fu. One of my dependants is a browserify plugin (whatever that means), and its exports is a function which accepts bundle, and calls bundle.alias several times. Now, the build fails with "browserify has no method alias". I made a "plugin" which logs crap about the argument and included it with browserify (-p my-crap), and true enough, there's no alias
So I'm feeling a bit stupid
 
@Zirak do we get to know the plugin that's a problem?
 
It's not open sourced, so...
 
ah
In that case, you're probably using it wrong.
AFAIK, you shouldn't be requiring plugins, but rather hitting them with the command line
 
7:49 PM
@darkyen00 What was the issue and how did you solve it? (for my own edification)
 
// node_modules/some-crap/index.js
module.exports = function (bundle) {
    bundle.require('some-path', {
      target: 'some-module-name'
    });


    bundle.alias('another-module-name', 'some-path');
};

// and on the shell:
// $ browserify -p some-crap
 
k, looks good so far
 
And it complains about the alias
Looked over browserify docs, I don't see any alias, and googling doesn't show a historical mention of that function, so it's not a mismatched version of browserify
 
@Zirak Found this:
> A note on alias mappings, which was a functionality pre 2.0 that was removed:
 
@SomeKittens oh yeah, there's that, but that's for grunt-browserify and inside some grunt config
It'd also be weird if the plugin itself depended upon being built with grunt
@rlemon Don't built the post data yourself, you have FormData for that
 
7:55 PM
grunt question.. when you use grunt, do you have all your html files on production pointing to the new build/ directory?
or what is the best way about to do that?
 
@JoeSaad yep, think about it like regularly compiled files.
Aha, found this! gist.github.com/jed/3038799 ...which doesn't help
 
so you make two copies of html files, one that include dev versions and another that point to build version?
 
You can. Or just always point to the built version, have different ways of building it depending on dev/prod
 
hey @BadgerGirl How's things?
 
7:57 PM
> There are no aliases in v2 but you can do a similar kind of thing with .expose() across multiple bundles.
 
@Shmiddty good, you? :)
 
Zing!
Thanks @SomeKittens
 
@Zirak Found that in the issue referenced in the gist you posted.
Wow, that's the image ClipArt makes fun of.
 
The plugin I'm using was built around 2012 or so, makes sense
 

« first day (1525 days earlier)      last day (3423 days later) »