« first day (2074 days earlier)      last day (2860 days later) » 

1:00 PM
Good morning
 
maybe a better definition would be "jQuery an element or selector" or "apply jQuery to an element or selector" ?
afternoon! o/
ok..feeling stupid so casting this out to you fine knowledgeable folks... got a colleague's code in a JS file (compiled from TypeScript) that defines a function: AppComponent.prototype.MenuSelect() and I have some code that needs to call that JS function and pass it a parameter... but for the life of me (or the stupid of me) I can't seem to reach out to the MenuSelect function.. keep running into "MenuSelect undefined".. jsFiddle is here: jsfiddle.net/digitalmouse/to52jv5s/1
 
@SterlingArcher Don't hug me I'm scared has a new episode
It's fantastic
 
Anyone here has any RN experience?
 
Registered Nurse?
 
1:02 PM
@SterlingArcher lol I remember what you thought last time
 
I'm too tired to think i have no idea what you'-- oh
Oh hell no
 
oh hell yes
 
Is #6 the finale?
seemed to wrap things up
 
I hope not
 
Let me guess, jQuery - you list prevAll results in semi-reverse document order? Of course you do.
 
1:09 PM
@thedigitalmouse it depends on where you are calling it from
if you are inside of AppComponent, and the function has the right context, then you could just do this.MenuSelect
 
so much weed put in that video
 
@bitten well... it's all "loaded" early on in the index file, so I would have thought ('thought' being the operative word in question) that I could access it from outside using
 // my code in seperate js file:

                      var wheelmenu_select = AppComponent.MenuSelect();

                      nav_dashboard_running.navigateFunction = function() {
                        wheelmenu_select(dashboard.gridList[0]);
                      }
but apparently i am wrong :D
 
what does execute do with AppComponent?
 
when will I become a cat?
 
to be honest... i have no clue really.. i thought it was the conversion from TypeScript's export class or constructor() function into native JS. :(
 
1:14 PM
what happens if you just console.log(AppComponent), do you have access to it?
@corvid okay, that sounds good
now to study redux also c:
 
@bitten angular2-polyfills.js:267 Uncaught ReferenceError: AppComponent is not defined
 
@corvid many thanks
 
which is what led me to my question :D
 
heh
 
1:17 PM
yeah it's almost like i'm trying to use the function before it's ready.... i've run into similar issues with Angluar2 loading stuff at weird times... i'm hoping this is not the case...
i'd hate to have to do like a setTimeout() for every function i might need to access >.<
just waiting until it's available
it's like Ang2 threads stuff out ... had to do a setTimeout trap because other code I made (loaded last) could not find a DIV that is generated by a template in Angular... so I have my stuff wait about 2-3 seconds... then I can see it in the DOM to mess with it... >.<
 
@thedigitalmouse well it's hard to say, not sure how your application is set up.. where is AppComponent instantiated?
 
@HBONowHelp Maybe you guys shouldn't deploy development code to production... https://t.co/jSSn4lEFNo
 
If you have to set a timeout for the dom, there must be something you're doing wrong
I highly doubt angular 2 should be used like that
 
@thedigitalmouse there must be a cleaner way
hard to say -how- since i'm not familiar with your application
 
@ndugger heh
nice find
 
1:23 PM
@ndugger status update
 
oh i am sure there is a cleaner way... but crap like this is why i tried to tell the head developer we should not be using Ang2 while it's in Beta until we know what the heck we are doing. :D (head dev comes from a java background and his javascript reflects that)
 
@SterlingArcher Still doing well; knee is better and better, but still requires a brace for cardio
I didn't track my calories this past week, but I don't think I went over anyways, but I'm tracking again this week
Lifting has been going really well; I'm getting stronger pretty quickly
Also, spent ~$1700 on a computer
:(
oops
 
I'm confused about this... this works in the console, but not within code. if (!Object.keys(partitions).includes(currentProduct)) { /** ... */ }
 
I'm incredibly weak since the last time I lifted :( So I have to start slow until I can get a rhythm back
 
1:25 PM
@bitten i'm not even sure how the application is setup.. i was brought in as a pure JS front-end developer (with some minor node experience), not expecting to mess with Typescript or Angular 2... but after being hired i get "oh by the way.. we decided to switch to Ang2 and TS late in the project..." facepalm
 
I think I'm going to stop tracking calories. I'm in a good rut with food, and I have trouble going hitting my goal as is
@VeronicaDeane i.imgur.com/pdfQiLz.mp4
 
I've found that the first time you reactivate a muscle group, it hurts like hell for a few days. However, I've found that after I lift, if I drink a ton of protein shake, (2 servings), then I don't have muscle sorness the next day
Protein is your best friend
 
@thedigitalmouse are you not able to work with the precompiled typescript?
 
Need that creatine for quick building yo
 
@SterlingArcher idiot defenseman
 
1:26 PM
looks like you just want to use a function of a class.. so find where it's instantiated and make sure you can read it in your context?
 
Does javascript have a concept of comparing instances of a class to each other? Similar to __eq__, __gt__, and __lt__ in python
 
@corvid in some specific contexts, like sort, yes
 
@bitten i was under (the now false) impression i would be able to work with just the compiled JS directly, but as noted in my example, the way I thought you access objects is not working as expected... and yes, it's just a function of the AppComponent class.... AppComponent.prototype.MenuSelect() so here I am thinking, "oh that should be like this:" var my_menuselect = new AppComponent.MenuSelect()
then i can call the my_menuselect and pass some arguments and off I go... but nooooooooooo :D
silly me it would be so easy :D
 
well typescript compiles it to javascript a bit differently, and it may not be available in the global scope
 
@corvid You can sometimes fudge it with valueOf, which is used when you use < and >
but not ==
 
1:31 PM
if you're working with precompiled ts, you may do something like /// <reference path="app.component.ts"/> or something
 
@bitten yeah, chatting with other colleagues it does appear to be a scope issue... which is probably fixable if I make my code a TS component too :P ooooh <reference>.. forgot about that... will give that a try! thanks for the tip
 
The world would be a much better place if TypeScript and Flow never existed.
 
certainly would not hurt
 
well i'm not sure like what appcomponent does, perhaps it's already instantiated somewhere, perhaps it's not a good idea to import it twice into your app
@ndugger i like the idea of interfaces though
 
Ew
Interfaces are the worst part
 
1:33 PM
@ndugger i can understand it's place... but i think adoption was waaaay too fast, considering the rate at which ECMAScript is improving on it's own... i just feel like TS is a temporary bandaid for people coming from strictly typed languages
@bitten understood bitten... i'll have to dig into it more myself....
 
I suck at google-fu. Is there a javascript library that replaces the in-browser search? I guess it's not possible to trigger the in-browser search functionality from Javascript.
 
you mean the ctrl+f thing?
You could easily overwrite that
 
How?
 
By adding an event listener for it on the window, and doing preventDefault
 
I mean, I want a button that launches an in-document search.
 
1:42 PM
Oh, you don't want to overwrite ctrl+f, you just want to recreate the functionality
Well, without having done it, I would search the document for that text, and wrap instances of it in a span with a special class
then you could scroll to each instance
and highlight it
But I would assume there must be a lib for it
 
That doesn't sound like a thing that could be done in a few hours
 
I've never had the need for it, though, so I'm not sure
That sounds like something that would absolutely only take a few hours
It doesn't seem complicated
 
It's 15:45, my office hours end at 18:00. Wish me luck.
Worst case, I can git stash and send that.
 
@JanDvorak annotatorjs.org
wait, nevermind... I don't think that's quite what you're looking for
 
@GregBorbonus Thanks again for the help. I used what you made for me and did something similar for all the other stuff I have. There's a lot less text in the site file, and it feels like it loads faster.
 
1:52 PM
Implementing this means I'll have to learn how text nodes behave. Wish me luck.
 
@JanDvorak may the lord be with you
 
To wrap a bit of string in a span, do I remove the text node and add three nodes where it was?
I guess I could use insertAdjacentHTML...
jQuery won't help me where I'm going
 
it's just a start, but maybe it's helpful for you
 
Do text nodes fuse automagically, or do I have to do it as an extra step?
 
I haven't checked it.. but it seems innerHTML :/
 
I mean, how did you find it?
 
@VeronicaDeane translate pls
I don't speak chemistry
 
It's ... almost as big as jQuery.min.
 
and it's ugly and painful to use
 
2:06 PM
firefox seems to have non-standard. window.find developer.mozilla.org/en-US/docs/Web/API/Window/find
 
Let me just run it. Maybe it will serve the purpose or be tweakable.
 
@JanDvorak Would this help you ? github.com/Canop/groumf
 
@DenysSéguret I don't need search&replace. I need search&highlight&button-to-scroll-to-next
 
Hey y'all
 
highlight is just one line more, when you can replace some words with html and use a callback
But you'd still have to write the gui for searching
replacer.replaceTextWithHTMLInHTML(domElement, function(name, id){
    return '<a href="http://test.com/users/'+id+'">'+name+'</a>'
});
 
Managed the find5.js button to show up. Wow, that's ugly.
 
Since when do we flag "fuck"?
 
Flaggers gonna flag
 
@SterlingArcher just get a periodic table and convert these names to its chemistry symbol ( ef "Fluorine" gives "F", "Uranium" gives "U" ect )
not sure if it forms a sentence or that she put that randomly
 
@KarelG It forms a sentence
 
2:18 PM
I'm lazy to convert it :P
but the first one is F+U+C+K
 
Yeah, I got that far
 
> fuck bitches get money
 
Hmm, all other results are crap too.. "find in page javascript" is not a good search query..
 
@ndugger flagged because fuck
 
same, bro
 
2:23 PM
Question how would you export a module containing with other module implemented
 
Please rephrase, @Lamar.
 
Let's say a have a module called Amazon.js where I implement all the function of the Amazon sdk. I would love to export this module to my index.js and called these aws functions ? @Luggage
 
Is this in the browser or node? Are you using ES6?
 
Node
I was trying to do module.exports = {};
But I didn't work
 
ok, node's exporting and imports are well documented. You export with module.exports = ...; and import with require('./myModule.js')
 
2:28 PM
exporting is not the same as importing
 
I know that
Inside of index.js i would import
 
var aws = require('./amazon.js');
 
But inside of Amazon.js I would export
 
show me the line where you export.
 
module.exports = { const var aws = require("aws-sdk"). };
 
2:33 PM
ok. That's not valid Javascript.
For too many reasons to list...
 
Why not.. Just to say when I have all the code into one index.js
 
module.exports = { aws: require('aws-adk') }; //I re-export another module as 'aws' for some reason.
var aws = require('./otherModule).aws;
 
Ok I get it
Thanks @Luggage
 
oops, I forgot a closing quote in that.
 
I had way too many lines of code into one files
 
2:50 PM
Anyone who has experience with Meteor, is there any reason why you should not be able to use babel-polyfill to get functionality like Object.entries?
 
No reason.
It's just JS doing what JS does.
 
i.imgur.com/mhIiptr.jpg that's a fucked up possum
 
though... I'm not familiar with babel-polyfill.. just babel-runtime
which includes polyfills
 
@SterlingArcher that's not even a possum
 
I KNOW ITS NOT A POSSUM
 
2:53 PM
that's how fucked up it is
 
@SterlingArcher then why did you use the word
 
>:|
My stomach hurts. I didn't eat too healthy this weekend :(
The flood of crap food seems to upset my stomach for the next couple days
 
is it your abs or your stomach, make up your mind
 
No, that's your body celebrating tasty food.
Mine celebrates all the time.
In fact.. I think I'm late for a party right now.
 
@VeronicaDeane both. Sore and not feeling too hot
On the bright side...
(He's ok, so it's ok to laugh)
 
3:01 PM
i thought the car exploded at first
 
> It's just ectoplasm
 
alien blood
 
@SterlingArcher I tried to tell her, she wouldn't listen
 
in 2010, 1/6 of your citizens visited the ambulance to celebrate digestion
 
But I don't have a digestive disease ._.
> visited the ambulance
what
 
3:02 PM
or you still don't know
> Hey ambulance, it's me!
> Open the fucking door!
 
guys...I have really simple question...why my code returns [undefined, undefined] instead of ['colored']?
 
> Why you do this to me all the time?
 
@PDKnight ASI after the return
Also, you should be using filter, not map
 
I know
but this is shortcut of what I am doing
what's ASI, please?
 
nice question
 
A hint: unless you master ASI, try to stick to some standard js style
 
thought you can write in seconds instead of making the link :D
@DenysSéguret like? :)
 
like the google one, for example. It's not fancy
 
@PDKnight thought you can google in seconds instead of wasting my time
 
3:07 PM
@DenysSéguret what I am exactly writing wrong?
 
in fact it's not complete enough, the google one
@PDKnight of course there's your buggy return. But you'd better not have the opening brace on its own line.
 
@DenysSéguret :O why not? code seems to be clearer then
and better readable
 
@DenysSéguret Why? I find it much more readable that way
 
To start with you'll be less tempted to write such code:
return
{
 a:3
};
 
3:12 PM
return
6;
you don't write it like that, not sure why you'd do it differently when returning an object
 
@VeronicaDeane The thing is, it helps being consistent. In the following code one of the opening braces is a bug:
function bla()
{
    return
    {
      a: 3
    };
}
 
but I don't want to return an object, guys...
 
@PDKnight Yes, you return undefined
 
.map is never going to turn an array with two entries into an array with 1
 
@DenysSéguret but I still don't know why :D
 
3:16 PM
@PDKnight Didn't you read that ASI link ?
A semicolon is inserted after the return
That's why I told you to stick to established code styles, to avoid this kind of bugs
 
but why when it works everytime? :(
 
What ?
 
... it doesn't work
 
I mean in like regular functions...
 
It shouldn't work.
 
3:18 PM
whelp.
 
note that b is on same line as the return.
 
good move @CapricaSix
 
:D
sel: function(s, b)
	{
		return b
			? document.querySelectorAll(s)
			: document.querySelector(s);
	}
 
Error 404 occured, I will call the maid (@Zirak)
 
3:19 PM
Also, for the sake of consistency, replace document.querySelector(s) with [document.querySelector(s)].
 
let me try something...
 
@Neoares TIL ambulance refers to a vehicle in English
 
ohhh
:D
 
Error 404 occured, I will call the maid (@Zirak)
 
So, you will always get an array-like object.
 
3:20 PM
now it works!
 
@FilipDupanović :D
 
so like @KevinB said :)
thank you, guys!
 
that's hard to follow. If you're not reading carefully, you'll think the return is returning a boolean.
 
@KevinB no, it isn't...return returns a string
 
3:22 PM
For god's sake, don't put opening brace on its own line in JS.
 
Right, i know what it IS doing, but it looks like it's returning a boolean.
 
A synthetic explanation @PDKnight : stackoverflow.com/a/3218860/263525
 
He's also indenting every block twice..
 
isn't it a question of minifying?
 
3:23 PM
function () {
}
 
you'd get the same
 
function ()
{
}
 
I know, @littlepootis
 
function ()
    {
    }
^ DON'T do this.
 
not always, as you've learned with the return statement just now
 
3:23 PM
Just don't.
 
oh, you mean that indentation on start? :D
haha :D:D:D:D:D
that's because I've copied it from intended code :D
it's just a part of a function in a static object
but thanks anyways...I'm going to read something about ASI ;) see ya!
 
function
    ()
{
    }
 
:D:D
 
function
(
)
{
}
hihi :3
 
Error 404 occured, I will call the maid (@Zirak)
 
3:28 PM
@PDKnight throw this in and call it a day github.com/feross/standard
 
(
) =>
    {
    }
 
JS room gone mad?
 
@FilipDupanović Not everybody likes this style. I don't. It tries to be clever but is less readable and is tricky, especially if you like to code in a functional style
 
> No semicolons
Are you serious?
 
@DenysSéguret I (think) most of it is --fix-able, down the road
@littlepootis not my opinion, just a user, the author left notes for you in the README
 
3:31 PM
@littlepootis They're serious. They just add the necessary exception, with a semicolon at start...
 
(the "we will cover notable exceptions for you with tools in your tools" part in the README)
 
@SterlingArcher I've been talking to the same girl on match for about a week now. We message about once a day since our schedules don't line up all that well. She's a paramedic and works evenings. She told me "Goodnight or morning or whatever" about an hour ago, lol
 
There's no way for a single CSS selector to match a1, a2, a3, a4, a5.... etc. is there?
 
a1, a2, a3, a4, a5?
h# only goes up to six
for classes and IDs you have [class^="a"]
 
@custom-selector :--anchor .a1, .a2, .a3;

:--anchor:active { }
 
3:39 PM
SASS
 
SASS has a different model for reuse
 
@JanDvorak sorry, I meant for classes
 
but there's a design's smell, there
 
3:42 PM
Wait, won't work
You can use "contains", but you'll get a lot of false positives
 
it works, but will grab all elements whose class name starts with a
 
you probably should have a "a" class. There's no reason to add numbered classes, you're probably mixing style and data
 
@ndugger get them digits brah
@VeronicaDeane
 
@SterlingArcher you sneaky bastard
@DenysSéguret Not my code, just tweaking a website
 
@SterlingArcher working on it. Easing into it so I don't scare her off, since she's like 3 years older than I. I have to make myself seem mature
 
3:45 PM
the next image after that imgur link is about reflective underwear. Nice
 
@VeronicaDeane then give one more class to all those elements having a1, a2, ... class
 
not my code
!!s/er than I//
 
Cap u ok
 
@VeronicaDeane @SterlingArcher working on it. Easing into it so I don't scare her off, since she's like 3 years old. I have to make myself seem mature (source)
 
oh
oh my
 
3:48 PM
ease
 
@ndugger it's a trap xD!
 
with bait
 
@FilipDupanović She's not a trap. I mean, she is asian, though, but I don't think she's from thailand.
 
tsss kendal
 
> Our radios scan the police and fire channels, and there was definitely a call for an angry squirrel stuck in a bird feeder. Last week, it was a distressed turkey.
she has an interesting job
 
3:54 PM
911 operator?
 
Paramedic
 
For some reason I'm a huge hit with black women on bumble
It must be the beard
 
I dated a black girl for a while
 
It's the brow.
 
3:57 PM
It's kinda shocking how many "Help me destroy the patriarchy" I see on dating apps
And transvestites
 
@ndugger not that kind of a trap you can feel with your hand... this one is far more sinister, things change and you suddenly feel "happy" and start "liking" people... eww
 
lol, I see a ton of whacko feminazis on dating apps as well. Immediate turn off
@FilipDupanović Happiness is a lie
 
I can't see why any man would right swipe somebody who has life goals of destroying their gender
I'm all for equality, and would 10/10 date a feminist
 
@ndugger it's the truth! let's merge with Mercer and suffer together for eternity (until we die or before the heat death of the universe, whichever comes first)
 
I would date a feminist that didn't call themselves a feminist. The word has been too tainted for me.
The crazies fucked it up too badly
 

« first day (2074 days earlier)      last day (2860 days later) »