« first day (2306 days earlier)      last day (2865 days later) » 

11:02
!!> let f = {a: 'aaa', b: 11, c: '10', d: 'foobar'}; f = Object.keys(f).map( k => f.k = ('' + f.k) ); f;
@KarelG ["undefined","undefined","undefined","undefined"]
what am i missing here ?
(I'm attempting to turn all values in string).
hello everyone,
i need a small favor from someone who can check my page on android mobile.
the problem is i have a wigdet that is positioned as fixed.
there are two in put fields which when focused the page scroll up without centering the focused input field to the center of the viewport.
Code works fine on safari-iphone 5s and ie-windowsphone
@KarelG f[k]?
!!> let f = {a: 'aaa', b: 11, c: '10', d: 'foobar'}; f = Object.keys(f).map( k => f[k] = ('' + f[k]) ); f;
11:07
@KarelG ["aaa","11","10","foobar"]
f.k gets the k key.
* scratches*
but ... f.a === f['a']... :-/
Yeah, but you want f[a]
You're mapping on the key
!!> let f = {a: { toString () { return 42; } }}; f = Object.keys(f).map( k => f[k] = ('' + f[k]) ); f;
@littlepootis ["42"]
11:10
I'm trying to make a button with a dropdown in react. should I make it so that the button and the dropdown are two different components or the same?
@Zirak What post card ?
k is the key, and obj.k should return the value
But inside mapping, it doesn't ?
Le me confused
keh, it returns an array too. Gotcha use the for ... in
!!afk lunch
user6542529
11:27
Hello
user6542529
I'm trying to get an URL from a website that doesn't allow right click and when I check in the html there is nothing
user6542529
It's a one page app
user6542529
Can someone help me ?
Using chrome, hit F12 and use the Elements tab to find what you're looking for
@KarelG k is not the key
11:35
@littlepootis KarelG is afk: lunch
hello everyone,
i need a small favor from someone who can check my page on android mobile.
the problem is i have a wigdet that is positioned as fixed.
there are two in put fields which when focused the page scroll up without centering the focused input field to the center of the viewport.
Code works fine on safari-iphone 5s and ie-windowsphone
http://thekabir.in/onsitego-planlisting2017/index-mobile.html
click on the chat widget(bottom left) after the page loads
click on get a call and click on name input field.
@FlyingGambit the post card. It's a tradition out of zirak's kindness
I just realized: JavaScript is bad
you're not welcome here anymore :P
stop spreading lies
what don't you like about it?
function* asyncReduce() {
    const sum = yield* [1, 2, 3, 4, 5].reduce(function* (m, n) {
        return (yield* m) + (yield delayed(n));
    }, function* () { return 0; }());

    console.log(sum);
}
I don’t like that this is a thing I actually wrote in an answer, that’s what
11:40
that's up to you
any language can be bad if you use it in ways that make it bad
In actual seriousness: JavaScript is fine but I like ES5 best
that's one messed up function though, agreed
a bad thing coming to ES is: decorators
if they worked like Python’s, they would be good
meh, I'm happy because template strings, promises, and lambdas, mostly, and I do agree that generators aren't a good idea unless everyone around you is very familiar with the patterns that come with it
instead they’re restricted to class members for no reason
Arrow functions are nice, true
user6542529
11:42
@ivarni there is nothing
Promise libraries worked in ES5 already and are better than native versions
I don't necessarily agree
but then again, I barely ever use promises
I need some advice, it's been 1 long week where i've been looking for a working date time picker
So I'm wondering what datetime pickers are you using in production?
@towc Eh? I didn’t even think that would be contentious
@Paran0a I'd recommend jQuery UI, but then again, it's jQuery
11:45
jquery has a bug when I use a certain format
bluebird has great stack traces and a ton of utility functions and was faster than native V8 promises last I checked
@BadgerCat Hah, thanks! :D
@Ryan they might allow for better patterns and development in general, which is undisputably a good thing, but I'd still rather use native because of loadtime, not relying on other things, and just having a constant base that we can all use
Promises/A+ already solved the “constant base” thing though
by constant base, I mean native
11:47
and load time = browsers = you can’t use native promises anyway
(unless you don’t care much about compat)
(which is fair for some use cases I’ll admit)
I have this thing where usually the minimality of setup has more weight than the ease of development, but that's personal
I generally agree! With the literal single exception of bluebird =D
if I learn, say, ThreeJS without knowing webgl or canvas, then if I won't have the library readily available (say I need to develop offline, or something else is wrong), I can still do things
I can just get on a computer and do things, without having to memorize urls to download things from or google stuff
or maybe I'll get into a company who's using a completely different library and they can't take loading another library as well, even if I don't know the tech they're using, I can always fall back to the thing that requires the least additional setup: whatever the browser already has available
11:54
@littlepootis wha ... if you're into semantics, then k is one of those enumerable properties.
@KarelG Yeah, but obj.k gets the literal k key.
Whereas obj[k] gets whatever key is contained in k
how comes that it doesn't occur if you use for .. in ?
@KarelG yes it does
what do you mean?
0
Q: generate Image on one event using canvas and jquery

Ram SinghI wanted to generate image of html dynamically, i used the following code for same: convert-html-to-image-in-jquery-div-or-table-to-jpg-png right this functionality is using two events, one is to generate image and second is used to download image. but i want to do it in one event, means when i...

please help me
!!> var a = { b: 1, c: 2, d: 3 }; for( var key in a ){ console.log( key, a[key] ) }
12:05
@towc "undefined" Logged: "b",1,"c",2,"d",3
@RamSingh that only requires a single click
oh nvm. You can simply emulate a click to that last button
ha
i need to check that again
$("#btn-Convert-Html2Image").click()
That timeout though
hahahaha
it's not pretty, but it works
12:16
@RamSingh deleted the post? hah pity you
Maaaaaate, I was just about to answer. You suck.
> You suck - @BenFortune 2017
@towc I am definetly getting it
Sometimes you wonder whether some people who ask questions are really developpers
More a lack of basic math understanding
12:32
node.js prod anyone?
I want to ask a thing or two related to node clusters
Hello
How to create .env file
in windows
as filename is must so how to create this file
touch filename.env
@ivarni that person lacks more than the ability of understanding math only...
@littlepootis in windows
?
A great sage developer once said "we are developers, not mathematicians"
12:41
I have consumed a lot of content on the subject
and many users have shown proofs for predominately 3 methods
1 Node Clusters (Native)
2 nginx
3 Iptables
my architecture is such that I will be using nginx on two level, first to distinguish between request made for different clients and secondly for load balancing (different servers)
my this particular question is only for clusters etc for specific machine
I am using nginx twice on top of it so obviously I wont use nginx again
or I can use nginx and separate different individual servers running on machine
ok i got it
its echo .env
it will create file
13:16
@DenysSéguret I can't find a dup, and I don't think too simple is a reason to close it, so I actually ended up answering it.
@ZicoPL 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.
system.import is asynchronous, right?
One thing I really dislike about javascript is not knowing if a function is asynchronous when calling it
that's why documentation exists
Curiously I never wonder whether a function is asynchronous. It always seems obvious.
Tanks for room rules :) How execute jqXHR.responseText from $.ajax?
13:56
any tips to get down bundle size of an app? I have already added the commons chunk plugin, manifest, minifier, etc.
@corvid Use less plugins. They are flexible and easy to use for a price - code size. jQuery stopped talking about lightweight as they added more and more IE fix into their code.
@MadaraUchiha chat.stackoverflow.com/users/7511647/j-reborn Seems like the one-year-banned J.Doe to me. Can you check it out?
@Sheepy I only have 10 npm dependencies in production :\
react, react-dom, react-redux, react-router, redux, redux-thunk, reselect, react-portal, and classnames
@ZicoPL "execute" a string ? (the responseText returns a string)
@MadaraUchiha Nevermind the 'seems', it's a sure thing.
14:02
@corvid Looks pretty neat. Well then, do you know what is taking up most of the space?
@RoelvanUden Thanks, destroyed the sock.
Well I'll be damned.
the gang is all here
Doesn't matter to me - I'm just glad I finally got to talk about pickles on StackOverflow. :P — floatingLomas Oct 31 '12 at 19:16
lold
@KarelG sure but I would like to get script. I call $.ajax in index.js in the same folder where is my library.js which returns as string.. :/
@Sheepy react-dom is huuuuge
the only function I ever use from it is render though
14:07
of course. That point of the library is that all that logic is just one function call to you :)
@SterlingArcher holy f... when have you been that active on main?
jordan made the mad dash for 10K a while back. then mad dash again when he ran for mod last year
@KarelG in short, I want to include a code from library.js in the index.js via $.ajax metod but it returns only string..
I suspect he's talking about your rep
14:09
I am
just realised that you're way beyond 10k
oh lol I've been at 10k for a while. Last years mod run I did a ton of cleanup stuff (hence the hold). Since then it's been a few updoots but mainly old stuff getting rep
@Luggage What function you propose? :)
I wasn't talking to you.
@ZicoPL ofc the ajax returns a string ... check the string content. If it's a json string, use json parse. Or convert string to function. But why are you using ajax if the lib is in same node folder ? (import that lib by require)
14:14
@corvid Well, if you really want, something I have done before is to compress the minified code and decompress with on runtime. Big saves on size, but don't expect it to load quick.
if this is a browser, you can just gzip all code that is sent.
@corvid what web server? browser or electron? how big is your total bundle?
Total build is getting up to about 500kb :\
Trying some async require.ensure loading to break it up a bit smaller
500k minimized?
yep, and that's just one bit of the bundle
@Luggage The gzip as implemented by web servers is not very efficient for compatibility reason. Now you can 7z your code and it'll save a lot more than the gzip.
14:18
total bundle
@Sheepy it can be.. way better than using 7zip thourgh JS.
1. 500k is nothing. Especially if it's cached and you don't update every 5 minutes.
500k is nothing +1.
and if you are keeping your [hash] in your filenames, then you can cache forever
1564kb for the total size
@KarelG I use Content Security Policy and I'd block code from 'unsafe-inline' & 'unsafe-eval' but not for script with attribute 'nonce' so can import with this attribute?
2. gzip. it's the standard and built into any browser worth using
what web server?
new CompressionPlugin({
    asset: "[path].gz[query]",
    algorithm: "gzip",
    test: /\.js$|\.html$/,
    threshold: 10240,
    minRatio: 0.8
}
I use that to pre-gzip my assests so the server doesn't have to compress them live.
14:22
I have a problem with react. If a user is logged-in and looks at component lets say /xyz and press log-out. After log-in again he is redirected to the same component /xyz. How can I prevent this? I´m using hashHistory. But found nothing useful currently
and I can´t update react-router and switch to something new
in index.html I used <script> tag with nounce attribute where add index.js. Here the problems is begin. In index.js i start from:
'
$(document).ready(function($){
jQuery.noConflict();
@KarelG and after this i include library.js via ajax..
Also, this is pretty useful: medium.com/@addyosmani/…
@Luggage So when I have the gzipped files, do I include those?
Or will putting the plain bundle in the index file already imply to get the gzipped version?
6 mins ago, by Luggage
what web server?
I think it's heroku with maybe java? It's only serving up static assets, the dev ops guy is handling that part
then I don't know.
but I have nginx configured to use a pre-existing .gz file when it sees one instead of compressing it on the fly
(which can be slow)
when the client accepts gzip, of course
14:28
It's pretty hard to find one that doesn't and can run react...
yea, yea
o.O" 3 pings in a short timespan
* urges to responds with pong *
luckily the browsers I have to support are only the most modern ones
Does IE1 still exist ?
What does that question mean ?
Does it matter for you when you code a site ? Then the answer is no.
14:33
with 'damn' CSP I've only problems..
No , the question is , does it still exist like ...is it available for download ?
@FlyingGambit Yes and you can install it on Win 95. But even Lynx will serve you better nowadays.
imgur.com/gallery/oXj81 took me way too long to get it
Care to explain it?
why is this false:
false == undefined
false == null
14:37
@DenysSéguretn there is a movie by pixar named "Up".
but this is true
alse == 0f
@Sheepy I might download it and try it out :D just to see how it looked back then :D
Up (2014)
sheesh I wish my chat wasnt white text colour when editing
19
Q: Why (null == false) and (null == true) both return false?

iatboyI know that null is an object with no attributes or functions. However, I am confused that why console.log(null == false); and console.log(null == true); both return false. What are the conversion rules between null and boolean?

14:39
@SuperUberDuper Generally we advise use only strict equal, manually type casting if necessary.
=== unless you have a good reason.
I use foo == null knowing that it'll be true for undefined also. That's one of the only times I can think of.
mithril.js.org sweet, a new one.
mithril isn't new
1.0 is new though.
14:40
^
typeof null lol
ohh yea? Then I am now Luggage 1.0
!!wiki Luggage 1.0
@FlyingGambit The Wikipedia contains no knowledge of such a thing
14:42
lol
what does "[object Object]" mean?
it's an Object
basically that's the toString of an object
yeah I know
!!> const s = {}; s.toString();
14:47
@corvid "[object Object]"
what is the reasoning behind it
did you check google?
it's been discussed many times
Object.keys("hello") always blows my mind. I get that everything in js is an object but geez.
14:48
Guys, can someone help with this? stackoverflow.com/questions/42089563/…
@eric.dummy 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.
@SuperUberDuper Google is your friend: stackoverflow.com/questions/4750225/…
@shriek yea, it makes sense in the spec I suppose.
> Let obj be ? ToObject(O).
Let nameList be ? EnumerableOwnProperties(obj, "key").
Return CreateArrayFromList(nameList).
14:50
@shriek In js there are objects and there are non-objects. Strings are non-objects, despite having methods you cannot assign them properties or extend them or compare them as object.
Guys, anyone?
it's most how Object.keys works
it converts everything to an object then iterates it
@rlemon Holy shit. It has the shortest bars and someone from an IP address of a big company downloaded it once
@eric.dummy What's up with the answer you have?
@OliverSalzburg right?!
those graphs are outstanding
> our project
> other projects + 4 plugins
WE WIN!
14:52
is there a way to automatically log to console result of every command?
instead of doing console.log everywhere
@BenFortune, I can't get it to work mate.. I'm not receiving anything in my console..
@SuperUberDuper That sounds like it wouldn't do what you want
> Please note that the option values are being loaded via ajax request
Adding the code for that would be a start
You want me to add code here?
14:54
@SuperUberDuper if you find something then let me know. I've thought about creating a wrapper function to do that but it just felt hacky and awkward.
@BenFortune, can we have a private chat?
@eric.dummy Also your edit makes your question kinda redundant
say I want to have about 40 commands to teach someone, I don't want to have to use console.log everywhere
@BenFortune, why is that?
@SuperUberDuper Type them into the console?
14:55
too slow
I don't want to type them again
maybe there is a special js runner that will do it
doesn't need to be in the browser
@SuperUberDuper Not sure if it's in Chrome already but in Canary you can set a breakpoint and it should evaluate all the expressions.
There's a command history and auto-complete
That kinda visualizes what you're doing..I suppose.
Call 911!
14:57
@BenFortune ?
@shriek trying it
@eric.dummy Because you say you have multiple forms, but your explanation and code is only for one.
@eric.dummy Can you not, I'll reply in my own time.
Sure, sorry.
Decorators are bae
14:59
javascript is feeling more and more like java.
How dare you.
you shut yer filthy mouth

« first day (2306 days earlier)      last day (2865 days later) »