« first day (1426 days earlier)      last day (3529 days later) » 

8:00 PM
we use ATL, SAT, IAD, FMT
etc
 
ok...
 
ATL - Atlanta
 
AMS is probably Amsterdam
 
People usually use the airport codes
yes
which is why IAD is Virginia
 
MXP ??
 
8:01 PM
@towc Max Payne?
 
no idea
 
probably not US?
 
@SecondRikudo obviously
 
@taco why IAD for virginia?
 
8:01 PM
@SterlingArcher airport code
 
@SomeKittensUx2666 Oh, that's not the worst I've seen.
 
Do you know which airport? I can't think of any near me starting with I
 
@taco europe
the closest one starting with an M is Malpensa, in Milan
don't see how the X comes in play
 
@SomeKittensUx2666 github.com/…
Enjoy
 
@SterlingArcher no idea, but we use IAD
 
8:04 PM
apparently I'm popular https://github.com/search?utf8=%E2%9C%93&q=towc&type=Code&ref=searchresults
many are just *to Water Closet* probably
 
!!google iad
 
So I have to make an ad rotator, currently they replace the image/link with a new image/link. Would just changing the .src and href be more performant or am I over thinking it?
        var $img = $('<img/>');
        var $link = $('<a target="_blank">&nbsp;</a>');
        var currentAd = adList[counter];

        $img.attr('src', currentAd.ImageUrl);
        $img.attr('alt', currentAd.AltDesc);
        $link.attr('href', currentAd.Link);
        $('.home-page-ads').empty().append($img).append($link).show();
their current code
but I fucking hate it
 
Yeah I can see why :P
 
8:07 PM
You should at least load the image first and then replace it
 
@Loktar probably overthinking, also I'd do it with native DOM
 
@BenjaminGruenbaum oh yeah for sure I wont use jq
@copy yeah good point
Ill just make a doc fragment add what I need and replace I suppose
 
Am I the only one who hates this \$.+ convention for jQuery nodes variable naming?
 
@SecondRikudo heh I use it too actually
 
That looks like something I would write @Loktar :|
 
8:08 PM
@SecondRikudo I hate it too
 
$el = $('somejqelement')
 
Best friends?
 
@copy Besties.
 
var $img = new Image;
var $link = document.createElement(a);
$link.target = "_blank";
var currentAd = adList[counter];

$img.src = currentAd.ImageUrl;
$img.alt = currentAd.AltDesc;
$link.href = currentAd.Link;
$('.home-page-ads').empty().append($img).append($link).show();
 
I do it that way because I hope it lets the dev know.. hey bro this is a jq element.
 
8:09 PM
@BenjaminGruenbaum STAHP it with the $vars
 
I totally get $ for dom elements, since they're not real JS objects it's important to mark them
 
Since when had JavaScript become PHP?!
 
@BenjaminGruenbaum I hate that .empty.append ill definitely change that
 
@BenjaminGruenbaum is that without Jquery? Last line looks like jquery to me
 
yeah last line still is, rest isn't
probably why it angers me (the last line)
 
8:10 PM
@taco I didn't do it without jQuery, I just edited his code to use less jquery - using it only when it's useful.
 
I take it sometimes jQuery does things better, so why not use it?
 
Although jQuery would have looked like:
 
@BenjaminGruenbaum I see
 
Screw polygon
don't give them your views!
 
8:11 PM
heh
One sec
 
Advertisers are pulling out on all those "game journalists" sites
makes me happy.
 
@Loktar reason? I feel out of the loop.
 
heh whats also kind of crazy, we already know all the ads that will be loaded..
 
@NickDugger you've opened a can of worms
 
@NickDugger oh man... too long to give a short answer really.. forbes.com/sites/erikkain/2014/09/01/…
thats a good start
basically they started a war on gamers... their audience
all these sites did, because they were called out for being dirty
 
8:13 PM
That's weird. Why would the attack a whole market?
 
and having conflicts of interest
if you look up #gamergate its a big deal
even aljazeera reported on it
@BenjaminGruenbaum so yeah I'm going to totally change it
{ ImageUrl: '/Themes/Default/Content/Images/DataProcessing/CustomerData_Ad.jpg', AltDesc: 'Customer Data Ad', Link: '/customer-data' },
{ ImageUrl: '/Themes/Default/Content/Images/EmailCampaign/EmailBuilderBanner.jpg', AltDesc: 'Email Campaign Ad', Link: '/email-marketing' }
 
one sec bro
 
^ we already have the ads statically in the code
so in reality I should just load them up first.. and just toggle the display on each one
 
I don't even care enough. I'm gonna keep playing video games, and people can say whatever.
 
instead of destroying/recreating them each time
 
8:17 PM
In the head I'd have something like:
<script type='template/simple' id='adContent'>
    <img src='{ImageUrl}' alt='AltDesc' />
    <a href='{Link}' target='_blank'>&nbsp</a>
</script>
Then I'd do something like:
function template(str, data){
    return str.replace(/\{(.*?)\}/g,function(_, tag){
        return data[tag];
    })
}

var viewModel = adList[counter];
var templ = document.querySelector("#adContent").innerHTML;
var adsHolder = document.querySelector('.home-page-ads');
adsHolder.innerHTML = "";
adsHolder.innerHTML = template(templ, viewModel)
 
IE8 support
:(
 
What part of this code doesn't run on IE8?
 
ah I saw type='template/simple'
 
js dev is hard
 
and immediately assumed it wouldn't
 
8:18 PM
This isn't a template tag, just a script tag, the type is just so it won't try to run it.
 
yeah good idea
 
@BenjaminGruenbaum ew, no
 
web dev is hard!
 
Well, the point is I'd keep the HTML template as an HTML template.
 
yeah I hate mixing the markup in the JS
 
8:19 PM
@Zirak yeah yeah you love writing 1000 lines of code for a simple HTML structure.
 
@BenjaminGruenbaum Single quotes in html.... No cookie for you
 
I like that man thanks @BenjaminGruenbaum
 
Im going to implement that
 
@PeeHaa I already found the jar and had 20 so there's that :P
 
8:19 PM
@BenjaminGruenbaum Using Java won't dig you out of that hole!
 
lol
 
@PeeHaa btw why do you care about single/double quotes in HTML?
 
@PeeHaa Less pixels - faster transfer
 
@BenjaminGruenbaum It's fugly and non standard (the standard being me)
@copy Then why do all you JS people use double quotes in your scripts :P
 
8:22 PM
@PeeHaa well, the W3C disagree about the standard thing :P
 
@BenjaminGruenbaum You are my love my angel, why you treat me like potato?
 
Yeah the same people who tell me I could just drop the quotes entirely.. :D @BenjaminGruenbaum
 
@Zirak A potato with a mustache.
 
@PeeHaa I don't.
 
!!hahano
 
@PeeHaa I use single
 
@PeeHaa if I could I would :P
 
@SomeKittensUx2666 WAAAT? @rlemon WAT
 
@BenjaminGruenbaum damn you!
 
8:23 PM
single quotes means I don't need to hit the shift key.
 
^
 
Same reason camelCase is better than under_score - one fewer keypress
 
ow wow. Most JS I see has those filthy double quotes
 
I also use tabs over spaces
 
@Zirak You talk like an angel walk like model, but your body look like buffalo
 
8:24 PM
GTFO
 
@SomeKittensUx2666 That's not why. It's because everyone knows a camel can kick a snake's ass
 
@SomeKittensUx2666 Underscore is an abomination that should've never made it to the modern keyboard.
 
Unless you mean my editor inserts 4 spaces when I hit tab
 
Now, if PHP got their quotes right we wouldn't be in this mess :D
 
@PeeHaa no, tell your renderer that to get with it.
the only argument I can accept is that places render them at 8, and is that really my issue?
 
8:25 PM
ewwwwwww and I always thought you were a decent guy :(
 
no
 
@PeeHaa when a language has 4 types of strings I get worried :D
Oh, and they all behave differently.
 
tabs == less characters :P and you already are hitting the tab key
you are lying to yourself.
 
Underscore was used in old typewriters to underline words, you'd just move the paper back to the beginning of the line, and press underscore a few times, and presto, underline an already written text :P
 
lol
 
8:25 PM
But only sometimes
 
tabs differ, though, don't they? we use 4 spaces
 
@SecondRikudo nono, it was invented for Python variable naming.
 
@BenjaminGruenbaum Yes, oh wise one.
 
@taco only how some places choose to display them 8 spaces.
 
8:26 PM
@AwalGarg I get SSL auth error
 
@AwalGarg Yes
 
@AwalGarg It should work
 
but I could just as easily choose to change my letter spacing, or my characters widths.
how is that anyones fault but my own?
 
Oh, that's just your link
 
@BenjaminGruenbaum eh? screeny?
@copy ok
 
8:27 PM
double quotes are for strings, single quotes are for characters, in C#... in JS, It just feels right to use double quotes.
 
> Unable to make a secure connection to the server. This may be a problem with the server, or it may be requiring a client authentication certificate that you don't have.
Error code: ERR_SSL_PROTOCOL_ERROR
 
@PeeHaa k, thnx :)
 
If I go to their frontpage it works though.
 
ok
 
@NickDugger characters are too rare to deserve special syntax imo.
 
8:28 PM
@BenjaminGruenbaum tell that to C#
 
@PeeHaa i'm surprised, you come from a language where the quote you use actually makes a difference in every day life :P
yet you prefer ' it seems?
 
@NickDugger It would've been nice instead of the silly @" syntax, especially now with interpolation.
 
Also for some reason IIRC all popular minifier turn everything into double quotes for some reason
 
so why do some providers charge so much money for ssl certificates?
 
@AwalGarg Because money
 
8:29 PM
@PeeHaa IE
 
And insurance
 
But mostly because moeny
 
@PeeHaa So they get gzipped better
 
> we can charge this much, so we will.
 
8:29 PM
@"<a href=""" + somevar + """>"; -- What the hell, C#?
 
@PeeHaa Because they have to stick with one or the other, and I think double-quotes have a better Huffman encoding
Or whatever that was called
 
ok
 
@NickDugger no one does that though.
 
Tabs caused issues in a sourceforge(?) tool we once used. Haven't seen it in Atlassian Stash.
 
@BenjaminGruenbaum tell that to my coworkers
 
8:30 PM
yeah i think I have posted a question about it at some point
 
@NickDugger don't they know about string.Format?
 
I don't think it matters as long as you standardize, though, really
 
I almost always have an extension method that adds format to string because I'm lazy :P
@taco don't ruin our bikeshedding :(((
 
I don't even know. I'm just the front end guy
 
@NickDugger ok, that's bad C#, telling you that much
 
8:31 PM
I believe you
 
ASP.NET actually has fairly good templating now
 
@BenjaminGruenbaum omfg. So I believe .net might be ripping out the script tag.
/me cries.
 
string.Format("<a href=\""{0}\">", somevar);
 
@Loktar wait what?
 
this isn't razor.. old school mvc
yeah its not on the page which is weird idk
on the rendered output
 
8:32 PM
@Loktar so put it in a div it doesn't matter what tag it is.. give it display=none though
 
@Loktar Script tag you say?
<script language="php"> </script>
Best language feature evah
 
That actually worked right?
 
yeah I liked the <script> approach, it was fancy :P
 
Still does
Soon to be burninated
 
Holy shit, really?
 
8:33 PM
I think I'm gonna vomit.
 
yeap :P
 
I thought they killed that at like... php4
 
@BenjaminGruenbaum Yeah, all over my keyboard too.
 
perhaps distasteful
 
8:34 PM
@BenjaminGruenbaum Nope @nikic is working on removing that thing as we speak :P
 
@NickDugger o_O
 
@NickDugger perhaps. Yeah :P
 
I have a dark sense of humour
 
ohh shit it is that day
I was wondering why I was seeing so much 911 news
 
@PeeHaa might want to kill the stupid part where variables start with $
 
8:34 PM
:D
 
var jqueer = $ = jQuery;
 
you are really not on your game today
0/10 jokes found funny.
 
my new dummy identity for testing:
> name: Avada Kedavra
place: Number 4, Privet Drive, Little Whinging
 
@rlemon I do it for me
 
!!s/Avada Kedavra/Lilly Potter/
 
8:36 PM
@rlemon name: Lilly Potter place: Number 4, Privet Drive, Little Whinging (source)
 
@AwalGarg I've said it before and I'll say it again - you're just not that funny.
 
@rlemon but yes, I've had a bad day today... debugging jquery almost all day, and gave up and just deleted a whole chunk of code.
 
@rlemon lilly didn't live there, FYI.
 
Sorry, you're a cool guy otherwise.
 
ah haha figured it out @BenjaminGruenbaum
 
8:37 PM
@AwalGarg I probably read the books before you were born FYI
 
What happened?
 
 templ = document.querySelector("#adContent").innerHTML,
            adHolder = document.querySelector('.home-page-ads');

        adHolder.innerHTML = "";
        adHolder.innerHTML = this.template(templ, viewModel)
.home-page-ads is the parent :P
 
what regex would I use to capture the first 5 numbers(including any , and .) of any string like 2,312.142
 
@BenjaminGruenbaum :)
 
easy fix though, thanks again
 
8:37 PM
@rlemon the fact remains
 
[/d,\.]
 
in your defense you couldn't see the markup at all
 
@Loktar oh I was just writing that code for showing my idea, didn't actually run it against anything :P
 
haha yeah I just needed to test it more
 
@rlemon yeah but how to capture it all?
 
8:38 PM
I capture fish sometimes with a net
 
lol
 
[/d,\.]{5} is not enough
 
So has anyone been kickmuted yet?
 
Only for testing, I think
 
@phenomnomnominal I can kickmute you
 
8:41 PM
@SuperUberDuper you would have to do two queries
otherwise ,. count as chars
 
@SomeKittensUx2666 :(
 
!!> "2,312.142".match(/([0-9,\\.]{5})/, '')
 
@rlemon ".142"
@rlemon ["2,312","2,312"]
 
so if you wanted 2312.1 you are boned
 
hrm
 
8:43 PM
!!> "2,312.142".replace(/,/,'').match(/([0-9\\.]{5})/, '')
 
@rlemon null
 
isn't even perfect
 
@rlemon ["2312.","2312."]
 
tl;dr you would need to remove the ',' and split at the '.'
if the first part is > 5, slice the 5, else add the remainder from the second part
 
If js' regexps had defines, you could hack something together
But regexps aren't powerful enough to count, you don't have state
 
8:47 PM
!!> var parts = "2,312.142".replace(/,/, '').split('.'); if (parts[0].length >= 5) { console.log(parts[0].slice(5)); } else { console.log(parts[0] + '.' + parts[1].slice(0, 5 - parts[0].length))}
 
@rlemon "undefined" Logged: "2312.1"
 
What about /([0-9][,.]?){5}/
 
@SuperUberDuper make sense?
 
almost
thx v impressive
 
@BenjaminGruenbaum nice
 
8:48 PM
Ty
 
forgot I could add a second capture group
 
@BenjaminGruenbaum What I thought of at first, but he wants to match 5 numbers with arbitrary separators inbetween
 
I don't often regexp
 
Just what he said basically, a number optionally followed by a comment or a dot, 5 times.
@Zirak well, you can optionally match anything that's not a number
 
Or wait, what
I remember dropping that
For reason
Now that reason doesn't exist
Brain, I hate you
 
8:50 PM
@towc pffff koreans :P
 
!!> "1,234.51234321321".match(/([0-9][,.]?){5}/).shift()
 
@PeeHaa wait... were those koreans?
 
@BenjaminGruenbaum "1,234.5"
 
see and I would have had a mess of ifs
 
replace(/,/, '')
@rlemon I don't get what this means:
 
8:51 PM
var parts = "2,312.142".replace(/,/, '').split('.');
if (parts[0].length >= 5) {
    console.log(parts[0].slice(5));
} else {
    console.log(parts[0] + '.' + parts[1].slice(0, 5 - parts[0].length))
}
 
missing a /g modifier there
 
it removes the ',' char
and yes, I'm missing a global modifier
 
user2620028
see you guys im going to go tear my racecar down to bare frame and put it all back together again. Wish my luck guys
 
text.replace(/[,.]/g,"").match(/[0-9]{5}/).shift() could also work although that'd just return the number and not the dots and commas.
 
8:52 PM
cool, good luck Aaron!!
 
@AaronSiciliano sure thing buddy. Good luck.
 
Danger Zone @AaronSiciliano
 
user2620028
@taco never
 
Take tons of pics!
 
user2620028
@taco at least this time i am doing a bolt check. (Last time i went out with a new engine and no bolt check it shot the drive line out the side of the car at 9,000 rpm :(
 
8:53 PM
Okay, I updated my comment
 
Of your facial expressions in the process though, not the car.
 
user2620028
will do
 
user2620028
@BenjaminGruenbaum the disgust that i have on my face when i find stuff falling off the car? and nylok nuts that have no nylon in them anymore? lol
 
@AaronSiciliano I know some of these words, sounds DangerZonish
 
Guys, how can I load a library that defines a global variable x asynchronously, and once loaded, pass x into a function?
 
8:55 PM
@SecondRikudo MAGIC
Oh, and also scripts have an onload handler
But MAGIC is the key
 
I'm just going to try the obvious way
 
@SecondRikudo Object.getOwnPropertyNames(window) before and after, of course
 
@BenjaminGruenbaum That's not what I meant and you know it.
Can I use x in the onload function before it gets defined?
 
@SecondRikudo so put it in a setTimeout with 0
(0 timeout)
That way it'll get a chance to define it.
 
8:58 PM
fo sure
 
@BenjaminGruenbaum Nope, didn't work.
var script = document.createElement('script');
script.src = 'http://cdn.craig.is/js/mousetrap/mousetrap.min.js?9d308';
script.onload = function () {
    window.setTimeout(function() { bork(jQuery, Mousetrap) }, 0);
};
 

« first day (1426 days earlier)      last day (3529 days later) »