« first day (1921 days earlier)      last day (3032 days later) » 

5:00 PM
YES IT IS. AGREE WITH ME
 
@ndugger I disagree with you
 
Nothing wrong with it at all
 
bitch
 
user1596138
It makes total sense if you had an endpoint that supported GET, PUT, POST
 
@ndugger uh, that's what REST encourages, you know?
 
5:00 PM
GET when you need info, POST when you're updating it
 
user1596138
Nobody uses PUT?
 
PUT when you're adding a new one
 
user1596138
^
 
@ShotgunNinja POST is new, PUT is update
 
Flock to my defense, room. Together we shall destroy this Blackbeard!
 
5:00 PM
POST /categories, GET /categories, PUT /categories
 
@ShotgunNinja no, PUT or PATCH is update
 
user1596138
Although I have only once actually used all 3
 
POST on a collection is new
 
I usually don't use PUT, because I was raised on upserts
 
@ShotgunNinja PUT isn't for adding anew one, it's for posting to a specific location, like if you want to PUT to '/message/{id}'
 
user1596138
5:01 PM
POST all the things
 
wait
 
GET / is all, GET /:id is one, POST / is new, PUT /:id is replace
 
I POST my GETs
 
but I can totally see POST for adding and PUT/PATCH for updating
 
user1596138
@ndugger PUT is edit specific existing one
 
5:01 PM
@ssube s/edit/replace
 
@jhawins Yeah, sorry, meant to reply to someone else
 
user1596138
No big deal if someone got it backwards. That's why we have Google when the time comes to use it.
 
PATCH /:id is edit
 
bikeshedding
 
@ndugger how would you translate that snippet into blackbeard, just out of curiousity?
 
5:01 PM
@FlorianMargaine in a good, auditing system, yes
 
@SterlingArcher I GET my POSTs and then POSTBACK to the prerender.
 
@ssube at work we use a library that takes care of all of that for us :)
 
// const user = req.body.user;
// const pass = req.body.pass;
// const email = req.body.email;
const [user, pass, email] = [req.body];
yields
Shouldn't it map to all 3 variables?
 
const {user, pass, email} = req.body
 
5:05 PM
Ahhh fuck
 
user1596138
lmao
 
brackets..
lol my email..
 
@SterlingArcher Well, my router doesn't support multiple methods on a route, but it would be something like...
@Controller
@MapRoute('/account')
class MainController {

	@MapRoute('/', GET)
	async create () {
		return new View('index')
	}

	@MapRoute('/submit', POST)
	async createSubmit (request) {
		const data = JSON.parse(request.body.toString());
		const { user, pass, email } = data;
		return await Account.create({ user, pass, email });
	}

}
 
Compared to
app.route("/")
	.get((req, res) => res.render('createAccount.ejs')) //render form
	.post((req,res) => {
		//destructure form body into constants
		const {user, pass, email} = req.body;
		createAccount(user,pass,email).then(response => res.send(response)); //create/reject account, send to user
	});
 
@ndugger not even multiple functions?
 
5:07 PM
Iunno man
 
user1596138
@ndugger I'm a fan of simplicity > hipstery ;)
 
user1596138
Sterling wins
 
HRNNGGGG
 
@SterlingArcher More lines does not mean bad--I'd argue that mine is more readable, though I am arguable biased
 
@SterlingArcher .then(res.send.bind(res))
 
user1596138
5:07 PM
Assuming it works lmao
 
@jhawins Mine is very simple
 
see, i would have expected const {user, pass, email} = req.body to give an object. why i don't like destructuring that much. I see {...} and immediately think object, so i generally stay away from it.
 
user1596138
@ndugger There's only 4 decorators lol. Just trying to be hip
 
> I suck at something so I stay away from it, this way I'll never improve!
 
user1596138
Then there's the code in the decorators..
 
5:08 PM
@FlorianMargaine what about the response object?
 
@SterlingArcher duuuuuuuuude.
my message meant "replace .then(response => res.send(response)) with what I provide"
 
@jhawins Disliking decorators is the same as disliking any functions. Do you need to be able to see the code inside of jquery's "$" in order to use it every time?
 
createAccount(user,pass,email).then(res.send.bind(res));
?
 
Explain -- because response is an object with a status message
 
user1596138
5:10 PM
res.send.bind(res) returns res.send() with the context (this) as res
 
someCallback(function(foo) { return bar(foo); });
someCallback(bar);
are the same ^
 
think of it like
 
function reference is a beautiful thing
method reference is just pants-ruining
 
!!> ['1234', '5432', '7643564'].map(Number)
 
5:12 PM
@ndugger "1234,5432,7643564"
 
those are numbers now... cap doesn't make it obvious
 
How did I not know this
 
!!> JSON.stringify(['1234', '5432', '7643564'].map(Number))
 
@ssube "[1234,5432,7643564]"
 
Aye, that helps
 
5:14 PM
I opened my window lol
still continuing to drop haha
(my gpu temp ^)
 
Are you cold, though?
 
@ndugger a little, getting colder in here
 
51C is hot as shit, though
 
my PC is positioned perfectly to take advantage though
Yeah I have 290x's they run hot
 
like ~100F (fuck math)
 
5:16 PM
they get up to like 81C when gaming
 
what the hell
 
@ndugger in the summer it is ridiculous
it's why I have a portable AC unit just for my room
 
You're gonna boil your computer
 
@ndugger Not really, mine run around 60
 
haha nah, they are made to run at those temps (the 290x's)
my processor is water cooled runs at like 29c always
 
5:17 PM
because they have to
 
alright closing the window.. they got down to 38c coldest I've seen it lol
 
I game on an emachines windows xp tower
 
@FlorianMargaine very nice, destructuring and binding worked great :) Thank you
 
I want you all to know that I never know what I'm talking about, and I always make everything up.
 
a record for me lol
had to close the window though my hands are freezing.
 
5:20 PM
lol, so mongo tried to fuck us this morning
 
@SterlingArcher that reminds me how much I love es6 shorthand props
 
sometime over the weekend (maybe), one of the secondary nodes stopped using 7 of the 8 cores on the machine
for some reason, having one secondary running on a single (pegged) core made the other secondary slow way down
 
@Loktar What kind of a build do you have by the way?
 
and just totally screwed everything
 
@Loktar I'm having a blast writing this in ES6. Import and export modules rock, destructuring rocks, arrow syntax rocks, consts rock
I love this
I feel like My game actually has a good code foundation now
Before.. it was speaghetti code
 
5:21 PM
now async/await
 
@Loktar what software is that?
 
^ That one I'm not sure about. Isn't it ES7 proposed?
 
@KendallFrey MSI afterburner
it's free, and works well
 
@SterlingArcher ES2016, and guess what year it is? You're using babel now, right?
Just use it and be happy
 
@SterlingArcher and unstable
 
5:23 PM
Don't listen to ssube--he hates all new features
 
I'm pretty happy with then :D
 
* AMD FX-9590 with h100i cooler
* 2 xfx double d 290x's
* G.SKILL Ripjaws Z Series 32GB
* Asus Crosshair V Formula z
* Corsair hx1000i psu
* Intel 730 SERIES 240 GB ssd
* Sandisk 150gb ssd plus
* 3x Western Digital Blacks 2TB
 
If he had it his way, we'd all be instantiating functions
 
@Cereal ^
 
Well I just came
 
5:23 PM
@ndugger you kidding? classes are like my favorite thing of ever
 
This year is upgrade year though
@ssube same here
 
liar
 
@Loktar why no revodrive?
 
Speaking of, should one use this in a class?
 
yes
 
5:24 PM
classes and modules encourage organized code and make it so much easier
 
@ssube hah maybe next build idk
 
You can't not
 
@SterlingArcher absolutely
@Loktar I got a 240GB one, years ago, and it's great
I think write maxed at 1.5GB/s
 
I know how this works, I just vaguely remember somebody telling me to stop using this in relation to classes
 
windows boots in seconds
 
5:24 PM
No it can't; stop scaring him--he's delicate
 
nice, yeah my only issue is using a PCI slot, I hate blocking airflow to the gpus
 
export class Player {
	constructor(id,name) {
		this.id = id;
		this.user = name;
		this.x = Math.floor(Math.random() * (100 - 1 + 1)) + min;
		this.y = Math.floor(Math.random() * (100 - 1 + 1)) + min;
	}
}
So this isn't bad?
 
@SterlingArcher Whoever told you that was not a javascript developer
 
@Loktar liquid :D
 
@SterlingArcher You can't do this any other way
 
5:25 PM
Not having a space after the comma in those parameters is bad
 
Whoever told you that is dumb
 
@Cereal picky :P
Kewl
 
also yes, please don't be afraid of your space bar--white space is good
 
>:(
 
yeah that is totally fine @SterlingArcher
 
5:25 PM
I agree
 
classes are pretty nice, idc if they are sugar I like looking at them and using them because they are sweet :p
 
Easier to understand than .prototype
 
@ndugger space isn't white, you capitalist imperialist men-first ableist anti-ethnicity 1%er
 
black space?
am I doing PC right?
hispanic space?
safe space?
 
Blank space
 
5:27 PM
multi-cultural non-binary space
 
I had the weirdest dream last night where Taylor Swift was found dead... It was bizarre
 
Oh kick ass, sockets have middleware!
 
@SterlingArcher What's 100 - 1 + 1 doing? Why not just have 100?
 
lol
 
The socket.io docs are really well written
 
5:28 PM
100 - 1 + 1
jordan pls
 
Wow
How did I miss that
 
that could cause floating-point issues, if the compiler didn't optimize it out
 
See, I'm not a complete leech.
 
@SterlingArcher :)
Although to be fair destructuring is terrifying
 
5:32 PM
How long until you're done the game?
 
On going. I've spent what... 3 weeks on the routing and account creation?
 
Wasnt a good chunk of that re-doing it though?
 
@ton.yeung becuase it feels like it lol
 
@ton.yeung How could one ever answer that?
 
@BenCraig all of it was a redo, my old version only had a map system, which I'm changing to redis
My code gets reviewed harshly everyday lol
 
5:34 PM
@SterlingArcher Gotcha. I look forward to trying it out
 
@Waxi nah, there are better tools
 
Ummmmmm pulled pork burrito
I'm in heaven
 
He's using express, which as much as I hate, is a decent, strong foundation that's already been vetted.
 
Why are browsers stuck in the 90's when it comes to styling form elements? Shit pisses me off like no other.
 
5:37 PM
flexbox is not for styling form elements...
 
lol. My problem was styling checkboxes, but I guess I'll just go the image route.
 
crl
codefuckingmirror jsbin.com/hakipo/edit?html,js,output there must be a better way, without using a textarea no?
 
@ton.yeung I just want the default checkboxes to be bigger. The quickest way I've found was using transform, but it made it look pixelated.
@crl Use a div and set contenteditable to true?
 
@Waxi I wrote a tutorial a long time ago... gimme a sec
I think
You can change a lot of the code, just borrow the concepts
 
Just thinking outloud here -- I can either a) have my socket routes ugly and inside my server.js file, where I won't have to do any passing (sockets will be storing in redis), or I can modularize my socket routes, and pass redis into the functions.
Which is better practice?
 
5:42 PM
When I wrote it, chrome didn't listen to events on pseudo elements, but you can make use of them now instead of having an extra element
 
@ndugger Perfect...I don't mind using images in CSS.
 
My thoughts go with passing redis, since I don't want to clutter server.js
 
@Waxi you don't really have a choice. Also, I would advice against scaling them. They don't play well on some devices.
 
@ton.yeung Eh, the tutorial could use some work, since a few things changed in browsers, but the core concept is the same
 
@ssube you're a redis guy. Is it "safe" to pass redis in a param?
 
5:45 PM
@littlepootis Noted, thank you.
 
io.use("/someRoute", () => func(redis))

...

export function func(redis) {
	doStuff();
	redis.set(someKey, playerObj)
}
 
I never knew about the :checked pseudo selector...neat.
 
@SterlingArcher that concept is not related to redis
@SterlingArcher it's called "dependency injection"
 
Oh, just like how Angular does it
 
@SterlingArcher you could just import the package, but yeah, passing it in as the argument could be seen as a form of DI, so that should be fine
 
5:47 PM
dependency injection isn't something fancy
 
DI can get messy, though, so I like to avoid it when I can
 
it's just having the objects you need passed to yoj
it's just having the objects you need passed to you
 
@ndugger my worry with that, is I have to create the redis connection somewhere. I don't want to keep definining the client
That seems like a good way to lose data or something
 
@SterlingArcher you don't have to
 
@ton.yeung no, that's a dependency injection container
 
5:48 PM
Node caches modules
 
In case anyone cares.
 
which isn't the dependency injection concept
 
@ndugger so you mean I don't want to keep my redis connection open?
 
In software engineering, dependency injection is a software design pattern that implements inversion of control for resolving dependencies. A dependency is an object that can be used (a service). An injection is the passing of a dependency to a dependent object (a client) that would use it. The service is made part of the client's state. Passing the service to the client, rather than allowing a client to build or find the service, is the fundamental requirement of the pattern. Dependency injection allows a program design to follow the dependency inversion principle. The client delegates to external...
 
@ton.yeung we discussed this yesterday, youtube.com/watch?v=RlfLCWKxHJ0
 
5:49 PM
@SterlingArcher gimme a sec to see what I did in blackbeard
 
class Car {
    constructor() {
        this.engine = new Engine; // no DI
    }
}
class Car {
    constructor(engine) {
        this.engine = engine; // this is really all DI is, passing things in instead of creating them
    }
}
 
@ton.yeung no, that's just one way to do it
@BenjaminGruenbaum nice!
 
@SterlingArcher nevermind, use DI to pass it in; I forgot how the redis api worked for a moment
 
@ton.yeung you can see it that way, yeah
 
5:51 PM
@SterlingArcher G ping
 
@BenjaminGruenbaum Would chakra-node only run on windows? It would seem so, due to the nature of their engines
 
well, the interface isn't named (duck typing), but the idea is the same
 
!!afk stuff
 
@ndugger it would, but it'd still help a lot.
 
I have nothing against it, I just wish it could run on other OSs
 
5:55 PM
@ndugger I believe it has to do with Node not running on some windows oses.
 
@SterlingArcher what do you mean?
 
@ssube SterlingArcher is afk: stuff
 
an open connection or DI?
 
user1596138
Every startup I interviewed with in SF doesn't exist anymore lol.
 
@ssube both
 
user1596138
5:56 PM
9 of them.
 
user1596138
Thank god nothing worked haha
 
@jhawins wow
 
@FlorianMargaine I've never made up my mind on that. Do you pass the class and options, a factory, or an already-opened connection?
Especially for cheap high-conn stuff like statsd or redis
 
damn that was a good burrito
 
@ssube depends on what I use. For db I usually pass a pool factory
for redis I don't know.
@rlemon I'm so hungry
 
5:58 PM
@littlepootis Nah, it's because Chakra is actually a really good engine, and MS wants to take over the world
 
@ssube isn't redis driver using a pool?
 
@jhawins that's why I refuse to work for early startups anymore
 
@littlepootis node works on windows but few servers run it
@FlorianMargaine not sure
 
it's really about whether the driver opens a new connection every time.
 
I'm alright with there being a windows only version of node. I mean, it restricts you to only run your site on a windows server, but it's just the server, so it doesn't matter all that much
 

« first day (1921 days earlier)      last day (3032 days later) »