« first day (2288 days earlier)      last day (2654 days later) » 

12:00 AM
@NathanJones Have you heard of CSS modules?
 
@MadaraUchiha no, researching now
 
webpack can do em, can't it?
 
@ssube It sure can
@NathanJones tl;dr allows you to import CSS files in JS, and then use classnames as properties of the imported object
import styles from './style.css';
// .someClass { color: red; }

const div = document.createElement('div');
div.className = styles.someClass;
This translates the CSS and the JS to use a unique class name, instead of the actual .someClass
Thus giving you isolation.
 
the browser support is pretty good, because it's just name mangling, not anything scary
 
Right
Only real problems I've had with it are tooling for its funny stuff
Like support for :global(.className), which disables its name changing for that class
 
12:05 AM
@MadaraUchiha i'm using sass to do that kind of isolation. but, in my case, i'm intergrating with a third party product that already has its own css. I want a way to create an isolated section of the dom where i can include my bootstrap, font-awesome, etc without it affecting the global css, and vice versa
 
you'd have to include bootstrap and FA in your vendor bundle and import them, but it could work
I think it would mean having your own CDN, too
 
@ssube if bs and fa are in my vendor bundle, wouldn't those css rules still be applied globally?
 
webpack should still be able to mangle them (@MadaraUchiha?)
as long as you're in control and webpack has the files...
 
@NathanJones sass doesn't give you that
 
12:08 AM
@Mosho You can, however, pipe sass into css modules
And get the same effect
 
@Mosho i think i misunderstood the example @MadaraUchiha provided
 
But then you lose the ability to :global I think.
 
if you don't use sass mixins and requires you can just use the same postcss compiler you use for css modules
 
@NathanJones It basically allows you to use the same classname in two different components, and have it mean a different thing for each component
 
it's real, hardcore, hash-based name mangling. foo-bar--baz becomes abf219e369123ac09-1
which then is almost certainly unique
or, even if it's not, it's hash based so the other thing with the same name has to be the same
 
12:10 AM
for dev it's ${pathname}__${classname} which is pretty useful
 
for(let x of [1,2,3]) { setTimeout(() => console.log(x), 250) }
Doesn't work in Firefox?
 
How do you quit what is forbidden ?
 
Indeed it's broken in Firefox
for(let x of [1,2,3]) { let i = x; setTimeout(() => console.log(i), 250) }
That works
 
hey yo
 
so firefox doesn't handle let x as a real block-scoped variable, huh?
 
12:14 AM
:D
 
Not in a for-of loop
 
by "is broken," you mean prints 3,3,3?
 
Hi to everyone
 
@ssube Yes
 
the old var-without-closure problem that let was supposed to fix
 
12:15 AM
for(let x of [1,2,3]) { setTimeout(() => console.log(x), 250) }
4
3
3
3
 
I've "created" a bot
would you like to try it?
 
that's what my ff does
@ssube @MadaraUchiha @Mosho thanks for your help
going to improve my react app based on what you said tomorrow
 
it's cool I think
 
hopefully remove the iframe
 
12:16 AM
I thought there were no browser differences and es5 was production ready in 2017
 
@SterlingArcher it's deleted
:/
 
aww he deleted it. A simple solution would be simply to check is a and b are not the same (odd/even)
 
@copy it is if you don't count IE8, 9, 10, or FF :D
 
@NathanJones Worth noting: If this is a third party we're talking about (ads, widgets, etc), an iframe is still probably the better solution.
 
It was a codewars thing.
 
12:18 AM
like?
 
now that IE is dead and MSFT is making Edge, and Opera gave up and is just Chrome, now FF gets to be bad
 
sripusly
 
@ssube Pfft please
Safari.
 
it's not JS
it's just a fucking image
 
12:18 AM
@MadaraUchiha Safari now fills the niche Opera used to, for hipsters and general bad people.
the kind of folks who wear a scarf with a hat and their hat doesn't even have a poof ball on top >:|
 
@ssube No, Safari now fills the niche IE used to, for everyone with an iPhone, no ability to upgrade and no real alternative.
 
aw man, that's both truer and sadder
 
Oh, and no dev tools
Unless you're on a Mac, because, who doesn't have a Mac, right?
 
@SterlingArcher maybe you can use ocr.js?
 
all the designers and product people who made it have macs
 
12:21 AM
does it exist?
 
@ssube Oh, you mean everyone who don't need the devtools?
Yeah, they all have Macs.
 
I need devtools, don't you?
 
@MadaraUchiha nah man product management synergistic design with agile workflow solutions is totally just as technical and important as development
 
in react, how do you show something conditionally within a div? This is what I have and it's not working:

<div>{(this.state.data.length > 0) ? this.state.data[0]["name"] : "No data found"}</div>

Not seeing anything printed on the screen but not seeing an error either...
 
@ssube Put that here sansbullshitsans.com
 
12:22 AM
they know almost as much as your average sysadmin, but since they don't sit in a corner, they can probably see the servers better and run them more good
 
@ray9209 That looks right to me.
 
@ray9209 what do you expect?
 
I'm expecting something to be printed on the screen but not seeing anything
 
wow
cool
can you debug it?
 
12:23 AM
@ray9209 nvm
 
@ray9209 Silly question, are you actually calling ReactDOM.render()?
 
try a real if instead of a ternary
 
@ssube Can't
Only expressions inside of JSX's {}
 
<div>{this.getStateDate()}</div> and getStateData() { return ...; }
cause then you can test and debug it
 
@MadaraUchiha yes
 
12:25 AM
I refuse to put logic in my JSX, any more than I used to with Handlebars. It's better in another method.
 
what exists after React?
 
cognitive templating
 
@ray9209 If you replace the {} block with "foo" does it render?
@neoDev Are you drunk or something?
 
yeah like bots?
 
@MadaraUchiha yes, foo renders
 
12:26 AM
How about {"foo"}?
 
yeah, that's what I just did
 
Is it possible that this.state.data[0]["name"] is simply an empty string?
 
it's empty
 
That's because it's after react, you waffle
 
@MadaraUchiha lol yes, it should be this.state.data[0]["title"]... sorry
 
12:28 AM
\o/
This is why TypeScript is helpful
 
star 4 you
 
how can it be on wikipedia if it hasn't happened yet?
 
@ssube How can we see things if our eyes aren't real?
 
Typescript is the best damn linter you'll ever find
 
@ssube is Galleon useful in the dungeons?
 
12:29 AM
it disappeared wtf
 
You have already voted, but the voting has been cleared by a moderator
weel done
 
@MadaraUchiha you wanna get hiiiiiigh?
 
mod
 
@ssube Like, 5'7'' high?
 
12:30 AM
@SterlingArcher eh, he's a good sub for Bernard usually. You can build him to be just as fast and he's a little harder to hit.
 
 
lol
 
Right
Bedtime for me
 
I can auto b8 like 80% of the time.. my runes are garbage and better ones wont drop :(
 
12:30 AM
steaming with @rlemon
lol
I play quakelive
 
@SterlingArcher you need dragon runes to get higher in giants and v.v.
 
anyone playing this game?
 
why was I pinged?
 
oh what the shit
 
!!tell rlemon why
 
12:31 AM
@rlemon because you touch yourself at night
 
you interrupted things
 
@rlemon do you play quakelive?
 
So I should be farming dragons not giants?
 
no
 
@SterlingArcher back and forth like chutes and ladders
 
12:31 AM
... I knew
 
god dammit
 
it's like max msp
nobody ever know it
 
I don't play games
 
who is this walnut
 
but it's a bit cool
 
12:32 AM
it's all srs bsns
 
@neoDev what are you on about and why are you pinging people?
 
You're not cool... unless.. you pee your pants.
 
I'm off to bed now
 
I'm peeing my pants right now
 
because I saw he was online in the chat
 
12:32 AM
If he bothers you too much, kick him.
 
@MadaraUchiha nighty night, don't let the hitlers bite
 
Toodles ❤️ 🌙
 
sorry
 
@SterlingArcher DID YOU SEE THE PICTURE I SENT YOU OF FAB HITLER
 
@SterlingArcher Have you seen yolocaust? (NSFW)
 
12:33 AM
I haven't checked my hangouts since like.. this morning lol
I DID LOL
 
check
CHECK
 
IS HITLER WEARING JORTS
 
YES!!!!!
 
so I created a little bot. Nobody wants to try it?
 
Fantastic, that's a man of noxious fashion
 
12:33 AM
those socks are on point
and the finger point
man of style.
 
it's created with luis and js
 
fucking lol
 
to publish it I need a little help with git please
 
no please
 
ok
thank you
 
12:35 AM
come again
 
take your order please
 
index.html:
 
please don't post walls
there are multiple paste services that are easier to read
 
ok
 
imgur.com/gallery/fpiQW my god this was depressing
 
12:37 AM
no it was glorious
2 messages moved to Trash can
come on dude, you said 'ok'
 
It was not my intent paste something very big
just another piece and that's it
..
 
then don't push the V button
 
push a different one
 
it's a lot of code no one wants to read in this chat.
the chat doesn't make it easy to read
paste it on gist.github
we'll check it out maybe
at least that interface makes it easy to consume
 
12:39 AM
@SterlingArcher I've got 52 stones, a couple MS, and when I finish TOA 40, the crystals for a primo pack. But I'm already at 91/90.
 
thankyou
 
Can anyone tell me off the top of their head what will happen to existing CanvasRenderingContext2D instances when the owning canvas has it's size (pixel dimensions, not display size) changed?
 
@KendallFrey they get cleared
 
their states reset
 
12:40 AM
to black, iirc
 
everything is reset
 
And does drawing to them continue to "work"?
 
you used to be able to resize them to the same size and it was faster than the real clearRect-type method
 
yes
 
cool, thanks
 
12:40 AM
but things like lineWidth and other crap you'd set are all cleared
just be aware of that
 
or use it as a feature
 
@rlemon so basically indistinguishable from a new context?
 
you don't need a new handle
 
I won't claim that.... but yes
 
I haven't figured out how to insert synonyms in that bot
 
12:42 AM
It probably won't matter, but it's always nice to know the details
 
I know it bit me in the ass a few times
so I'm bitter
 
I can't extend my arms fully :(
 
@SterlingArcher you forgot how? or?
 
Super sore :P
 
:P
 
12:44 AM
Tricep (&shoulder/chest) day followed by bicep (&back) day
 
how can I see only messages from a specific author in this chat?
 
The end of back and bicep day is freaking burnouts
 
@SterlingArcher I don't think that's normal, even after a protein shower bed or however you do your workouts
 
So it's been a full of only wearing plaid shirts. No one has noticed.
 
@KendallFrey eh?
 
Yeah, i drank my protein, took a shower, and went to bed
 
// Thoughts?

"use strict";

const {remote} = require("electron");

module.exports = Game;

class Game extends EventEmitter
{
	run()
	{
		const canvas = document.querySelector("canvas");
		const renderingContext = canvas.getContext("2d");

		const e = { setupFinished: Promise.resolve() };
		this.emit("setup", e, canvas);
		e.setupFinished.then(renderLoop);

		function renderLoop()
		{
			this.emit("render", renderingContext);
			this._nextFrame = requestAnimationFrame(renderLoop);
		}
	}

	exit()
 
@SterlingArcher nice
 
@SterlingArcher So it wasn't actually a protein shower bed, you liar
 
@rlemon a full what?
 
12:47 AM
jesus christ is that why i saw protein shower references today?
 
@KendallFrey Not a fan
Usually I have a this.events instead of extending event emitter
 
@KendallFrey your game loop should be an observable
 
I don't even know what that means
@Meredith For what reason?
 
an rxjs observable, so each frame, it calls next with the frame number and delta
public subscribe(onNext, onError, onCompleted) {
    this._screen.realloc();

    let state = 0;
    const buffer: Map<InputActionType, InputAction> = new Map();

    function keyPressed(keys: Array<InputAction>, action: InputActionType) {
      return keys.some((key) => key.type === action);
    }

    function anyPressed(keys: Array<InputAction>) {
      return keys.length > 0;
    }

    this._input.subscribe((action: InputAction) => {
      this._logger.debug({action}, 'Received input action.');
is part of my game loop
 
12:50 AM
:D
 
@ssube dammit, a full week
I really need to just program this in at this point
 
hm, I don't know if I would comment after seeing somebody wear plaid for a week
doesn't seem that weird
 
@ssube after a month?
 
I'm basically thinking of replacing my weekly dress with all plaid
 
12:51 AM
later than your gfs period
 
@ssube I'm not sure how that different than just firing events, aside from minor things like input buffering
 
ohhhhhhh
 
I mean, most of the exec types in my office wear plaid shirts every day
@KendallFrey promises are async, events fire more than once, observables are both
 
@SterlingArcher I'm 30. we're going on 7 years together. That would be a nice thing
 
@KendallFrey It's just object composition vs inheritance
 
12:52 AM
they're the fourth corner in the callback/event/promise/observable square
 
omg are you trying
need help?
 
if you can describe your game state in some fairly functional way, observables will drive that
 
practicing
 
I'm a great coach
> Tag me in Holly
 
@ssube Help me out here, because I don't think I understand. Is observable just firing events asynchronously?
 
12:52 AM
 
if I was better at them, I could get rx to automatically buffer input events, dedupe them, and feed those into a rAF-based loop
 
sterling gets knocked out by rlemon as a "tag"
 
Get it? It's a gay joke because straight men would have tagged you out
 
@KendallFrey where Promise has onResolve and onReject, Observable has onNext, onError, and onFinished
 
Because i love you <3bro
 
12:53 AM
mm
 
it's like a promise that can fire more than once
 
:P
 
so, if you tie to to requestAnimationFrame, it will tick and call onNext every frame
and if you set that up right, it can give you a running count, buffered input, etc
 
Can you give me a convincing reason to do that? I don't know that I want either of those things
 
12:54 AM
it gives you all the smoothness benefits of a good locked framerate with minimal code
saves you writing the event loops
 
okay, so say I'm communicating with a domain socket and I can send it requests and receive responses. I can't setup a fifo because random data comes back as well. I can tag responses for specific requests tho... would (in a React context) using an observable benefit me here for updating the client (cc @Luggage)
 
@ssube That seems impossible to me. I must be missing something
 
right now I'm setting up some stupid store object that handles callbacks with keys corresponding to the tagged response
 
@KendallFrey in my case, I have input as an observable stream of events, those get mapped (from raw keys to game events), fed into the render loop which is fired by timer, which calls render. Meanwhile, any events coming in from the server are just injected into that stream.
So not only is the observable taking care of the raw background event loop, the basis of the game, it's also buffering and remapping input (which was really easy) and merging player input with server state
 
12:56 AM
I don't quite understand mobx, I suppose I should start there
 
So does that mean implying that RAF is already wrapped in an observable, and I compose on top of that?
 
@KendallFrey lemme grab some doc links, one sec
 
what does interest you mostly about JS?
 
the money
then, probably, jQuery
 
:D
you guys can be also funny..
but I can't
is a natural stuff
 
12:58 AM
did you get the plugin?
 
@ssube so is my assumption that I can create a class structure with @observable and have React update state when I change the properties of that object?
 
it's like a giant map/reduce, with a lot of other operators
 
uhh ... correct
 
@rlemon that's how mobx has always been advertised to me.
 
1:00 AM
hmm
 
I don't even create something interesting
 
I have a very crappy data provider to deal with .. by design
 
it has an observable with a bunch of children that each filter the events coming in, which is what makes it faster than redux
 
but I would like to partecipate to some project tho
 
I'm trying to think of a proper way to interface with it.. I can deal with it now.. but it feels ugly
 
1:00 AM
so you can use rx and do your own filtering ahead of time, feed nice clean events into mobx
it will poke at react and update state, I think
 
I don't know where
 
feel like letting me write something up and giving some feedback?
 
rx is the real functional async version of all those array methods
I've barely used mobx but I do know about observables in general.
 
not code, like.. write up a little blurb in a doc that describes how I have to interface with what I have. my current solution.. then you tell me how to do it better :D
 
@ssube Thanks, I guess I'll keep that in mind and try it if I think it would solve a problem
Right now the event seems adequate
 
1:02 AM
can somebody give me some task plz?
 
too late, I'm opening a new tab to write it
 
@KendallFrey they probably are, but once you start making things observable, you'll be entertained by how many things can be described that way. It's a very functional way of doing inputs and sich.
far better than the array methods
 
Sounds like something @towc and I could fap to
 
I've started stacking them, too, so I have a MappedInput that can wrap any other inputs, like the TerminalInput and GamepadInput
they all output raw input with the keycodes, which gets mapped and comes out as a single stream
 
I don't know what that means exactly, but sounds a lot like something I did a while ago for Tui
WPF supports text input events and keyboard input events, and I merged corresponding events together
that was fun
 
1:07 AM
  /// terminal
  public async bind() {
    this._logger.debug('Creating input stream.');
    this._stream = new Subject<InputAction>();

    this._logger.debug('Binding terminal input.');
    this._screen.enableInput();
    this._screen.on('keypress', (ch, key) => {
      this._mapping.filter((it) => it.key === key.full).map((mapping) => {
        this._logger.debug({key, mapping}, 'Pressed key with mapping.');
        this._stream.next(new InputAction(mapping.action, mapping.intensity));
      });
it all feels very lego-y
 
Array<InputStream> the flashbacks to java 5
 
it's that or InputStream[] and the trailing [] can get ambiguous in bad places
 
@rlemon broad hand wavy answer: yes
 
😞
okayy
 
1:10 AM
that sounds like a good use of observables
they are the async event streams you're talking about
you can send your callbacks to one and then use mergePairwise
 
I have a somewhat predictable data structure that will update and when it does I need to update the state and ui
observables?
 
it'll pop the top item off each queue and hand them over together, which you just map((fn, v) => fn(v))
reactivex.io/documentation/operators.html has everything they can do
 
man, I shouldn't try to learn new concepts intoxicated
😖
 
don't even try to learn these ones intoxicated
they're really weird to think about at first
if you've ever used Java 8's streams or any language with those, it's a good starting point
 
I know what I want, and I think @observable in mobx will handle it
 
1:14 AM
or like ETL tools, Pentaho stuff
mobx backed by your own observables to take events from the socket should, yeah
 
that's my other thing.. when I first looked at this months ago I thought.. yea.. extend EventEmitter and then mock everything from the socket out
 
oh right, this website is the best reason to learn observables: rxmarbles.com/#withLatestFrom it has interactive graphs
 
but that also just sounds wrong now
 
@rlemon observables are async event emitters
so like, you were right both times
 
as I learn more js I doubt how much I know js
s/js/programming/
 
user6820627
1:29 AM
@rlemon wtf is that?
 
@LearnHowToBeTransparent perldoc.perl.org/functions/s.html
 
So...I should stop using event emitters?
I mean I don't really use them that often
 
mobx all things
(from the guy who doesn't know mobx)
 
if you would use a promise instead of a return value, you should use an observable instead of an emitter
I'm not entirely sure which is right atm
 
What
 
user6820627
1:38 AM
@rlemon so observables are in Rx?
 
mobx
 
does mobx just use rxjs underneath?
 
:shrugs:
ask me tomorrow
 

« first day (2288 days earlier)      last day (2654 days later) »