« first day (2308 days earlier)      last day (2658 days later) » 

10:00 AM
Why do you need base64?
 
@Sheepy github.com/jacobian64 but it's still don't have that much content. I am trying to git this project that I have been coding. will finish it later though.
 
You can also store blobs in a DB, @elsololobo. Advantage: it's easier to ensure consistency of your data, especially when backup and replication are involved
 
morning all. i'm having some trouble adding a vanilla javascript event listener for something that doesn't exist... haha. So on my page, i load in a modal that contains a form when a link is clicked. I want to have a listener for the onsubmit event
 
select form -> listen to submit event -> handle function
 
@BenFortune thought this is required to send an img via ajax to my server
 
10:04 AM
= querySelector + .addEventListener('submit', handle) + handle()
 
@DenySSeguret oh ok. I will read on it
 
Why is atob and btoa called that way?
 
Note that when you start storing TeraBytes of images, you'd better store it out of your relational db
@BenjaminGruenbaum in the same logic than atoi and itoa I guess
 
@BenjaminGruenbaum guess missing knowledge :P
@DenysSeguret ok. based on what you said, i guess writing it to the filesystem and storing the path my db seem to be the best way
 
never store a path in the db. Store a hash of the content in the DB and use also the hash to define the path
(it's common to use the first 2 or 3 letters of the hash as directories/subdirectories, or for choosing the server)
 
10:08 AM
@DenysSéguret I recall a client project whose was something about a forum. Each post has an avatar of the user to it (like this chat). Those images are stored in the db. Guess what, the client complained about "too much traffic" while there wasn't an issue at the beginning.
 
@KarelG But I am getting bald, fresh air blows through my baldness >.<
I may need to build muscles and join basketball T_T
 
there are others whom are becoming bald or getting gray hair
 
@KarelG are you ?
 
none of both :P
 
10:11 AM
I feel left out
 
@KarelG the querySelector won't work if the form doesn't exist on the index page though, no?
 
It depends of how you life and also, it depends of the genes too
 
Yes I have dirty genes
 
it's been a long time since i've done some JS
 
@Jarede the submit won't work either
:P
"nothing to submit"
 
10:13 AM
But my grandpa had all his hair and teeth
and he was tall
like 7 ft
When I was a child I could roll over his back , his back was as flat as a bed
 
So I'm making a year-sized datepicker based on JqueryUI.datepicker and it has to have year scrolling as separate buttons. Is there anything terrible about this code here: jsfiddle.net/m4dr82p2
Should I not use internal functions with underscores?
 
why no use lodash ?
 
Already using jquery in that project
 
what about scenario 6?
 
@FlyingGambit I dont think objects are passed by refernce
otherwise you could point the refernce elsewhere
im typing lying down
 
10:19 AM
Hey fellows,
Im not used to manipulate JSon file, but is it normale that JSON.Stringify return something like this : ?

"{\"message\":[{\"user\":\"Coast\",\"date\":\"18:06\",\"message\":\"Hey !\"},{\"user\":\"Yolo\",\"date\":\"18:06\",\"message\":\"Salut toi !\"},{\"user\":\"Coast\",\"date\":\"18:06\",\"message\":\"C'est beau non !?\"},{\"user\":\"Yolo\",\"date\":\"18:07\",\"message\":\"MAGNIFIQUE !!!\"},{\"user\":\"Anonyme\",\"date\":\"9:51\",\"message\":\"test\"},{\"user\":\"Anonyme\",\"date\":\"9:52\",\"message\":\"test\"}]}"
 
i think what is passed is a copy of the refernce
so if you manipulate the data in the refernce it changes the data
 
With \" instead of simple double quotes ?
 
but if you point that copy to another thing the original ref doesn't change
make sense?
 
@KarelG so i get TypeError: Cannot read property 'addEventListener' of null. when you load the index page
 
but when you pass a primitive type, its doesn't have psedu-pass-by ref behavour as primative types are immutable
 
10:23 AM
please have a look to the image I just posted above
 
@Baldráni Run JSON.stringify again on the result should get you an object.
 
I need to figure out what action I have to do at scenario 6
 
@Jarede if the form isn't there, there is no reason to listen for its submit event ... get the item, check if it exist. If so, listen to its event (just if (form) { form.addEvent....)
 
@neoDev Solution of Scenario 6: Contact customer service who will ask the developer to to unlock the account.
 
ok
tahnk you
 
10:26 AM
@neoDev If you don't want an expire or automated unlock system, like those password recovery systems, you don't have many options.
 
@Sheepy also last think please:
what are the possible scenarios for scenario 3?
1) database updated manually by admin
2) ...?
 
neoDev, you're doing good. Better than some months before.
 
@KarelG thanks! :) Hope you're not joking lol
 
@Sheepy So stringify twice could be a solution ?
 
why should i joke about that.
 
10:28 AM
@neoDev Technically, a sufficiently skilled user can send you any cookie they want to. In reality a database update or backup restore are both practical scenarios.
@Baldráni Sorry I made a mistake. Moment please.
 
@Sheepy token must match a pattern (min legth, max lentth, character set)
anyway, I will think about scenario 3
 
@Baldráni Let me correct myself. It is normal for stringify to return a string like that, yes. You can store it as text and later load it and run JSON.parse on it to get the object back.
@neoDev For example, if there has been a system failure, database failure, virus attack, or accidental rm -rf, then you will need to dump a backup.
 
after fire the backender
:D
joking, I am the backender lol. The only person in the company that I do not have xD
 
Me too. I know I've accidentally overwritten more than a few production files. Thanks git for being the hero. :)
 
@Sheepy Ain't it strange that Stringify is adding extra character ? This is highly problematic for huge json file ain't it is?
 
10:34 AM
@Baldráni The quotes is not a real part of the string data. I guess you are logging it in console, in which case it's the console that is adding the quotes in order to display it as a valid js string.
 
does someone has an updated blog post (I've used this before) for rolling es5/6 js files through babel + (optional browserify) + minify ( used gulp). But i'm a year further, and want to see if I can update that.
(or a guideline whatever)
 
@Sheepy this is how it is displayed in Atom :/
 
@Baldráni "\"" is a string of a single double quote. You can save the string to a text file or database to see the plain text data, instead of a javascript string version of it,.
 
@Sheepy 'Right :) Ty for the long answer !
 
Ouch. I am doing my best to give a short answer >_<
Which is why programming doc is so hard to read, I guess. :|
 
11:07 AM
@SuperUberDuper I think we are talking of the same thing
@KarelG are you married ?
 
nope
 
are you planning to ? in near future ?
 
gents, anyone have experience with bitcoin?
 
don't ask to ask, just ask
 
@FilipDupanović no but I just know that one of my account has 0.0078 bitcoins for watching advertisements
 
11:16 AM
hmm, might need help with formulating the question... I need to set up a service for selling tickets, just trying to figure out how to bridge incoming txs on a wallet and user accounts so I know who made payment
 
@FlyingGambit Brave?
 
@littlepootis I am more of a coward
 
nah I mean
Are you using that browser?
 
never heard off it :|
 
It pays you for that, iirc.
 
11:22 AM
Naw, I got it through Second Life
Is Brave better than Chrome in terms of usability ?
 
To be fair, a marriage isn't so important for me. However from juristical reasons, it's advantageous, but ...
I don't need a marriage to express my love
 
what's love
 
The act of hugging ?
@KarelG If you ever decide to adopt, just remember that I am available
 
@littlepootis love is i.imgur.com/YsbKHg1.gif .
adopting a male whose is older than me ?
 
why not ? I am bald as a baby
If they can do it then we can do it ^
 
11:27 AM
@KarelG yeah, that's pretty much it
why older
 
Dont ask questions , Love is Blind
It has happened before
for example
Caligula adopted his horse as consul
 
and some people have parents that have the same name as they do
 
Like Dad Geroge, Mom George, son George and daughter George ?
 
@FilipDupanović that's not love, that's abuse
 
They can say , its a second family name
Why isnt the image collapsing ?
 
11:41 AM
@FlyingGambit i really hope they aren't into each other
 
They are married couples
 
How is that possible
I don't even
 
@KarelG Don't get a baby. >_<
 
12:03 PM
omg lol, someone got wine running on the ubuntu subsystem running on windows.
 
Anyone dealt with keyframe anamition issues on IE ??
 
12:19 PM
@Sheepy one of my life goals ....
 
Hey everyone, can someone point me to some article that explains how fonts work?
 
doctor google could have answered already
 
0
Q: For loop (jQuery) not working on firefox

kanishkaI found the following code works fine for chrome but not for firefox: for (f in b) d[f] = a.style[f], a.style[f] = b[f]; Is it this format does not work for firefox?

I had to check what it does... I'm not used to play with those precedence rules...
Seriously, this question should be closed, though
 
12:39 PM
uh, would that , not lead to an another assignment ?
 
assignement here are done prior to the comma operator
(according to my test, I'm too lazy to check the doc)
So a=b,c=d; is different from a=(b,c=d);
you'd get the same result with a semicolon but then you need braces because of the for
 
yarr tested it quickly. Still it is hard to read
why does browerify not load the babelrc file from where it's operating. It checks the directory where it's doing action but stops because it's not present there ...
I'm not going to put that in all different projects @.@
 
Hi everybody!
 
@SuperUberDuper teach what
 
@caballerog o/
 
12:52 PM
@BenFortune \o
 
\o/
 
/o\
 
\\o//
 
@Manuel 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.
 
/o/ \o\ /o\
 
12:56 PM
    // in a node scrip that i wrote, file = path to file (eg C:\dev\.....\foo.js
    browserify(file)
      .transform("babelify", {presets: ["es2015"]}) <---- problem
      .bundle()
      // ect

     stupid browserify is checking C:\dev\.....\ for preset while it should check the current script page
docs are poor ;_;
 
1:09 PM
.babelrc it
 
Hey, my friendly bash guys, I need some help. I am trying to pipe some commands to a java install, I basically want to automate an app install. See below for what I need to do for the install to work.
`press 1 to continue, 2 to quit, 3 to redisplay
*now I press 1 and then enter*
press Enter to continue, X to exit
*now I press enter*
press Enter to continue, X to exit
*now I press enter*`
 
@rlemon it works. but why does it not work if I define it in the .transform function ?
 
no clue
 
i'm currently updating my node script to browserify + babel (babelify) + minify (uglify2) for desired js files
gotcha use latest preset to be futureproof
 
@KarelG If you didn't have a bundler until now
Go with webpack 2
 
1:22 PM
it has so many config options. nice :P
uh that .babelrc didn't do a thing
 
can someone help to include multer into my class structure? I have created a working example without class structure, but now trying to apply this to my real code, i run into some problems. jsfiddle.net/0adypL8n/2
do i probably have to init it in the index.js rather then in my class?
 
@elsololobo You're using an array in the second example, but not in the first.
 
1:38 PM
but i also can´t do ` this.router.post('/', [multer({dest: './uploads/'}), this.saveImage.bind(this)]);`
my problems is, because the class part is more seperated and i don´t know where to put this things now
 
@elsololobo Why are you putting it in a class to begin with?
What are you abstracting?
 
thought this would be a good way to split different aspects of the api
worked good for my first express project
I found out that this way makes it good expandable for the future
 
1:56 PM
that contains a lot work
 
none of my crafts are compact.
I just keep adding rockets till it gets where it needs to go
 
@rlemon Ion engines are OP
 
being able to idle for a year in a return capsule is OP
 
Use a mod so that you have to pack enough snacks and poop bags
 
I've tried the mods that add life support. they are.. a little too challenging.
 
2:09 PM
damn ... i even used babel preset latest and Edge still complaints with " Object doesn't support property or method 'forEach' "
 
@KarelG Uh, has it ever?
 
recently yea
(assuming nodelist)
 
yeah, i'm using that on a result from querySelectorAll
arrays are fine
 
Ah, I'd use Array.from anyway.
 
same
nodelist.foreach is pretty new
 
2:11 PM
I'm guessing it's polyfilled (in babel)?
 
no clue what babel would do with it
I'd assume leave it alone
 
babel didn't transpiled it
:|
 
I don't think polyfills are part of the latest plugin though
 
the latest preset ?
 
Or even part of transpiling
> the polyfill is required at runtime.
 
2:18 PM
@Thaenor You want to learn font rendering or font structure or using web font or what?
 
meh, i turned back to Array.from if the object is a nodelist
solved the things.
 
TIL 2*C is not that cold
 
It depends ... if there is too much wind ... then it would
but almost none and sun is shining, then it doesn't feel cold
oh rlemon, that .transform( ...) uses a path search. It expects a preset being saved globally in npm. I had to wrap around that by injecting an absolute path to the locally saved preset
 
weird
 
@Sheepy font structure
I've googled the issue. What I learned is that you can either import a font via base64 or give it a static path like "./public/fonts/someFont.ttf"
 
2:30 PM
if you use .babelrc, it checks there first
 
I wanted a way to use the second but without using a static path.
And not having to paste that fuckton of base64 code
 
good morning everyone
 
@Luggage so its snowing :o
 
@Thaenor Oh. You just want to use font. I am thinking strokes, kerning, ligature, and things like that when I say font structure...
@Thaenor Don't inline a font with base64. They are inefficient and may be uncachable. Always use a path. CDN is even better. Google font has ready-to-paste code available.
 
Is that how cloud typography works?
I've just got a better understanding of what I'm suposed to do. We're using some paid fonts. So we can't just leave an open path on our code, because someone would just steal it.
base64 leaves a huge wall a text - and for the above reasons it's not a valid option.
 
2:44 PM
paid only means you own a licence
you can't 'hide' it from the user
if they wanna seal it, they're gonna steal it
 
@Abhishrek yup
 
@rlemon ok, so maybe I still don't have a clear understanding of the surrounding problem. But I think it's settled that neither of the mentioned solutions work for me. So how do I get a third option?
I'm thinking on having a server with some webservice that serves the font.
 
you just use the path option
 
user2620028
if someone wants it they will steal it
 
user2620028
its not your job to protect it
 
user2620028
2:56 PM
@Abhishrek first snow?
 
@HatterisMad second one, first one in which i walked outside with no jackets
very enlightening
 
user2620028
@Abhishrek did you start cursing and walk back inside like a sensible person?
 
@HatterisMad nah, went to starbucks about 1/2 a mile away ordered a mocha and walked back sipping the mocha with one or two "weird" looks.
 
@Thaenor Pay attention to the font EULA, they are so restrictive these days. I have to pay for an app and site license if I have a multiplatform app? bs
 
It's just a little snow, and it's not that cold
 
2:59 PM
yea. 2C is sweater weather
maybe a jacket at night or if it is windy
 
@jake how do font cdn work?
 
user2620028
i cant wait for my girlfriend to endure a winter here
 
@Abhishrek this is only your second snow. You still haven't seen snow around here. This is a very mild winter.
 
user2620028
she hasn't ever been in temperature below 75
 
3:01 PM
@Abhishrek you need you some of this
 
@Thaenor A COMPREHENSIVE GUIDE TO FONT LOADING STRATEGIES zachleat.com/web/comprehensive-webfonts
2
@Thaenor Which cdn?
 
my deck, last year. It snowed another foot or more since I took this pic: i.imgur.com/ReHx9aa.png
 
user2620028
@rlemon wait yeah that is what i imagined when he said snow.... was it like the snow where its nice and sunny out and its not sticking lol
 
ask Luggage
but if it is like it is here, yea
 
@HatterisMad I'm still 1 city over from @Abhishrek but it's nothing.
 
user2620028
3:03 PM
yeah two days ago it was like 70 degrees out and i wanted to get the motorcycle out
 
user2620028
and then yesterday it wasn't even cold but randomly snowed
 
DC is getting maybe a few inches, which is nothing we aren't used to.
 
user2620028
and now today its trying to melt away all the snow
 
user2620028
@abhishrek so how is your time in the states, what are you doing here again i forgot
 
@jake like cloud typography. They load paid fonts given some authentication
 
3:06 PM
@HatterisMad vacations
 
He's also giving a JS talk, and I'll be heckling him.
I brought tomatoes
 
@Thaenor Like typekit?
 
@Luggage just replace one of his slides with the porntab picture
 
!!s/he/ti/
 
@jake Like typekit
 
3:07 PM
you ruined it
 
user2620028
@Luggage please for the love of monty python; do it
 
It may happen be possible that I'll need to implement that type of solution myself...
for waaaaaay more simplified
 
@Thaenor Typekit fonts are blocked by most adblockers apps.ghostery.com/en/apps/typekit_by_adobe because they force you to load their blackbox script that skims info and analytics from your sites visitors.
 
user2620028
@Abhishrek nice dude, have fun with your girl
 
But I could make a font cdn server that doesn't do that... right?
 
3:11 PM
Yes, but your font license probably doesn't allow that.
 
when you "buy" a font, all you do is buy a legal right to use it. there is absolutely no gain in trying to "protect it"
 
^
in the end someone can get your font if they want
 
The license says you are obligated to attempt to prevent the font from getting used by others, which is crazy for a web app.
I avoid commercial fonts.
 
@rlemon so why do some sites encode it in base64?
 
ppfffff
Please kill that one:
-1
Q: Error in jquery missing ;

racemiI know there are already a lots of pots with this error but I still can't find the solution to my problem. Code: jQuery(document).ready(function($){ ... var pathname = window.location.pathname; $('.menu-navegação').click(function(e) { if( pathname = "..." ){ $('#menu-o...

 
3:14 PM
base64 is an encoding, not an encryption.
 
@Luggage It is much worse than that these days. You can only buy a font for a specific site and if you use a CDN service, it comes with font DRM.
 
yea, screw that. I understand they want to protect their product, but I have no interest in dealing with it when there are plenty of free fonts available.
 
@Thaenor try it out base64decode.org
 
why encode the font then?
I'm so confused...
 
base64 lets you put binary data in a place where only text is allowed.
 
3:18 PM
The browser can't speak "font"
 
it's just more compact than base16 (hex)
 
ahhh... so that's the only way to use "font" in a browser.
so either that or fetch it through an url, where you point where the file is
 
$7,000+ for hosting rights 😵 fontshop.com/families/proxima-nova/buy
 
So don't some sites use paid fonts that risk getting stolen?
thus violating their EULA?
 
@Thaenor there are many ways, really have a look at this, it gives you the source to do what you need. zachleat.com/web/comprehensive-webfonts
 
3:20 PM
@jake I'm reading through this article as we speak
 
@Thaenor No they pay big money for the rights to use it.
No business is going to use a stolen font.
 
@jake but the font is still exposed in the website... what's stopping me from going to those sites and downloading the font?
 
haha, businesses use stolen software all the time.
 
Go download it, I am sure the owner would be happy to sue you.
 
perhaps it's watermarked, digitally.
 
3:22 PM
@Luggage The difference being that you are advertising your stollen goods.,
 
So why am I studying this? Just slam a stupid font-face with base64 and be done with it...
 
right.. only steal backend software. :)
 
@Thaenor why base64?
 
@jake that article about fonts mentions nothing about security... right? It's just about the most efficient way to use it.
 
3:24 PM
The font designer commented on the post "I am the designer PragmataPro. I will not take legal action against you, it would be a useless waste of useful energy to create a new version of the font I've built through years of hard work. I will just hope that you will be rewarded in the same way in your life"
 
I use Roboto and Roboto Slab for my reports. Looks good. Free.
 
@Thaenor Yes, there is no font "security" other than using WOFF and WOFF2
 
you want font 'security'? render it to static images on the server and fuck your UX
 
@Luggage Source Code Pro feelsgoodman
 
It's the same security that the tires stacked outside of a tire shop have.
Or a cow. Cows have no DRM. You can just take it.
 
3:27 PM
@Luggage that's an utter disgrace
 
ohh right..
They do have DRM
 
"I’ve read your EULA for WOFF/EOT format fonts. Ridiculous. If this is a standard practice, it’s disgusting. This EULA glorifies prostitution. It makes mopping semen at an adult book store seem like a venerable career." redlegion.org/2014/04/30/An-open-letter-to-fabrizio-schiavi
 
Dairy Rights Management
 
Dietary Rights Management. Fortify your salt.
 
So basically the article provided by @jake is all I needed :)
 
3:29 PM
🎉
 
Unless we decide to go with a font CDN... but I'm failing to see the point... since it risks being blocked by adblockers
 
wat
adblockers don't block a cdn
 
It is really the end-all resource on something that you will write and then forget about.
 
22 mins ago, by jake
@Thaenor Typekit fonts are blocked by most adblockers https://apps.ghostery.com/en/apps/typekit_by_adobe because they force you to load their blackbox script that skims info and analytics from your sites visitors.
 
@Mosho adblockers block typekit -> typekit doesn't load font.
thanks
 
3:30 PM
Not sure of the truth of that, but that is why he is talking about blocking
 
idk what typekit is
 
We dropped typekit and bought all of our fonts because of this.
 
idk what the entire point of this convo is. just load the fonts normally.
 
I only visit sites with the finest commercial fonts.
 
@Mosho You get to load any paid font on your website if you have an adobe cloud subscription.
@rlemon just load the (free open source*) fonts normally.
 
3:33 PM
I think using custom fonts is the worst web dev experience I've had
 
@rlemon and how do you do that? from what I've gathered so far you'll need to use base64 encoding or woff. Either way you'll end up having a css with a @font-face that's gigantic. Because of the wall of text that code takes
 
@font-face {
  font-family: 'MyWebFont';
  src:  url('myfont.woff2') format('woff2'),
        url('myfont.woff') format('woff');
}
 
@Abhishrek we'll have to nag @SterlingArcher later to make hime come out, even if just for a little bit.
or show up at his work.
get him fired, then he has no excuse
 
fill his car with goldfish
 
if it's not already that way
 
3:44 PM
he has a no food rule
I can only imagine why
 
anyway.. gonna hit the road.
 
my teeth hurt.. why do my teeth hurt
 
@rlemon 'myfont.woff2' being the static path to the font file?
 
probably relative path
 
@Luggage I have an even better Idea
 
3:55 PM
because you don't use pepsodent for your teeth
 

« first day (2308 days earlier)      last day (2658 days later) »