« first day (1912 days earlier)      last day (3050 days later) » 
00:00 - 22:0022:00 - 00:00

10:00 PM
Also, what's elem()?
 
crl
document.createElement() I'm super lazy
 
Why are you replacing the elements in els instead of returning a new array?
Or a node list or whatever?
 
crl
it's an array, well, because it's one more line :), and it does the same
 
@crl Your function does 3 distinct things
That's not very healthy.
And it most certainly not does the same.
 
crl
yes, it's actaully a filthy hack for making document.execCommand work with newer tags like <strong>
 
10:02 PM
Also, what's elements here?
 
crl
a NodeList
function hack(cmd, oldTag, newTag){ // use it with hack('bold','b','strong'), hack('italic','i','em')
	var r=getRange(), cs=[r.startContainer,r.endContainer], os=[r.startOffset, r.endOffset];
	cs= switchTags(editor.querySelectorAll(newTag), oldTag, cs);
	r.select(cs, os);
	setRange(r);
	document.execCommand('styleWithCSS', null, false);
	document.execCommand(cmd, null, value);
	r=getRange(), cs=[r.startContainer,r.endContainer], os=[r.startOffset, r.endOffset];
	cs = switchTags(editor.querySelectorAll(oldTag), newTag, cs)
 
@crl Instead of hacking at your elements at the DOM level and changing the state in ways you won't be able to follow a week from now
Why don't you just create a decorator around document.execCommand()?
Step back, what's the high level goal?
 
crl
yea I did, I just changed the code to make document.execCommand appear, so it's more clear what it does
it's for doing a wysiwyg, and support 'newer' html5 tags
it's a bit nasty/hacky/ugly the code above, it replaces to old tags, execute the command and replace again
execCommand does a lot of magic for merging nodes, and for applying in through 'block' elements (like tables list...)
 
I hate WYSIWYG text editors.
They're always horrendously hacky.
 
crl
normally people do it without hack, but that would take thousands of LoC
 
10:07 PM
@crl Are you planning on maintaining it?
 
crl
yes
 
So it's well worth the thousands of lines of code.
Especially if you do it right.
 
crl
isn't it easier to maintain short code?
 
@crl There's a correlation.
But no, shorter code does not strictly equal easy to maintain.
Otherwise, we'd all be writing obfuscated JavaScript.
Same principle.
Immutable is easier to maintain. Testable is easier to maintain.
 
crl
I mean short but readable (at least by me :))
 
10:09 PM
@crl You from 3 months from now will curse you from now.
 
crl
yea, true, I did that recently hehe
 
It's readable now that you've written it recently. But trust me, it will not be when you take a small break from it, and the return..
 
crl
I'll also put longer names, to be less confused
 
The names are important, but that's not the point here.
You have functions that do many things at once, and mutate just about everything while doing it.
You're creating one hell of a spaghetti.
var app = new Magic();
app.doApp();
 
crl
yea, the rest of the code is worse, my mind is a spaguetti plate anyway
several unpure functions, I'm working on it, to clean that
and make it with class, maybe too, thanks, I like to make it work first, refactoring is easy
 
10:13 PM
@crl No, not really.
Not without tests or a proper architecture. Refactoring in small units is very easy
Assuming you have small units :)
 
what if I have just one big unit?
 
@Mosho Size doesn't matter. It's how you use it.
4
 
biggest lie in history
 
That's a joke that's better for hangouts :D
 
s/inch/LOC
 
10:17 PM
> Language: JavaScript

Recursion - Not my Favorite Topic.

Promises - They can get confusing.

Recursion + Promises - I need to program in a padded room.
lol, great way to start a question
 
wow, chrome's speechSynthesis is so powerful 0.o
 
Anyone know how to upload images to a git repo. I tried git add, git commit, and git push
but it didn't seem to work
really unsure how else to go about it, and google has turned up nothing that helps
 
"git add, git commit and git push" is basically all you need...
How did that not work?
 
crl
10:32 PM
usually it gives an error message.. and usually you try to say it instead of saying "it doesn't work"
 
11:05 PM
is there a tool to help me refactor folder structure with es6 modules?
standalone or webstorm or idc
 
webstorm does an okay job
at least with TS
 
like, I want a complete overhaul
hundreds of files
 
it's not good enough for that
 
cracks knuckles
 
mv?
 
11:08 PM
would that edit my imports?
didn't think so
 
Yes, yes it will
 
some day your lies will be the end of you
 
As long as I have chocolate milk, pancakes and pizza, I'll be fine with any earthly demise.
What about you though? What shelters your soul? What's your mental armor?
 
cocaine
 
crl
!!> undefined+'' // should return '' imo
 
11:12 PM
@crl "TypeError: undefined has no properties"
@crl "undefined"
 
crl
gj killer
 
11:31 PM
why does that white man have a crooked black cock
 
well now
 
crl
albino
 
Any utility to debug an HTTP server with ? (as in monitor all traffic and stuff)
 
crl
other than logs and debuggers?
 
@crl I wrote it, (well hacked it to work on android)
 
11:44 PM
fiddler
ghostlab
 
* STATE: INIT => CONNECT handle 0x2004a198; line 1090 (connection #-5000)
* Rebuilt URL to: 192.168.1.5:4322/
* Added connection 0. The cache now contains 1 members
*   Trying 192.168.1.5...
* STATE: CONNECT => WAITCONNECT handle 0x2004a198; line 1143 (connection #0)
* Connected to 192.168.1.5 (192.168.1.5) port 4322 (#0)
* STATE: WAITCONNECT => SENDPROTOCONNECT handle 0x2004a198; line 1240 (connection #0)
* STATE: SENDPROTOCONNECT => DO handle 0x2004a198; line 1258 (connection #0)
> GET / HTTP/1.1
this is what curl output
does that mean it actually connected, and then my server die ? (I kinda think thats what happened)
 
crl
can you put logs in the server?
 
yep logs nothing.
Dunno whats failing.
 
crl
wrong port/address maybe
 
nope
I doubt it will send the GET Headers without connecting to an HTTP server, will it ?
 
crl
11:50 PM
that's maybe just the client headers, dunno curl sorry
 
chrome connects and just waits.
 
crl
try an ajax reqest in browser, and check the onerror, or just see the network console tab actually
oh it hangs
 
This code is correct?
.find('[id^="voteup-"]')
 
Listening on Object {socketId: 50, server: HttpServer} 4322
chrome-tcp.js:22 Accepted Object {socketId: 50, clientSocketId: 38}
chrome-tcp.js:117 Closing the pipe Object {socketId: 38, serverSocketId: 50, isOpen: true}
@crl ^ server logs
 
crl
does it ever send a response lower in the code and does it reach that point?
 
11:57 PM
nope
it doesn't even get any data
Accepted basically means that the client's connection was accepted.
 
crl
probably a wrong piping thing, well if it's a GET there isn't much to read from body, can you just try to send a basic response after line 22
 
00:00 - 22:0022:00 - 00:00

« first day (1912 days earlier)      last day (3050 days later) »