« first day (2391 days earlier)      last day (2780 days later) » 

13:00
Haha, no, it's not nearly large enough for that
It's not the size, but how you use it.
@JohnPavek I found using query parameters to be an issue in the long run
@OliverSalzburg how so?
you have to lookup each time
@JohnPavek Our CDN provides improved caching when not relying on query params
Seemed like a minor detail at first. Turned out to be a huge refactor to get it resolved when it was required
13:02
that's good to know, what would I look for in the CDN to see if it will affect us?
@JohnPavek Like @KarelG said, it's probably universal. As every combination of query params has to have a separate cache entry. CloudFront just specifically mentions this behavior in the settings
Ahhh okay
I am not super worried about it, the section is only for 20 ish people. Just frustrating to explain hard refreshes to non tech people some times
for a 20 person deal. yea, just stick a build date or something on and you'll bust through cache.
Okay perfect
13:11
I'm almost to my 6month mark as a javascript dev, any advice you guys wish you had known this early?
Run!
j/k
Embrace a build process for JS.
it opens the world of modern JS (even on old browsers)
No need to rush into this if it's a lot, but something to think about: babeljs.io
wait wait wait
are you telling me the 6 hours I spent on Friday re-writing code for IE 11 could have been avoided?
mm.. depends why it woudln't work on ie11, but maybe.
between polyfills and transpilers you can mostly write code for the latest browsers and it'll work in IE11.
I develop on chrome and occassionally test in IE. I have few issues.
posted on May 03, 2017 by Evan Lucas

Notable Changes crypto: add randomFill and randomFillSync (Evan Lucas) #10209 meta: Added new collaborators add lucamaraschi to collaborators (Luca Maraschi) #12538 add DavidCai1993 to collaborators (David Cai) #12435 add jkrems to collaborators (Jan Krems) #12427 add AnnaMag to collaborators (AnnaMag) #12414 process: fix crash when Promise rejection is a Symbol (Cameron Little) #11640 url:

not all features gets polyfilled btw
because some features aren't part of the new ES standard but is not supported by browser ... (yet)
like document.querySelectorAll( <nada> ).forEach( el => <do something with el>); doesn't work in FF
13:24
Firefox, the new IE
eh, i had to refactor my code because of (actually FF is correct on this) some function hoisting that I did
Just jokingly trying to get some firefox user fired up.
Opera is the new IE :P
@KarelG lol no Opera is better than Chrome
No, I like chrome because it's fancy, while i cannot stand an opera. The screams ...
13:32
just took inventory I own 33 x86 computers I need to stop
HAMMERTIME!
@Loktar make a steampunk supercomputer
see man
that's why you need a dash cam
@Luggage hah yeah I wish I could do something with all of them
!!giphy give it to me
whew
!!giphy show me what you got
!!giphy get schwifty
13:35
@BenFortune you don't want these man
286's up to Pentium 4's (forgot I got a 286 over the winter again)
besides my 3 or so modern-ish ones
@Loktar on the bright side, you could upgrade NK's nuclear program over night.
lol
I can't say anything bad about the US because we're awesome. This account has not been commandeered
did the CIA light on your dash blink twice or something?
since when do you collect CPU's ?
@KarelG since I was like 14 or so
eh maybe 15 idk
13:42
just to say that you have "some cpu" ? :P
fancy, I've been collecting half finished code projects since I was 15
in recent years I've definitely ramped it up though
@KarelG these are full machines
a whole PC ?
@rlemon haha same here as well! I still have a ton of mine, always fun to look at them
@KarelG yeah like 486 machines, pentium 2's, amd k6 machines, stuff like that
eh, i still have some projects left. Promising at start, but eventually stepped on another things
13:43
lots of 3dfx voodoo cards :P
Where do you store these ?
in my basement, I have a storage room when they're unused
otherwise I have tables setup for them
ah those keyboards <3
yeah I have a few model M's
I actually got those in HS, we all had them, and they would throw them away randomly
that's also when I started collecting, they told me I could keep any broken PCs
HS ?
13:46
.... a few of them wouldn't turn on, they were missing their ram was soo odd ;)
High School (grades 9-12)
granted those were 286 machines, so not our daily use ones, they were all going to go to the scrap yard anyway... IBM PS/2 machines
I got my server from my uni. They were installing new servers and was going to deposit the old servers away. I asked if I could pick one for personal use. They said "go ahead".
yeah man so many places will do that, just have to ask
cough
I have an ad on craigslist about to pick up my 2nd free PC from that
@rlemon I need to come to CA too soon :P
working on my passport
> Jason
not a bad guy
likes hockey
poutine eh?
"sir, welcome to Canada"
13:48
I want poutine!
I love gravy on my fries, so I know I'd love it
not sure how it's not popular here at all
my last deep fryer didn't get used for a while.. and it wasn't exactly "clean" when I stored it
so I'll need to buy a new one to make poutine
All the poutines I've eaten were meh at best
that's because fake french make the real poutines, real french make fake poutines.
I've eaten almost all of them in Quebec, some in kind of reputed places
> Get "eventTask 'undefined.addEventListener:MSTransitionEnd': can not transition to 'running', expecting state 'scheduled', was 'notScheduled'. " only in IE
> Google it up
> only relevant result is the file that throws it on Github
13:49
they knew
I've for sure had a lot of bad poutines. they are easy to make, but also very easy to make wrong.
What's the recipe for yours ?
nothing special. just need to get the fries to the right crispiness, good cheese curds (room temp, not refrigerated) and good onion or beef gravy.
although I prefer onion gravy
not too much gravy or cheese.
don't wanna soup
And what kind of cheese do you use ?
a lot of places I've seen think you can just toss any old cheese on fries and gravy and call it a poutine. or they'll have soggy af french fries
@DenysSéguret cheese curds
Why isn't this returning to log the values when finished?
  let promiseArr = [];

            for (let i of json.articles) {
                promiseArr.push(checkValueWith(i));
            }

            checkAllValues(promiseArr).then((res) => {
                console.log(res);
            });
function checkAllValues(arr) {
        return Promise.all([arr]).then((res) => {
            return res;
        });
    }
14:03
@lix You're wrapping the array with another array
Promise.all() accepts Promise[], not Promise[][]
ohh
hey
!!shrug
¯\_(ツ)_/¯
¯\_(😃)_/¯
@MadaraUchiha I'm so damm close I can feel it
god this is taking forever
14:04
:o@MadaraUchiha
@lix where do you want to finish?
I had to
redacted
Not specific enough
The last thing to figure out is given an array of true / false
how I can use my filter to match those values to the articles
      checkAllValues(promiseArr).then((res) => {
                return Promise.all(
                    json.articles
                        .filter(article => res)
                        .map(article => {

                            let desc, title;

                            if (article.description != null) {
                                desc = article.description.replace(/[^\x20-\x7E]+/g, '');
                            }

                            if (article.title != null) {
                                title = article.title.replace(/[^\x20-\x7E]+/g, '');
Will it iterate over res each time an article is passed
14:08
well, the result of promise.all will be in the same order.
yeah but like I don't want it to keep taking the first value
as that will always be true or false rather than going through the array
The last piece
Also, you can have it resolve to all the info you need, not just true/false.
this.pool.query('INSERT IN... <- this is where the true/false comes from, right?
It doesn't
   /**
     * Filter new articles based on if description and image may also be the same.
     * @param articleData
     * @returns {boolean}
     */
    function checkValueWith(articleData) {
        return self.pool.query('Select * from `articles` WHERE title=? OR url=?', [articleData.title, articleData.url]).then((res) => {
            if (res.length > 0) {
                return false;
            } else {
                return true;
            }
        });
    }
It runs this function and if it's found returns a true / false boolean
this matches the articles pulled in the above
so each article will be filtered based on each corredsponding value in the promise array at the top
if I can just get it to filter each article on the next value until the arrays finished
it will correctly filter each article as intended
Those are an awful lot of words for what I think is a straightforward operation on a list of articles.
what does that mean?
14:13
Hey, guys, let's say I have the following div: <div>Name Some Name</div>
I then have an input where I write the word "name". How can I highlight the two names on that div based on that input? How can I search the text of that div and then wrap around individual words with certain tags that will alow me to change the style of those words?
I'm lost. Are you inserting or selecting? I see both.
I'm doing both
I'm firstly querying an api which returns articles
I'm then checking inside the database to see if a duplicate exists
if it does I'm returning true or false into an array
I then wish to filter the articles pulled to only leave the ones which aren't duplicates
hold up.
14:16
okay sure
At this point in the story, the list of true/false is what you want to match back to the articles?
to the requested ones yes
user6820627
@lix Hey, you're still working; on your news feed app?
ok. Then in the checkValueWith() above, you can simply return { article: articleData, found: true } or something similar
instead of just returning true/false.
@LearnHowToBeTransparent Yup, going on 3 and a half months
@Luggage good idea, I'll give that a go
user6820627
14:18
👍
I may be a pretty terrible coder, but I don't give up
Though in someways I think it's an advantage to some extent to understand your not the best but you even the odds by working twice as hard.
@lix I mean, that's not really true.
No?
You even the odds by reading code, by writing harder and more complicated things, keeping up on docs, and experimenting.
@lix You even the odds by becoming better
14:24
so more along the lines of become smarter so you work less?
Coding isn't a place where working harder is rewarded by getting the job done faster.
You work smarter, not harder.
good point, thanks
Working extra hard on a side project you're passionate about is great.
If you apply the same pressure at work, you'll get burned out in no time
Reuse existing code when you can, write reusable code when you can't.
"write reusable code" is one of the things you hear everyone around you repeat often
14:26
import 'jquery'
But is one of the truly hardest things to pull off.
done
@MadaraUchiha It took me a while when I started developing to really understand what that meant and make it a part of my life.
@MadaraUchiha does compiling the project twice count as 'reusable' ?
😉
Writing reusable code is often a big design error when it leads to overly complicated one
14:27
@DenysSéguret Only if you're trying to be too clever by half.
user6820627
@DenysSéguret Agreed wholeheartedly.
user2620028
@DenysSéguret i keep running into this problem at my workplace
Hey, guys, I'm trying to replace a word with another one. Can someone please explain why the following is not working: jsfiddle.net/yab2ncw3?
I'm right in saying you use reduce when you want to get a new array while removing ones you don't want?
user2620028
someone makes a function that is literally a swiss army knife
14:30
@DenysSéguret The trick is predicting what's going to move and what is not.
document.getElementById("teste").innerText = document.getElementById("teste").innerText.replace(/nice/gi, 'Different');
(strings are immutable)
If you make the right predictions, maintenance can be greatly simplified.
If you don't (and most of us don't), welp.
A necessary skill devs should have is to look at their project, and try and see how different parts might be reusable in the future. If you can recognize an already existing or future case where something you write NOW can improve previous code or be used to speed up production next time around, then plan on writing something that's reusable. Otherwise write it single use and don't get cute.
@DenysSéguret Also innerText is deprecated since forever @JoãoPaiva
You're looking for .textContent.
@MadaraUchiha of course we all know it's a balance to find. My point was just in warning there is also dangers in trying too hard to build reusable parts
@MadaraUchiha innerText is still useful, though
14:31
Which is why @Luggage was bald by 20.
@DenysSéguret In what scenario?
convert newlines
textContent silently drops them
14:32
Really?
lol no it doesn't.
@DenysSéguret Thanks, it worked perfectly :D
@DenysSéguret textContent inserts the newline as is, which is then interpreted by the DOM as a space
@MadaraUchiha try
document.body.textContent = ["Line 1", "Line 2"].join("\n")
innerText creates <br>s XD
14:34
@DenysSéguret Again, it's not that .textContent drops it silently.
There are many cases where you need innerText because of that
.innerText silently converts them to <br>
Well, it's most usually the useful behavior
See the DOM here
Tsss... you know I know the DOM
14:35
@DenysSéguret Um... no?
I try to avoid <br>s wherever possible, unless very specific things need to happen
@BenjaminGruenbaum ya there? :-)
When you want to pass some text (imagine you have some intl data), you sometimes need the newlines.
Anyone here: ill be talking @ a meetup tonight in NYC meetup.com/ReactNYC/events/239235459 :-)
3
hopefully I dont fail miserably ;-)
Whoa. thanks to whomever pinned that :-)
Well, any talk by a regular is worth a pin, I think
Guys, I need some structuring help: I have 3 components, search, results, and cart; I'm at a point where I need to make a search *only when* an item in the cart is selected.

Where should I inject the "cart items" to check which is selected? on the search component OR on the search service? [I know, 1st world structure problem]
14:37
@Neal Will it be recorded?
I removed the woot seemed inappropriate for a pin :-)
@MadaraUchiha Unfortunately not :-( That has yet to be set up for this meetup
but I hope to speak @ future ones as well on the same topic
And this was all thanks to @BenjaminGruenbaum who connected me with good people :-)
I hope 240 people dont show up. im nervous talking in front of 20 -- this will be a learning experience for me :-)
looks like there is a PR for the TypeScript issue I had
should be in 2.3.3
cloning to test it right now
@Neal I'm going to appear and stage a protest just to keep you on your toes :-)
@TylerH Awwe Thanks :-)
Anyone here going to be there? (or already signed up for it?)
does anyone know why this causes infinite loop?
    		var currentLocation = window.location.href;
    		while(currentLocation.indexOf("liveview") >= 0){
    			window.history.back();
    			currentLocation = window.location.href;
    		}
14:40
@TylerH if we hold up signs accusing him of some war crime a few people will believe it
> Don't listen to this guy that killed 14 people in uganda!
@Neal Should be fun! Good luck :D
> kony 2012 was a scam!
@erotavlas probably because currentLocation never contains liveview
@erotavlas wow... bc the while loop never ended, so the back wasnt able to happen?
@SomeGuy Thank you!
@Luggage Which issue is that?
Is it the one where the imports get removed when there's a spread operator in the document?
14:41
yea
Yeah, that one got us too.
@Neal what do you mean the back never happened?
And without explicitly upgrading too
@erotavlas use if instead of while.
14:42
shakes fist damn you semver caret!
hah, how is that?
ah
I think it's going to be an error now (which is good with me)
@rlemon Can't tell if itty bitty diggers or humongous truck.
as long as it's not silently failing
I have also been working on a "simple" observable library since last week. somehow I got an npm name that noone took yet -- npmjs.com/package/servable
Man-iator?
14:45
IT WORKS BOYS
@Luggage yes. maniator
thank fuck
That is me
@Luggage basically animator with the m pulled to the beginning ;-P
@Luggage @MadaraUchiha thank you guys ^_^
14:47
@Neal I need to do it multiple times until I get back to a particular URL, I was thinking to try for loop if I could access the history but I don't see anything that provides an array of values
@erotavlas you cant do that...
just do window.location = <new url> @erotavlas
I want to simulate the back button press, I can't have the page reload - its single page app
> 12.95 CAD
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14:49
window.location.back DOES a page reload sir (or madam) @erotavlas
out of stock.. but fuck. $13
Bad or good?
good
other sites listing for like $30-35
pi3 is 46.95
@Neal that's not what I've observed
14:49
@erotavlas ok.
@BenFortune yea that's kinda a rip
SPA you want to be using pushstate developer.mozilla.org/en-US/docs/Web/API/History_API
@rlemon Damn, the normal zero is 6.75
@Luggage honestly I was surprised to see that a valid english word wasnt taken yet as an npm module before I took it last week.
@erotavlas history.back() is equiv to hitting the back button on your browser
14:53
@Webloper Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
unlink React I can actually just npm/yarn link TypeScript to test it
thanks for not screwing it up, guys
I need to get value from Promise Object anyone
@Webloper the "value"
use then?
@KendallFrey lol, is that real?
14:55
async foo() {
  const value = await somePromise();
}
Is she really that dumb?
I want to return that value to some variable
2949
Q: How do I return the response from an asynchronous call?

Felix KlingI have a function foo which makes an Ajax request. How can I return the response from foo? I tried to return the value from the success callback as well as assigning the response to a local variable inside the function and return that one, but none of those ways actually return the response. fu...

I already checked that, didn't get the solution here is the partial code for this
this.get = function (key, defaults = null) {
var deferred = $.Deferred();

this.db.transaction(
function (transaction) {

var sql = "SELECT value FROM Options WHERE key=:key";

transaction.executeSql(sql, [key], function (transaction, results) {

deferred.resolve(results.rows.length === 1 ? results.rows.item(0) : defaults);
});
},
function (error) {
deferred.reject("Transaction Error: " + error.message);
}
);

return deferred.promise();
14:58
1 message moved to Trash can
@Webloper Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
you can't do what you want to do.
@CapricaSix ohk, first time here Sorry
@KevinB ok so what's the alternative
All you can do is return the promise, then add a callback to it. As suggested by the answers i linked to.

« first day (2391 days earlier)      last day (2780 days later) »