« first day (2115 days earlier)      last day (2827 days later) » 

12:15 AM
@ndugger 37kb core size. 425kb with aphrodite, immutable and js beautify. I can remove immutable. Can you 'pre-compile' with aphrotite?
 
12:30 AM
hey @Luggage
 
?
 
converting to ISO did the trick
but I did notice the minute precision is off when calling .format on the momentjs moment
 
are you using a format string? Are you using the right capitalization on the "m"?
 
I'm using M for 12HR format as that's what the picker expects
.format("MM/DD/YYYY HH:MM");
 
12:57 AM
capital MM for month and minute? that doesn't sound right.
check the docs.
@BrianJ the proper letters are here: momentjs.com/docs/#/displaying
 
1:43 AM
Well I got my Chef search working.. Decided to make a Location module for each location and just passed those into my Search module. Just hate that it has to search so many organizations
 
1:54 AM
@Luggage The issue is that webpack is also packing up react--which makes sense, but can be pretty big. Did you add minification?
 
 
3 hours later…
4:45 AM
I tried out webpuck for the first time.
My "build tool" is a python script, which makes use of several npm modules.
My script takes 5 seconds to build the project.
Replacing that with webpuck increased build time to ~55 seconds.
Great :)
 
It caches build, if you run it again... less than 0.2 seconds
 
It took 57 seconds the second time. Am I missing something?
 
The joke?
 
oh
So.. it doesn't?
Does it.. minify every library you import?
 
What's your includes /excludes?
 
4:54 AM
I'm using the built-in uglifyjs plugin with:
 18 compress: {
 19         warnings: false
 20       },
 21       output: {
 22         comments: false
 23       }
 
@rlemon @FlorianMargaine happy delayed Friday :p was driving up to an island (Mackinac Island) for the weekend
 
@littlepootis gist or pastebin your webpack config
 
There's also babel-loader excluding /node_modules/.
Removing the uglifyjs thing reduces the time to 5.6s.
 
5:11 AM
That would only excludes files from the babel-loader.
 
Hi guys
@littlepootis err
lets look at your webpuck config?
 
Is your env node or browser..
 
webpuck compiles for me in < 5 seconds from cold start and < 100ms on live reload
are you sure you are not using a pentium?
 
I guess, he's minifying all node_modules..
 
mine does that too
but i am not minifying
but my build version takes 10 with manglenames and smart savings
 
5:22 AM
he pastebined his config.
 
5:33 AM
@cswl browser
@Abhishrek i7, 12gb ram
 
the fuck
thats like a tiny thing
 
Apparently, it 1) bundles every module I require into one file. 2) Minifies it
Takes it a long time to do that.
 
this is what i have
 
UglifyJS takes 2 seconds to minify it. Webpack's UglifyJS plugin (built-in) takes ~48 seconds.
 
including the web request it takes < 5s
but I uglify externally
@littlepootis hey ... can you try updating version of webpack?
 
5:41 AM
From 1.13.1?
 
 
2 hours later…
7:36 AM
you have to use undocumented Webpack features if you want to shave down the build times
child compilers took a whole minute out of my build github.com/ampedandwired/html-webpack-plugin/blob/master/lib/…
I also had to go through the pain of extracting out plugins to handle all that mess with conditional production/development setups
 
8:06 AM
stackoverflow.com/questions/37436728/… I'm surprised no one took the bounty
It sounds like such a simple task
 
 
2 hours later…
9:46 AM
Hello, I have an image where on mouse over on it displays text but It works properly only to desktops. I m thinking to do for mobile another method e.g when scrolling and in center of your screen is the image to appear the text. Do you have better idea?
Check vatitsi.com in mobile to understand
 
 
2 hours later…
12:11 PM
Hi. Quick question: I'm using "@import '../../theme/Common';" in all my SCSS files loaded by react. Will this "Common" file be send to the client multiple times or react loader will take care of it and send it to client just once?
 
12:23 PM
You mean the sass-loader?
 
anyone around?
 
@RadioactiveCoffe Welcome to the JavaScript chat! Please review the room rules. Please don'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.
 
alright, does anyone here know how to simulate a button press on a website using its id?
 
@ivarni
yes, exactly
I use the same import in multiple SCSS files. Will React send this duplicated import to client multiple times or just once?
 
@copy how easy would you feel using BouncyCastle?
 
12:32 PM
@Peter If you're using it with style-loader and css-loader it will compile it to CSS on the server and just send that file once
or rather, it should
Come to think of it. I've not actually tested that specific usecase since I tend to just import a main style file from my app root and have that file import all the others
It should be easy enough to verify using the network tab in the devtools though
If it gets inlined as javascript by the loader I'd actually expect it to be sent several times, try opening the bundled JS in an editor and search for css classes, see if they're repeated
 
it's split into chunks like this
but that's on develop, not sure how it will behave in production..
 
@Peter You probably want to extract stylesheets for production
 
thank, i'll look at that later
 
 
2 hours later…
RK.
2:36 PM
```
all=this.

Gotta
try {and}
catch (em) {all}!

this.is_great
```
returns true.
 
@RK. Welcome to the JavaScript chat! Please review the room rules. Please don'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.
 
@FlorianMargaine but y u no gmail chat is so much better >:(
 
@BenjaminGruenbaum Should be fine, I don't know what I'd do either, maybe look into gpg
@BenjaminGruenbaum Quite
@AwalGarg @littlepootis How's your OCaml career going?
There's an online course starting soon: fun-mooc.fr/courses/parisdiderot/56002S02/session02/about
 
3:17 PM
@copy Thanks, I've found AES GCM does exactly what I need
 
4:11 PM
@AwalGarg my email is Google apps, Google chat works too.
 
 
1 hour later…
5:39 PM
Hi
I don't understand something, what stops websites using the facebook API to click the "share" button automatically with <share button>.click()?
 
@copy I have used OCaml for fun before - this time I needed proper Node and npm interfacing which it seems it cannot provide, so haven't looked at it further.
@FlorianMargaine ahh ok - will check. nothing important though, just wanted some opinions on my next top sikrit project.
@Bálint because it is not a button, but an iframe with a button and a hell other things inside it. and you can't click inside an iframe pragmatically from parent page because of SOP.
And why the hell is Enter not
working :|
 
5:58 PM
g'morning
 
Ahoy hoy
 
> Why do people like Apple devices?
> Maybe they just love challenges
 
Apple needs to release their MBP refresh already
 
Is the Enter key borked for anyone else in this chat? Or did they remove that shortcut?
 
6:03 PM
test test test
works fine for me, win10
 
:/
 
!!choose "play video games" "make video games"
 
@SomeKittens Input not matching /(.*?)s*(,|or)\s*(.*?)(.*)/. Help: User-taught command: $encode($1)
 
!!pick "play video games" "make video games"
 
@SomeKittens That didn't make much sense. Maybe you meant: lick, kick
 
6:05 PM
!!lick AwalGarg
 
@SomeKittens Mmmmmmm @AwalGarg tastes just like schinkenspeck!
 
haha
 
hi folks, if you have nothing better to do please have a look here
1
Q: Google Elevation call works with browser but not with node.js

BeNdErRTL;DR I'm building an application with node.js that retrieves the elevation, starting from an array of latitude/longidtude points. To get the elevation from a lat/lon coordinate, I use GoogleMaps APIs, and in particular Google Elevation APIs (find docs here) Why does this url // FOR OBVIOUS ...

 
@BeNdErR have you looked into setting headers (like request)?
 
no I haven't, good point
you mean both the browser and the request's request headers or one in particular?
 
6:14 PM
I have nothing better to do, still not gonna look at it. :|
 
in node
@cswl that's nice dear
 
cswl I appreciate it anyway
@SomeKittens

headers:Object
accept-ranges:"none"
age:"43"
alt-svc:"quic=":443"; ma=2592000; v="36,35,34,33,32,31,30,29,28,27,26,25""
alternate-protocol:"443:quic"
cache-control:"public, max-age=86400"
connection:"close"
content-type:"application/json; charset=UTF-8"
date:"Sun, 31 Jul 2016 18:15:07 GMT"
expires:"Mon, 01 Aug 2016 18:15:07 GMT"
server:"mafe"
vary:"Accept-Encoding"
x-frame-options:"SAMEORIGIN"
x-xss-protection:"1; mode=block"
 
oh wait
cations=enc:wyitGexebA?PB\&key=XXXX_XXXX
that backslash might be escaping the ampersand
 
oh jesus
you found a bug in the request module
 
I expect eleventy billion rep as bounty
 
6:19 PM
hmmm wait
the issue seems to be another
this is the response.request.href prop

href:"https://maps.googleapis.com/maps/api/elevation/json?locations=enc:wyitGexebA?PB&key=XXX_XXX"
#wherethehellisthebackslash
 
yeah, you need to escape the backslash
 
hmm
 
(why am I in Windows when I can't play games)
 
why can't you play games?
 
Wife's on my Steam account
 
6:22 PM
scream "get your own steam account"
if it does not work try with sudo
 
She has her own steam account I just talked her into playing Portal
 
AAAAAAAA
play portal 2
you can play with her
 
@SomeKittens why? `\` is not a special character in the url encoding spec :)
 
@AwalGarg it is in strings
!!> 'hello\awal'
 
@SomeKittens "helloawal"
 
6:24 PM
@SomeKittens in what context? & should be skipped (in most I know
 
FYI replacing \ with %5C did the trick
 
@AwalGarg the backslash is part of the data he wants to send
 
@SomeKittens I can't give you a bounty as I spended at least 3 days posting that question
but I can give you 25 points if you post the answer
wow you're fast
 
0
A: Google Elevation call works with browser but not with node.js

SomeKittensDepending on how you're forming your strings, that backslash might be tripping you up. The latter section of your URL: enc:wyitGexebA?PB\&key=XXXX_XXXX when plonked into a string, that backslash will be seen as an escape character and vanish. Replace it with %5C via encodeURIComponent

 
ps:
encodeuricomponents breaks the thing
 
6:27 PM
eww
 
{ err: [Error: Invalid URI "https%3A%2F%2Fmaps.googleapis.com%2Fmaps%2Fapi%2Felevation%2Fjson%3Flocations%3Denc%3AwyitGexebA%3FPB%26key%XXXX_XXXX"],
status: 'Erorr' }
request(encodeURIComponent(url), function(){...});
 
hmm... well this is confusing :| if the backslash appears before the ampersand in the string value and not the code, then the backslash should be sent along with the data and the parser on the other should interpret it with the data
 
right, because the full URL isn't a component
just use encodeURI
 
you're right
lemmetry
it's getting worse
https://maps.googleapis.com/maps/api/elevation/json?locations=enc:wyitGexebA?PB&key=XXXX_XXXX
{ results: [], status: 'INVALID_REQUEST' }
 
<div ng-controller = "someCtrl">
    <div ui-view>
    </div>
</div>
 
6:29 PM
the \ disappeared
with encodeURI(url)
 
1 message moved to Trash can
@user125535 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
 
@BeNdErR just for science, do you mind doubling that backslash whereever you have written it in your code instead of replacing with %3C and reverting everything else?
 
yep imma try it
but wait, there's more
locations=enc:wyitGexebA%3FPB%5C&key=

this is the result of encodeURIComponent only the polyshit string
let me try your thing
@SomeKittens with double slash, it works
 
yes, you're escaping the escape character
 
what should I do then?
I could also polystr.replace("\", "%5C")
 
6:33 PM
you've got two great solutions
 
with a global flag at the end
 
@BeNdErR My curiosity is almost satisfied, just one thing - do you mind showing us the exact code where enc (or poly?) is declared?
 
there are no secrets
and the code is on the so question page
var polyline = require('polyline');
var request = require('request');

var poly = polyline.encode([
    ['45.4391630', '11.0120330'],
    ['45.4391600', '11.0119420'],
    ['45.4391410', '11.0117930']
]);
var url = 'https://maps.googleapis.com/maps/api/elevation/json?locations=enc:' + poly + '&key=XXXX_XXXX';
request(url, function(err, res, body){
    if(err || res.statusCode != 200){
        console.log({err: err, status: 'Erorr'});
    }else{
        console.log(url);
        console.log(JSON.parse(body));
 
oh. can you please do console.log([...poly].pop().charCodeAt()) before var url = ... and tell us what it logs?
 
yup
 
6:36 PM
What's the full range of characters for that encoding algorithm.. just replacing `\` might not work for all cases..
 
@SomeKittens console.log([poly].pop().charCodeAt()) prints 119
 
@BeNdErR no, the three dots before poly are important... alternatively you can do poly.slice(-1).charCodeAt()
 
it threw an error with the three dots (anyway what are those three dots?)
I'm trying with slice
console.log(poly.slice(-1), poly.slice(-1).charCodeAt())
// prints \ 92
 
Uh, this is weird. It should work as is then :(
 
I'm going to eat something

@SomeKittens the suspance is killing me... "you've got two great solutions".. still waiting for your two great solutions
I'm gonna get something to eat in the meantime, brb
 
6:45 PM
oh
as in, uri encoding and the replace thinger
you said it worked
 
ah ok
I usually consider bad using replace
 
no no your code is completely fine. I am surprised request is tripping on this. their url parsing doesn't seem to be dealing with backslash (and it shouldn't, either)
 
anyway I'll stick with it
thanks for your help and time
 
7:02 PM
@BeNdErR I tested your code locally. request is behaving correctly and sending the backslash along with the query, and infact exhibits the exact same behavior even with %5C. So wherever you are sending the data is not parsing it correctly (google). (Atleast with the version of request I tested. And I don't have an API key to test your exact code)
 
7:15 PM
how can i change the value of a input field that uses react by injecting jquery/javascript
 
7:27 PM
@AwalGarg what tool did you use to inspect the request?
I simply inspected the request's response parameter
inside that there's a reference to the request and I found that the url of the request was wrong (no backslash)
 
7:56 PM
@SomeKittens What was that drafting website you once used?
 
Drafting?
Like MtG?
 
You used it a few times before publishing your articles
Yes!
Gracias
 
8:15 PM
@Zirak whatcha writing?
 
@SomeKittens A story. Might present it at a local group thing.
 
 
1 hour later…
9:59 PM
The questions were incredibly dumb
 
That was awful
 
^
What are they even trying to prove?
 
i think they want to see the difference between different kinds of education
 
@JonasDrotleff Welcome to the JavaScript chat! Please review the room rules. Please don'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.
 

« first day (2115 days earlier)      last day (2827 days later) »