« first day (1922 days earlier)      last day (3031 days later) » 

12:04 AM
Can I write this line more short?
if( document.getElementById("qandatextarea") && document.getElementById("qandatextarea").value == ''){
 
var el = document.getElementById("qandatextarea");
if( el && !el.value ) { ..
 
ow :-)
tnx
 
creating local variables is cheaper than DOM calls for this stuff. cache the element pretty much always.
 
Good point ..
 
I thought destructuring was meant to handle null/undefined
 
12:11 AM
@phenomnomnominal I don't think he's using es6
 
yeah I was just trying let { value } ...
 
Finish that example?
 
let { value } = document.getElementById('qandatextarea');
if (value) { ... }
 
let { value = {} } = foo();
^ this would handle falsey iirc
 
hm..
 
12:15 AM
not according to the transpiled
 
not in that case
 
it would throw if the element didn't exist
 
the if case doesn't work
6 mins ago, by phenomnomnominal
I thought destructuring was meant to handle null/undefined
I was showing you a case which destructuring would handle null
:P
 
Oh yeah
 
ohh, that's where the null is.
the element.
 
12:17 AM
yeh
 
the 2ality article on destructuring is long, but very good imo
 
let { value } = document.getElementById('qandatextarea') || { value: 'nothing' };
 
quite complete
 
not sure I like that.
 
12:18 AM
very very good blog
I suggest everyone bookmark it :D
 
or am I misinterpretting that?
 
@phenomnomnominal 1.6
default values
 
You did. The example they have is as if the element just was missing a value property, not null itself
 
let [x=1] = [undefined]; // x = 1
 
ahh
Hmm, that's annoying
 
12:20 AM
but in both cases, there is {} or [] being passing in.
 
let { elm = document.createElement('canvas') } = document.getElementById('canvas');
 
apparently there's a whole culture of enterprise code 0.o Never heard about it
 
could be handy
 
12:21 AM
let [x=1] = undefined; // can't read property 0 of undefined
 
what about let { value: { foo } } = {}
^ doesn't work either
 
I gave you the answer above.
4 mins ago, by Luggage
let { value } = document.getElementById('qandatextarea') || { value: 'nothing' };
 
Brian will is the owner of codeschool.org A veteran
 
I know what you should do, I'm just showing what I wish it would do :)
 
ah
?.
 
12:24 AM
    let [{ value: foo } = {}] = [];
@phenomnomnominal ??
 
yeh ugly
@Luggage yeah I'm used to that from coffee
try {
    let { value: { foo } } = {}
} catch (e) {}
 
f that.
 
yeh obviously :)
 
ugh, I've had this plant in the house for a few months.. cat finally decided it looked tasty.
it isn't good for him. he just puked behind me :/
wooonderful
 
just makin' room for more plant.
 
12:28 AM
well I've moved the plant now :P
it's hit or miss. some plants they leave alone. I have german ivy growing and they don't touch the stuff (also toxic to them)
but they destroyed my money tree
 
then what will you wipe away your tears with?
 
more tears
Money Tree (the common name)
according to google it is a type of Chestnut
TIL
 
yeah we have one
inside the house, my wife takes care of it
 
I had one :P
 
Fitting every problem into the mold of classes felt like playing a fool’s game with no right answers.
 
12:37 AM
I like the class keyword
sure it is abstraction / sugar
but it shows proper intent
 
sugar for a ubiquitous pattern.
 
exactly.
 
Did we read that article I posted? I learnt about computer bits and bytes from his lectures.
 
I contacted some of my artist friends, because I want to fill my walls and, one of my friends is letting me pick from her favourites, and god damn, this is an amazing photo m.flickr.com/#/photos/126591940@N03/19682286068/in/…
 
@overexchange there are lots of opinions on design patterns and why they are the best / worst / succeeded / failed.
I'll read it, but the title didn't sell me
 
12:41 AM
You can trust Brian will You can check his clarity on basics at codeschool.org
 
If anyone in here is an artist, I'll have some empty walls to fill when I move in on the first; Ping me!
 
there are lots of smart people who differ on opinions on design patterns
you can read them all and trust yourself to use what fits best for you and your product
... I just coughed with my hand in my pocket and somehow ripped my jamma pants
:(
@overexchange I've read it, not convinced. :/ he makes good points but at the end it sounds like one mans rant about why he dislikes the pattern.
is anecdotal the correct term?
 
some code fits well into classes, some does not
 
1:02 AM
Hrm
 
@SterlingArcher I got my flight tickets done :P
 
@Abhishrek :(
 
sunday morning I leave herndon
 
@SterlingArcher bro
 
monday evening I leave states, the thing I will miss the most is internet and toilet paper :P
 
1:04 AM
I thought you were leaving in february!
@rlemon bro
 
@SterlingArcher It was cheaper to leave now
by like $500 (including stays and stuff)
 
@Abhishrek damn man. Well, since friday is apparently heavy ass snow.. shall we get dinner thursday?
 
Oh
whenever you prefer man
 
@SterlingArcher BRO
 
@rlemon @SterlingArcher BRO's
@SterlingArcher how much are morning flights affected by snow (If it lasts till sunday)
 
1:06 AM
Thursday is safer because we could get snowed in friday
 
bro..
 
@rlemon bro what D:
 
I hope the flights don't get delayed much :-/
 
Me too
 
Cause I have a connect flight from Moscow in 1 hour 50 minutes and I want 2 fun days in NYC
 
Jesus you have to go through russia to go home?
 
@SterlingArcher or Saudi Arabia
 
or Sri Lanka (49 hours for that one)
I prefer Russia x)
 
0
Q: How to define the css :focus state in a jQuery selector?

stackHere is a resizable textarea: var KeyDown; $(".TxtArea > div").mousedown(function(){ $(this).parent().addClass("Resize"); $("body").addClass("UnSelectable"); KeyDown = 1; $("textarea").css("opacity","0.3"); $("textarea").focus(function() { $(this).css("border-color","...

 
1:12 AM
@rlemon have you ever bound an object to an app.use route?
Err, injected a dependency into a routing method?
I'm not sure how to explain it
 
you just attach values onto the request object, usually.
 
what are you trying to do
 
well, there are more sophisticated ways, but that's how middleware often works
 
Sooo I need to create a session based Player instance, when you login
Something globally accessible
 
using express-session ?
 
1:17 AM
Already using. Should I just req.session.player = new Player(user.id, user.name);
That way I can access it via socket and express session?
 
yes
and if it doesn't work, no
:D
 
lmfao
I'll give it a shot!
 
@SterlingArcher it won't work
when deserializing the object javascript will have no clue wtf class it belongs to
 
that instance of "Player" should be serializable if you want to support scaling to multiple processes at some point.
 
1:19 AM
Huh?
 
I recommend you go a lil functional there
const player = await Player.load(req.session.player);
where req.session.player saves only the uuid of the player
and you load the data in the load method and return a new Player Object
you can optionally store the name there too, but you will have to create a new object of that class
 
you sure he needs that if he's not clustering?
 
If hes not clustering he shouldn't need redis
 
@SterlingArcher if the session being serialized into redis?
 
honestly though he is doing too much, I mean firebase can handle this pretty easily. He won't even need a server :P
 
1:21 AM
is*
 
It will be. Each game will be stored in redis like:
 
2.9 bro you know i love you :D
 
@Abhishrek don't be rude
 
[ { gameID : [ { playerID : 1, name : Archer, derp : herp }, { ... }] }];
 
@rlemon sorry.
@SterlingArcher Redis supports taht :o ?
 
1:23 AM
Kind of like that. An array of gameIDs, each game id has an array of players
That's what ssube said
 
Makes sense
 
yes, redis can store a string, so it can store json.
or whatever.
anyway..
 
@Luggage but that will limit searching / indexing
 
When something happens in the game, I pull the game ID, pull the player, edit, and reup
or... pub sub.. gotta figure that part out
 
yea.
 
1:24 AM
And on game end, dump the data into mysql
 
@SterlingArcher In that case you should store only the player id in redis / session
 
so, req.session works? Where did we leave off?
 
but you will have to figure out how to serialize / deserialize
for example
 
What was the idea behind introducing Symbol data type? var sym2 = Symbol("foo");
 
did you ask google?
 
1:26 AM
@overexchange did you read the MDN on symbols?
@Abhishrek yeah I'll cross that bridge soon enough lol
 
//When initializing
const player = getPlayerFromSomeWhere();
req.session.player = player.uuid;
// when getting the player object
const player = Player.loadFromUUID(session.uuid);
player.doSomething();
That is assuming you have some functions in your Player class
 
how much you store in redis is your business. The point is that since you'll go cluster and use redis or a database or whatever, everything in req.session needs to be serializable.
 
1:29 AM
Objects are serializable, right?
 
not all
functions are not (easily)
 
Yes, but they won't de-serialize as a class object
 
just test JSON.stringify()
 
Are symbols?
 
yea, you'll have to re-hydrate a class.
 
1:29 AM
no clue
 
@Abhishrek AHHH I see what you mean
 
actually
I don't think symbols are
 
:P
 
Yeah I feel like they wouldn't be
 
JSON.stringify({[Symbol("foo")]: "foo"});
// '{}'
 
1:30 AM
@rlemon isn't there JSON with classes ? // but then where the hell will it get the class
 
no?
 
@rlemon yeh just did that too
 
So my Player.loadFromId method would return a new instance
 
@Luggage I hoped there would be some json implementation or rfc to add class support but then I realized that won't make any sense in javascript
@SterlingArcher yep.
!!should I make an example game with Firebase ?
 
@Abhishrek By all means
 
1:33 AM
make it with flash too :D
why not
 
@rlemon no -_- firebase is pure server less
try it once :D, you will fall in love with it.
!!topdown-shooter or side-scroller or fappy birds with multiplayer
 
@Abhishrek topdown-shooter
 
Got it boss!
 
fappy birds sounds interesting
 
1:35 AM
@SterlingArcher you shake your phone to make it jump
 
@rlemon what do you have against firebase ?
 
nothing
> just try it man. you'll love it!
sounds like a meth pusher :D
 
aha
Firebase is like meth. :-/
blame @AwalGarg
 
@Abhishrek That looks pretty nice
 
@SterlingArcher if you need art (look at that)
mmoasteroids.firebaseapp.com < running on firebase. HOLY COW
 
That's pretty awesome
 
2:00 AM
What the hell, you should not be able to paint like this etsy.com/listing/236437141/… -- Expensive, but super tempting...
 
Dude that's stunning
fuck I want
 
All of her art is just mind blowing
What the hell
 
it's jus the NSA selling satellite images without terrorists or russians in them.
 
lol
 
still my fave
 
2:04 AM
Is that skeleton time-traveling from the 80's?
 
I think so
 
2:43 AM
Wait a minute.. if I want a const to be accessible in any module.. can't I just import and export it??
:|
omg I can...
I'm such a retard
 
lol
 
3:06 AM
@SterlingArcher Importing and exporting in every module, just to get around not making a global variable? I dunno. At that point, I would honestly just make a global variable, lol
 
Async map movement is now active!
 
gratz
 
sweet, got your password
 
lol
 
3:14 AM
well, to be fair the password is literally "password" sooo..... you're not wrong lol
 
sweet, got your password in plain text.
 
gonna pwn your ass
 
DELETE FROM players;
:P
 
now, just open and forward the following ports and you are so fucked..
 
@SterlingArcher what's your address and can I have some flights please, I want to break in and delete your hd
 
3:19 AM
lol you do realize that exposed data has nothing to do with my server or db credentials right?
 
that's exactly what someone who's about to get pwned would say
 
Plus my server is cloud based :P break into github and digitalocean if you wanna ruin it
 
I'm a super good hacker
I'll hack your facebook account #hacked
#blessed
#jquery
 
Anyone taken a look at ChakraCore on GitHub yet?
 
3:32 AM
It's been brought up.
 
@DemCodeLines i couldn't get it to work, on windows.
 
@Abhishrek ...like...it didn't compile?
 
yes
i was missing some stuff vs2015
vOv
Will give it another try.
 
I was expecting the sample to be an app that contains a browser component that is being built off the that open-sourced code.
I got something completely different instead.
 
3:38 AM
> If you believe you have found a security issue in ChakraCore, please share it with us privately following the guidance at the Microsoft Security TechCenter. Reporting it via this channel helps minimize risk to projects built with ChakraCore.
@DemCodeLines try d8 (v8).
 
GitHub?
 
It will take a few days to download on slow connection.
 
Is it actually a browser?
 
@DemCodeLines Nope. It is just a small part of a browser.
 
@DemCodeLines if you want a browser that compiles from source you can take a look at chromium / node-webkit / electron-shell (Electron shell is my personal favorite cause you can just npm install it)
 
3:43 AM
Or operating system node-os.com... If you're into that sort of thing.
 
@Abhishrek I failed at phrasing my question. I meant the demos (the Android one for example). How are those demos showcasing v8? Running it inside a custom compiled browser?
@EvanPlaice wow
 
Full Firefox source code is available for build to Linux, Windows, Mac, Android (and Firefox OS sigh). The whole package, not some trimmed free parts.
 
is that new? I assumed firefox was available before
 
Not new. I am just surprised that Abhishrek didn't the mention it.
 
As a college student, I have been looking at some big-name OSS and trying to contribute (for the betterment of the software as well as improving my skills (& potential resume)). But I just seem to suck at it.
 
3:53 AM
Better do it when you have time. When you have the skill you may not have the time :p
 
chakra and node are gonna be some difficult project to just jump into
 
I would say most big name OSS are difficult to jump into for a student.
 
Over the past couple years, I have found that pretty much most GitHub projects are difficult for me.
 
Patient, padawan.
 
1. Make something. 2. Use other people's OSS code for some parts of it. 3. Find flaws from your own use, fix and contribute back.
You'll undoubtedly run into projects that do something really close to what you want. That's your chance to fill in the gaps for your use case and give that work back.
Don't shop around for some project you think will look good on a resume.
 
3:57 AM
^
 
@DemCodeLines Oh, right. Chakra is a JS virtual machine, much like Google's V8. It's also used in Node.js on the server-side. @Abhishrek had the right answer if you're looking for browser source.
 
I've been developing professionally for over 2 years now, and I'm still not good enough to contribute to most if any OSS
 
I've been doing it for about 3 years now, and I generally feel the same, though I know it's not true
 
@SterlingArcher Just start with your own then. Scratch an itch.
 
I just found my long lost account
 
3:58 AM
@Luggage To be honest, point number 1 is why I end up looking around GitHub aimlessly.
 
Which sucks
 
That's why I'm developing SourceUndead
to better my skills
 
I can't figure out what to make
 
@DemCodeLines start small. Build a realistic goal game
 
a templating engine
 
3:59 AM
Interesting. I have so many things I want to make, I know I can't finish them even in my life.
 
then, an asset server
 
@Sheepy same here... same here...
I could solve all the world problems if I just had about a million years to do it.
 
github.com/RUJodan/SourceUndead I've done this in 15 days, and I barely knew anything about Node or ES6 when I started
 
@DemCodeLines Build a cash register software, a forum software, a silly canvas game, a DOM abstraction, etc. The ideas are limitless; they don't have to be big and amazing and innovative.
 

« first day (1922 days earlier)      last day (3031 days later) »