« first day (1696 days earlier)      last day (3246 days later) » 

6:00 PM
anyone with close vote privs on AskUbuntu close this please. askubuntu.com/questions/94614/…
I asked a stupid question and it just got a stupid answer
now OP is complaining because I dv'd his stupid answer and cv'd my question
 
ios9 multitasking split screen wow so android pro
 
Actually that's my script pastebin.com/ngY3ZHf4 working with typeof var != typeof null
duh... meeting called, I hate monday... i'll let my chat windows open if someone have something to say about the code.
 
if you're trying to check that it isn't null, just check that it isn't null... don;t use typeof
 
var form = document.getElementById('goto_route_url');
if (form != null) {
    if (form.attachEvent) {
        form.attachEvent("submit", gotoURL);
    } else {
        form.addEventListener("submit", gotoURL);
    }
}
 
if(form)
 
6:06 PM
I can't remember why i've used something else than just != null but there where an explanation before... but i'll got with it loll
 
var form = document.getElementById('goto_route_url');
if (form) {
    (form.attachEvent || form.addEventListener)("submit", gotoURL);
}
 
picture in picture is pretty cool, ios... but you still suck dix
 
@ssube won't work
 
@akaRash orly?
 
@ssube this
 
6:08 PM
@akaRash ?
 
@ssube attachEvent is 'onsubmit'
:(
 
@ssube attachevent and addeventlistener will lose context if used that way
try in console: (console.log || false)('foo')
in browser console only...
 
crockford said es6 classes are shit
 
What's a crockford
 
cockford can suck a class
ES6 classes might not actually be real classes, but they help the readability tenfold.
 
6:11 PM
crockford has said a lot of things, very few of which we actually listen to
 
he said it's for java people to feel better when writing javascript
 
@Mosho he isn't wrong
@NickDugger neither are you
 
it's so the language reflects how it's being used. We already use classes, now the language offers them.
 
They're for everyone who wants to feel like a programmer, and not a little javascript shitkid
 
they are shit because they are just sugar. they are awesome because we like sugar.
 
6:12 PM
@rlemon your ambiguity is appreciated
 
how is that ambiguous?
 
crockford also has a lot of opinions that are very specific to how he codes, as shown in jslint and his questionable book
 
Went looking up what crockford was. Ended up on google plus. Our domain uses gmail for our work email. They disabled google plus on all accounts.

As if anyone actually uses g+
 
@rlemon I wrote that before you explained :P
 
ahh
 
6:13 PM
Crockford is a now-obsolete "authority" on JS. Essentially the RMS of JS: very opinionated, questionably applicable, largely ignored.
 
talking about swift no ios9 cum on
 
there was also this german guy who does weird stuff like this:
it's a script that outputs itself plus a spinning world animation
 
...
 
which is pretty mind blowing but useless
 
Weird things happen when you're bored on company time
 
6:16 PM
Swift open source
guys
 
he said he does it at night :P
 
oboi
 
@NickDugger Nice
 
@ssube amen brother.
 
> Swift will be open source later this year, available for iOS, OS X, and Linux.
no windows? D:
 
6:17 PM
@Mosho neat!
 
@NickDugger Once steam takes over the world and puts all games on linux, no one will use windows anyway
 
Adobe will need to spend a lot of money to properly port their software
 
@Cereal "It's the year of Emacs gaming on the Linux desktop!"
 
@Cereal LOL
my sides hurt
 
if emacs was so good then why did steve jobs invent osxmac?
 
6:19 PM
Adobe software and games are the primary reason I still use windows.
 
@NickDugger because Apple isn't capable of using anyone else's software, but they also aren't a software company. On top of that, he didn't.
 
also work makes me
 
osx is darwin, they didn't invent shit
 
@ssube you missed the joke
 
@ssube no, they build targeting their platform and claim innovation
 
6:20 PM
people assume apple invented osx because nobody has ever used bsd :P
 
Apple is a marketing company that happens to steal software
 
every single time someone reasons along the lines of "if you are right, why do (so many) other people not do it", a thousand puppies are killed.
 
@akaRash If you're right, why do so many people not kill puppies?
 
@ssube it just happened
 
I've been killing puppies for years.
 
6:22 PM
couldn't expect better
 
Survey: How many columns do you prefer in your code? 80, 120, other
 
> Have you ever really looked at the crawfish and crabs you eat so casually every day?
> their 10 legs
 
@Shmiddty The longest line of code in this file is 87. so I'm going to go with 87
 
Someone is very rich but mediocre at counting.
@Shmiddty 120
 
6:25 PM
I never pay attention to columns
 
user1596138
Hey I haz question can I ask the question @CapricaSix
 
!!welcome Jhawins
 
@Jhawins Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
 
> Checkerboard is a library that lets you easily create shared state among clients with zero server-side logic. It has two components: a server back-end written with node.js
sounds contradictory.
 
user1596138
How do you determine (reliably) whether or not the text-overflow:ellipsis property has kicked in. I.e. how do you determine if the ellipsis is showing/the text is truncated
 
6:26 PM
@NickDugger So when do you decide to wrap something to the next line?
 
if my editor gets a horizontal scrollbar
 
user1596138
Don't say scrollWidth > offsetWidth... It rounds and fails on rare occasions.
 
I think I would rather write is rather than ===
 
@Jhawins even when comparing with epsilon?
 
1 message moved to Trash can
 
6:27 PM
I wonder if there is a coffeescript transformer for babel
 
damn your userscript
 
user1596138
At first I thought getBoundingClientRect.. But that is the element width not the content width.
 
@Mosho CS is obsolete now
 
user1596138
@ssube What?
 
@ssube it does a few things ES6 doesn't, wouldn't call it obsolete
 
6:28 PM
@ssube What?
 
@Jhawins if rounding causes problems with scrollWidth > offsetWidth, can you do (scrollWidth - offsetWidth) < 5?
 
s/now/since forever
 
measure "close enough"-ness
 
user1596138
@ssube They are rounded properties.
 
I'm just tired of writing ===
 
user1596138
6:29 PM
I.e. already rounded when you get them
 
63
A: HTML text-overflow ellipsis detection

italoTry this JS function, passing the span element as argument: function isEllipsisActive(e) { return (e.offsetWidth < e.scrollWidth); }

 
I cringe just a tiny bit each time, but after so many times...
 
@copy true enough. It should never have been.
 
probably where the original code came from
 
user1596138
@Loktar Hmm?
 
user1596138
6:29 PM
I wrote it bruh
 
user1596138
You guys had it doing a popup always lol no check.
 
oh, well try the other answer and see if it works
 
@NickDugger ahahaha how many times has it binned you?
 
user1596138
I don't want to clone the element and stick it on the page
 
I started it this morning.
 
user1596138
6:30 PM
27
A: HTML text-overflow ellipsis detection

Christian VargaOnce upon a time I needed to do this, and the only cross-browser reliable solution I came across was hack job. I'm not the biggest fan of solutions like this, but it certainly produces the correct result time and time again. The idea is that you clone the element, remove any bounding width, and...

 
user1596138
This one? You do not want me to do that one. Hahahahaha
 
user1596138
There has to be a better way!
 
@rlemon twice, I think
 
nice
1 message moved to Trash can
 
@NickDugger pls (source)
 
6:32 PM
if I could take that back, I would... please don't mindjail me
 
user1596138
I'd rather just do the whole ellipsis with JS instead of text-overflow based on a number of characters... Would be less of a hack?
 
user1596138
Still a bad solution.
 
@Jhawins it would be more of a hack
 
^
 
how do you know when to put in the ellipsis?
 
user1596138
6:33 PM
Nah
 
user1596138
Just as nasty
 
you'd have to check the font, then each character size, then sum them up
 
god yeah..
 
user1596138
Yeah that's what I said?
 
or use .measureText
 
6:33 PM
plus bold/italics, all the kerning rules
 
@Jhawins Welcome to the JavaScript chat! Please review the room pseudo-rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
@NickDugger pls (source)
 
what
 
user1596138
Thank you for the helpful insight lol.
 
sometimes she bugs and queues up responses
don't ask, I don't understand it
 
user1596138
Make a hack job is the answer. Clone the shit and append it, check it, delete it
 
6:34 PM
Mebbeh she runs binned messages
 
you asked if it would be less of a hack, we pointed out how it would be more
 
or research more
 
user1596138
@ssube Did you even read the messages?
 
user1596138
I wasn't going to do that lmfao. Jeez
 
user1596138
Imho they both suck dick.
 
user1596138
6:35 PM
Not everything is literal.
 
user1596138
@Loktar I came here and asked you only after not finding any ways that aren't a hack job.
 
Witcher 3 is 10% off on GoG
 
check width, remove the text-overflow property, check width, add it back.
 
user1596138
@akaRash Yeah that'll look clean lol
 
"lol"?
 
user1596138
6:37 PM
Have to remove overflow too, not just the text-overflow
 
user1596138
@akaRash That would result in your text pouring out of the container and then disappearing.. Sure it would happen fast, but nah.
 
I left and my message disappeared. is there an official javascript github
 
@TheWrenchintheSystem no
 
@TheWrenchintheSystem A what now
 
6:39 PM
faster than cloning an element and hitting the dom n number of times.
 
@TheWrenchintheSystem Javascript is a specification, so
 
is there a good github for javascript
 
well ecmascript is a specification
 
user1596138
Yeah, I guess I don't give a fuck how I do it then. Whatever makes shit do the right thing is going to happen. Everyone is like yeah do a hack job so I'll do a hack job.
 
@TheWrenchintheSystem what?
 
6:40 PM
Well, there's Gitlab
 
@Jhawins @DenysSéguret is the expert on this topic
 
user1596138
5 Josiah points to anyone who had an idea that doesn't suck
 
@Jhawins ping him with what you want or a link
 
@FlorianMargaine his solution is the same he got from another answer
 
How do you all prefer to handle enums in ES6 (not TS)?
 
6:42 PM
what's wrong with github for javascript?
 
/** @const */ var FOO = 0;
/** @const */ var BAR = 1;
…
 
@ssube symbols might make it more feasible than what we did with ES5
@copy es6 has const :P
 
user1596138
lol the one time I come here with a for serious, real web dev question.
 
const MyEnum = {
  a: 0,
  b: 1,
  c: 2
};
is the classic example, but is not read-only
nor does it allow mapping values back to names
TS outputs something like:
var MyEnum;
(function (MyEnum) {
    MyEnum[MyEnum["a"] = 0] = "a";
    MyEnum[MyEnum["b"] = 1] = "b";
    MyEnum[MyEnum["c"] = 2] = "c";
})(MyEnum || (MyEnum = {}));
 
You can freeze that object
 
6:44 PM
which is not read-only, but does map both ways
class MyEnum {
  get a() {
    return 0;
  }
  ...
}
is read-only and can map both ways in ES6, but has a lot of overhead
hell, this ought to be a question
 
const MyEnum = Object.freeze({
  a: 0,
  b: 1,
  c: 2
})
 
@copy we were in a Martin Kleppe talk you'd have really enjoyed - had a beer with him afterwards
Game of life golfed to a single char basically.
 
Cute
 
@BenjaminGruenbaum how does that even work with no eval function and no other keywords?
 
It's eval'd I think, the point is you can accent a text (like Zalgo) as much as you'd like to put arbitrary information in it
And then look at like... every 6th code point
 
6:52 PM
I don't see any eval there :/
 
unless binary magic invisible to everything
 
There are cute ways to eval
 
ohhhhhhhh shit right. ofcourse eval is just one way to eval
 
!!> var c = "constructor"; c[c][c]("console.log(1)")();
 
6:55 PM
@BenjaminGruenbaum "undefined" Logged: 1
 
What did I just read
 
@BenjaminGruenbaum because the constructor of all constructors is function?
p.sure I saw something to that effect explaining classes and their prototype chains
 
c is a string, the constructor of a sting is the String fucntion
 
Why is c[c] a function. WHy is c[c][c] a function o.o ahh
 
Good thing you are not AskUbuntu's owner to decide what is good or not for website. Grow up brat — leandr0 11 mins ago
the irony is thick with this one
 
6:57 PM
the constructor of the String function is a function constructor which can eval
@ssube naa, it's way more oldschool than that
 
apple radio k
 
"this answer is not useful".replace('answer', 'user');
ohgawd I mixed single and double quotes. throws self on sword
 
you are no developer of mine
 
ew drake is on the apple live...
Drake has a line in his hair where the barber messed up
 
if it's on the side, it's intentional
 
7:01 PM
He's from canada
apologize right now
he's such a goon
 
Im sorry you're offended about something I have no control over
 
apologize
 
no?
 
I'll say sorry when you bump into me, but I'll be damned if I apologize for music from our country that was inspired by music from yours.
 
plx
 
7:05 PM
Ill apologize for drake when you apologize to all the JQuery users for hating so much
 
Drake and jQuery both make me cry.
 
I use jQuery at work; it doesn;t mean I have to like it. Same goes to you. Once you apologize for liking jquery, I'll apologize for hating you
Drake the type of nuqqa to use jquery
 
DONT TELL ME HOW TO LIVE MY LIFE
 
I think the real question here is which is worse, drake or jquery?
 
jQuery
I can ignore Drake
 
7:08 PM
$('drake').toggle()
 
Drake doesn;t effect my work life, so jquery
$(drake).remove()
 
jQuery, for the same reason @rlemon gave
 
I need one more CV on AskUbuntu
 
Most days go by without a mention of Drake, but I can never escape jQuery.
 
who has repz?
 
7:11 PM
u need ?
 
aka easy questions
 
420 answers bitches
 
do you use some program to manage your individual projects?
like TODO list, issues, etc
 
gitlab
has todo lists, issues, wiki, and code storage
 
7:12 PM
like github
 
when I do $('.class.1') my script quits, but I use it successfully in the console. Is there a workaround?
 
@Neoares it's an open-source clone of github, yeah.
 
ok thanks :)
 
DO, GCE, and a few other providers will also spin up a Gitlab instance for you automagically
we use it here at work with ~125 users hitting ~285 repos with about 35GB of data on a 2 core/4GB server
 
7:18 PM
apple music is bad because it's not on android
 
One less reason to use android +1
 
no
I like OSX, but iOS is just poop
 
I agree
 
Morning'
 
How can you delete text in vim @ubuntu 15 in insert mode?
del doesn't work
 
7:27 PM
yikes
if (this.article.attr('data-mode') === 'column' && e.target.tagname !== 'A' && !Util.isFreeBusiness()) {}
 
@Catgocat backspace and delete work normally in insert mode, otherwise drop out to visual mode and use dw or dd
 
user1596138
@ssube in case you cared about what was going on... jsfiddle.net/bbos1ej2/3 stretch the window slowly and watch
 
@Catgocat backspace and delete
 
@ssube In my terminal, in vim, delete doesnt work
 
@Catgocat then it probably isn't vim.
 
7:30 PM
It uppercases every letter
@Nolski shutup
 
@Catgocat Beep Beep: be nice.
 
@Catgocat then your terminal is broken
 
@Catgocat guess you gotta switch to emacs now
 
It's not, I think it's my keyboard layout
my vim is really fucked up
my arrows print D A B C
for some reason
 
I assume you've cleared out your vimrc?
 
7:34 PM
I've added some lines
to see if it solves the problem, but having no success so far
 
I mean if your vimrc is empty then by default vim shouldn't do that. If the problem still exists then maybe it's some settings with your keyboard or something
 
Yeah I use portuguese layout
 
maybe bad drivers or something idk
 
0
A: ES6 read-only enums that can map value to name

ShmiddtyThis does a pretty good job, IMHO. console.log=(...r)=>document.body.innerHTML+='<p>'+r.join('&nbsp;')+'</p>'; function Enum(a){ let i = Object .keys(a) .reduce((o,k)=>(o[a[k]]=k,o),{}); return Object.freeze( Object.keys(a).reduce( (o,k)=>(o[k]=a[k],o), v=>i[...

 
Yeah, my backspace doesn't delete
Delete works but backspace doesn't
it's like I am in the command mode
but I am not
Oh wait, backspace is working but only If my cursor is within a whitespace character
Noup, really fucked up
 
7:39 PM
> You all should go write code instead of chatting in chat rooms — someone 2 days ago
 
no
I have to poop, but I don't want to until I get home
 
I officially hate vim
 
Just like Jesus, one day you will come back to vim and it will forgive you.
fun fact: Jesus used vim
 
@NickDugger I only sit on thrones I own.
 
"Get thee behind me Satan" was translated from the Hebrew vim command :dk satan
 
7:46 PM
I've had to poop since like 2:30
 
I've had to poop since 6/1/2015
 
It's like THE FUCKING SHORTCUTS DON'T FUCKING WORK
 
see a doctor
 
@Catgocat true story. almost.
 
three-ass-mode bitch text editor
 
7:47 PM
vim was never meant to work. it is only made to belittle noobs.
 
historically VIM doesn't suck. if it is fucking up, you suck.
 
I'm pretty sure it works: I use it all day. It's just confusing at first.
 
personally it does
I mean it doesn't but it is so frustrating
 
is this your first pure CLI editor?
 
only nano is a working text editor.
 
7:49 PM
I mean why my arrows are printing letters and why backspace and delete uppercase characters?
 
it has an extremely high learning curve in exchange for being very efficient later on
 
so
what are your thoughts on apple opensourcing swift
 
@ssube like most if not all cli
 
open sourcing is always a good thing.
 
@rlemon this is true
 
7:50 PM
learning how to SQL from the command line took like 4-5 days to get it down pat.
SO MUCH NICER than a freaking web gui
 
hrmph. Is it usually ill-advised to completely override a provided method by a library? It doesn't seem to match my goal very well
 
@corvid almost always. Don't replace anything you don't own.
 
yea, because you don't know who else will call it expecting the original behvior
 
If you need to do that, use an extension method foo(target, a, b)
 
think again why you need a library which is not doing what you want.
 
7:51 PM
Should I instead just make a method like Accounts.inviteToGroup and take the code from the original method? What's the proper way to do it?
 
Interesting question @ssube and interesting answer @Shmiddty
 
I'd duplicate the method with your changes.
 
or just call the original method
 
for the reasons listed above
 
in your own method, i mean.
 
7:52 PM
@ssube why guard against adding enum values?
 
@akaRash Company is requiring using it. Basically, Meteor comes with Accounts.sendEnrollmentEmail, but I want it to have the functionality of inviting the a group rather than to the site as a whole.
 
@BenjaminGruenbaum against adding what now?
 
fair enough
 
@ssube enum values - why would people do that?
 
@BenjaminGruenbaum freezing is good mostly to prevent accidental assignment, especially assigning to the enum value vs a variable containing it
 
7:53 PM
Also, TypeScript has enums, just saying.
 
TypeScript looks sweet. Is it worth picking up?
 
TS doesn't work with ES6 until 1.5 comes out, at least
 
So if you're doing that - just use enum
 
@corvid it's great for large codebases where static analysis is helpful
 
Oh, you were mentioning it in your question
 
7:54 PM
@BenjaminGruenbaum the TS enums still aren't entirely constant, though
 
Is ES6 a better choice?
 
plus, I really want the ES6 features that aren't in TS yet, like modules
 
@Shmiddty you gonna be around in like a hour and a half?
what timezone you in?
 
why should enum values be integers or other unrelated stuff?
 
@akaRash doesn't really matter what they are
 
7:56 PM
TS doesn't have modules?
 
they're integers out of convention, since most old languages used int to store them
 
@ssube so just put them as the enum keys itself?
that way you have the reverse mapping out of the box
 
@NickDugger they had their own system for it that isn't compatible with ES6
 
OK so :set nocp seems to fix the problem
 
@akaRash not sure what you mean
 
7:56 PM
@ssube oh, I see what you're saying
Yeah, TS looks more and more like ES6 all of the time
 
just a sec
 
If I create .vimrc at ~, should I write set nocp ?
eheheheheheheheheehehhe
heheheheheheh
guess who has his vim working properly?
hehehehehe
 
hehehehehehehehehehehehehehehehehehehehehehehehehehehe
heman
 
Confirmed, phone interview with UnitedHealth Group tomorrow at 4pm
 
7:58 PM
@Catgocat me
 
@ssube very funny mr. ssube
 
@NickDugger that's the goal, tbf. They wanted those features out early, with stronger typing.
 
cc @Zirak @BenjaminGruenbaum @rlemon ^
 
@MadaraUchiha where/when did that happen?
 
user1596138
7:59 PM
heman.hasThePower = function () {
  return true;
}
 
@Loktar lemme find a link lol
 

« first day (1696 days earlier)      last day (3246 days later) »