« first day (3217 days earlier)      last day (1954 days later) » 
00:00 - 17:0017:00 - 22:00

00:08
@rlemon I'm sure you could call and haggle with them.
nahh
I hate sketchy domain registrars tho
00:24
they're not really registrars
they're just squatters
 
2 hours later…
02:19
@Shog9 just for the record, my comment about a CM etc etc was not intended to come off as supporting threatening behavior, it was simply trying to drive a point that said user causes issues (etc) and when questioned, we usually default to what past things have been said, in this case it was you saying we have the liberty to kick appropriately. That’s all, apologies for the confusion.
02:38
@SterlingArcher I know. The problem is... Out of context, it looked... Like something else.
03:22
Hey Guys!
I have a simple question but can't really get my head around it today..
What would be the cleaniest way of doing this:

My string looks like this:
size-42 colour-black escarpin blabla

I would like to extract the "colour-black" to set a variable with it.
This one can be in any position, I mean it can be at the end after blabla or the first occurence of the full String.

However I have the "colour-" variant already setup
so how do I slice the part of my string containing "colour-xxxxxx"
03:54
@bkseen If it's a simple question, I'm confident you can solve it by yourself.
You're right Jenna but a bit hangover today I'm struggling with everything haha..
Wondering if I have to use Slice / Substring / indexOf.. or a mix of them
I would just use split and startsWith
like so:
'size-42 colour-black escarpin blabla '.split(' ').forEach((s)=>{
  if(s.startsWith('colour-'))
    c = s.substring('colour-'.length);
})
btw, it this somehow related to shoes? Because Google says "escarpin" is a type of shoe.
04:11
Thank you very much Jenna, it should work this way after some tweaks :)
yes it is related to shoes
I just realized that "escarpin" sounds a lot like "escargot", and they both are related to feet.
04:30
hahahaha, yeah it's a french word.. but how escargot is related to feet? ;')
 
2 hours later…
06:36
@JennaSloan use the regex powah!
!!> 'size-42 colour-black escarpin blabla '.match(/colour-[a-zA-Z]+/)[0]
@KarelG "colour-black"
 
3 hours later…
09:12
Some web based AR user there ?
I'm looking for image based tracker (any image), not being constraint with a black border, like hiro marker. If you guys have input, you're welcome :)
depends of what you mean with "tracking"
09:29
you want to have it in JavaScript?
I might know some libraries that does such tracking, but I fear that those might be limited
however, there are many facial recognition solutions (not sure which kind of images you want to track)
lookup for tracking.js / tensorflow (not sure if this one fits) and craftAR (not 100% sure of the name *googles*)
@KarelG Yes JS, I want to use it for already existing product packaging (so I can't add a specific marker on it)
LOL at the helpful thing
@BenFortune I saw this one, I checked the demo on the website (samples.argonjs.io/), but I wasn't able to make them work on a samsung s8 (chrome).
But it seems to work with the "samsung internet" app, but image get stretched and rotated making it impossible to use. I'll try with another phone
10:19
Surprised it worked with the samsung browser, though I suspect it's just a re-skinned chrome
Probably yes. After digging a bit, unfortunately it seems that argon was mainly built to be used with Argon4 browser
11:09
can you please help me find an alternative to Next.js?
For example I would love to use Inferno
but one big advantage of next.js is that it can output statically optimized pages, how can I do that with inferno?
11:36
@Aurelius Why do you need an alternative?
@KarelG i just added the grid plugin in to that same library
going to update my plunker
Mo.
Mo.
11:57
Hi all
I really need a help for making Telegram bot
@BenFortune because it doesn't work, and it gives me an extreme sense of pain and of being caged into their uber opinionated framework and way of thinking
Mo.
Mo.
I would be great if any body give a solution for this question stackoverflow.com/questions/57330756/…
0
Q: Telegraf: unable to use Markdown style in reply when there is inlineButtons

Mo.The reply allowed html style with inline button but unfortunately it is not possible to use markdown style with inline button. const inlineButtons = () => { const inlineLinks = [ { title: 'Google', link: 'https://www.google.com/', }, { title: 'DuckDuckGo.com', ...

my main issue is not being able to fetch data from the server in a decent way
this example dosne't even work
@Mo. Maybe you can find anything in here?
@BenFortune because he does
in b4
Any arduino gurus here?
12:07
@Aurelius You can setup an external server outside next?
yet, if it does not work, tell why it does not work
@KarelG I can create a server separated, but I need to be able to do this
return app.render(req, res, '/posts', { id: req.params.id })
pass either the data to the page server side
@ShrekOverflow No, but I might know one. Although I don't know when he last did something with an arduino.
like they are doing there with id
or
like they are doing here
the db object to the req object
so that wiithin getInitialProps I can retrieve the data by either calling the database or by already getting the data ready to be displayed
@KarelG Thank you but I am basically living my life on that page, it doesn't work becasue the custom server.js file it gets completely ignored even if you change the script
you can put anything in there but the server is ignored
so this page which is supposed to get the data from the server by the id parameter it doesn't get anything
server.get('/posts/:id', (req, res) => {
    return app.render(req, res, '/posts', { id: req.params.id })
  })
if you access that url directly of your deployment
with a random number as post id
you get 404 not found
as if next.js looks for the page named 2.js within the folder /pages/posts
that doesn't exist, while instead the request should be catched by the server
and sent to the posts.js page with the id paramter
Mo.
Mo.
12:36
Let me have a look
Thank you very much
Good luck \o/
12:51
@Aurelius That example works here.
13:03
@BenFortune really? By just doing:
yarn create next-app --example custom-server-express custom-server-express-app
and then now?
if you visit /posts/3 you see
My blog post #3
?
how is that possible?
Hello, everyone. I just want to know about a certain practice related to Front-End / JavaScript if it is bad or good
Why is it not possible? You're obviously doing something wrong
oohh that's the catch
!!
13:11
@Aurelius That didn't make much sense. Maybe you meant: 3, u, d, y, !, ^, π, ?, א, x
you are doing it in local
next.js behaves completely different when you deploy the project with now, compared to when you are in development mode
so everything you do in development mode doesn't even count
today i have written a piece of code that uses a boolean variable with three states, null, true, and false, the var is called testWasTakenSuccessfuly it starts with null value, so the modal is not shown, and when the process gives a error i set it to false, otherwise, if the process goes well, i set it to true
the modal is used to show error or sucess message, it only appears when you have a trueor falsevalue on that variable, otherwise, when null the modal is not shown.
i want to know if it is a good practice to use that only one boolean variable to handle that
with null, true and false values
this is also another huge drawback of next.js because you can make a beautiful working application but when you deploy it everything you have done goes to the trash
@BenFortune so yeah in localhost everything always works very well
but thank you so much for trying
@BenFortune and it looks impossible becasue it is just two commands, how can I make something wrong if it is just two commands?
@BenFortune Okay did you click on the link on the first page?
Try to put in the url /posts/3
13:20
if page 2 works, why should page 3 not?
@KarelG becasue of this
  <Link href={{ pathname: '/posts', query: { id: '2' } }} as='/posts/2'>
    <a>post #2</a>
  </Link>
Lol are you talking about the SSR aspect of it?
You need a catch all, since everything renders off /
of course that's point of having a custom with express
@BenFortune the catch all is there
  server.get('*', (req, res) => {
    return handle(req, res)
  })
but posts should be handled by this
  server.get('/posts/:id', (req, res) => {
    return app.render(req, res, '/posts', { id: req.params.id })
  })
13:33
there is any place that i can ask a question about javascript good practices and have a feedback?
@PauloRoberto not here?
13:53
@PauloRoberto What is your question?
Hi, I've got question regarding downloading files from server and opening it in client. How could I open particular file in preview mode in application responsible for handling particular file's filetype?
I.e. when downloading excel sheet, I'd like to open it in Excel right after downlaoding to local, when downloading .csv I'd like to open it in i.e. Notepad.

Is there any builtin method which automagically handles and decides which app should be invoked?
My question is about Javascript Good Practices, that is, i am using a boolean variable that is having three verified states, null; true; and false and i am using these three states to verify wether a Modal is not visible, is on Success mode or is on Error mode.
but since a boolean is meant to have two states usually, true or false only, so i doubt if using the null state as a thing, also, is ok.
i have two checks,
`if (booleanVar === false) show error modal`
`if (booleanVar === true) show sucess modal`
otherwise the value is `null` and it does not enter in any of two ifs
so the modal is not shown.
this way i am using only one variable to control modal behaviour
but the question is: is it a good practice on js?
confusing
so no, not good
@PauloRoberto I personally prefer using maps when I have more than a true|false scenario i.e. ({"1": ()=>{...}, "2": ()=>{...}...}[currentCase] || (_=>_))()
14:09
I wouldn't even map it
if( shouldShowError ) showError();
if( shouldShowSuccess ) showSuccess();
just have two flags
if you had it controlled from a single var before, there shouldn't be a case where both would be true
so why bother coding for that case?
and this is much clearer
I'm guessing it's easier to return 1 variable compared to an array or an object
> return 1 variable compared to an array or an object
think about that for a second
😛
1 value *
:p
var flag = (() => null)() just seems preferable to var [value, hasValue] = (() => [null, false])()
actually looking at it again, its not bad
legibility is also a thing to consider
since i am not coding alone
nobody has a clue why in the world that example doesn't work?
14:25
What example doesn't work?
15:01
Hello @ll
Hello samiraclewhip
15:15
o/
Is it possible to replace dynamically a part of js key?
As in the CO part in this.commodities.CO.name
well,
what do you mean
replace
you can certainly add/remove properties from most objects
what's the goal?
this.state.map((val, key) => {  commodities.forEach(commodity => commodity.CO.name)  })
I want to replace the CO with val
so you want to store the object currently stored on CO on whatever string value val contains?
Don't mind the syntax
15:26
commodity[key].name ? Your question is extremely unclear
[val]
Yeah, let me see what I can do. It doesn't work like that @ndugger ... let me try to fiddle
Yes it does work like that, that's bracket notation
If it doesn't work for your case, then clarify your question so it makes sense
also...
you're using .map, but you didn't return anything
forEach would make more sense if you're not trying to make an array
but..
objects don't have either method?
15:30
I am using React, I think that's required
I mean, yeah, if it's react, this.state is an object, not an array
(to use map to render a view)..
can state even be an array?
I don't think so
If you set the initial state to an array, it might take, but then I think setState would break
well, you can proxy an array
so... maybe it can work?
15:33
Ok, so let's say I have an <option>tag , and I will just dump via console.log some values
{
  this.state.prefs.map (
    (c, k) =>
    <option key={c} value={c}>  { console.log(k, c, commodities, this.state) }  </option>)
}
Assume I have that ^
that's different from what you have above, but this seems better, so ok
And that is the console dump
The goal here is to have final output of <option> like this:
<option value="CO"> Corn </option>
I can do a couple of foreach outside the view to get what I want
Ok... so... you have an object
that object has keys
But my js is bad, it would be ugly
name, and code
you should use said keys to ge the value of those keys
not everything has to be done with a loop
15:38
First of all, can you name your variables properly instead of single letters? Anyone reading your code will hate you.
@ndugger This is actually an app for a job test
So then it matters even more
Yeah, I thought value, key can always be assigned single letters :/
thanks for that though
sure, maybe, if you use k and v... not c and k
but even then, probably not
15:39
still, I see no way to solve this issue @KevinB...
> Corn
I'm listening
this.state.prefs.map((pref, i) => (
    <option key={ i } value={ pref }>
        { commodities.find(commodity => commodity.code === pref).name }
    </option>
))
I think
I can't really tell what your data structure is
Seems really disjointed
I'd probably refactor it so it's easier
Yeah, will do. thanks
{ CO: 'Corn', AP: 'Apple' } would be far easier to use
or even { CO: { name: 'Corn' } }
CO: 'Corn' would be easiest to consume
15:48
Yeah, looking at his data now, it's pretty weird
[ { CO: { name: 'Corn', code: 'CO' } }, { ... } ]
for( const [ key, value ] of Object.entries(obj) ) {
  options.push( <option key={key} value={key}>{value}</option> );
}
Like, that's ridiculously stupid to work with
then you could do something like this
good morning to everyong
If that came with the coding test, I'd make sure to call out to them how awful the data is structured
15:49
{
  "name": "",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "bcrypt": "^3.0.6",
    "body-parser": "^1.19.0",
    "express": "^4.17.1",
    "file-type": "^12.0.1",
    "github-oauth": "^0.2.2",
    "i18n": "^0.8.3",
    "jsonwebtoken": "^8.5.1",
    "lodash": "^4.17.14",
    "mailgun-js": "^0.22.0",
    "moment": "^2.24.0",
    "moment-range": "^4.0.2",
how can i run this project ?
locally?
I changed the data actually, thinking it would be easier that way @ndugger
npm install && node .
probably
@samayo well you made it difficult for sure
i ran npm i
so now start the app. npm start or node . should work
15:50
@ndugger so, which one do you think is easier
no
i get an error
> no
fix it
Well then tell us the error
export const commodities = [
  {
    "CO":{
    "name": "Corn",
    "code": "CO"
  }},
  {
    "SB":{
    "name": "Soybean",
    "code": "SB"
  }},
  {
    "WH":{
    "name": "Wheat",
    "code": "WH"
  }}
]

export const commodities = [
 {
   "name": "Corn",
   "code": "CO"
 },

 {
   "name": "Soybean",
   "code": "SB"
 },
 {
   "name": "Wheat",
   "code": "WH"
 },
]
15:50
jesus christ
Can we read minds?
an error doesn't mean what you did was wrong
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: start
4 verbose stack     at run (C:\Users\eduardo.herrera\AppData\Roaming\nvm\v10.16.0\node_modules\npm\lib\run-script.js:155:19)
4 verbose stack     at C:\Users\eduardo.herrera\AppData\Roaming\nvm\v10.16.0\node_modules\npm\lib\run-script.js:63:5
at least, not always
@samayo the second one is way better
15:51
okay, so then did you try node .
like I said
I can't remember what the filename npm start looks for
4 verbose stack Error: missing script: start
but it obviously isn't index.js
one of them looks for index tho I think
otherwise just run node path/to/index.js
@ndugger Really? But with the second one, to find Corn you have to iterate through the entire list and sub list, but with the first one, you just iterate once.
yes i have that structures
and if that doesn't work, show more of what the app looks like. because package.json lied
15:52
i included index.js
@samayo with yours you have to do way more work. With the second one, the code I gave you should work, where you use Array#find
included it where
Your thinking is backwards
I don't think so
15:53
okay
Well, then continue to struggle
@EduardoHerrera okay, explaining it isn't working. so just read this stackoverflow.com/a/37153607/829835
Enjoy not accepting help
> comes here asking for help
> receives help
> says that the help is wrong
move on dude
sorry
you're right guys
15:55
I am not saying you are wrong, I just think you didn't give it time to understand my point @ndugger
but it doesn't work
I know my JS is terrible, so I am not going to debate with anyone here
do you have a link to the repository eduardo?
node index.js
body-parser deprecated bodyParser: use individual json/urlencoded middlewares api\auth.js:16:12
body-parser deprecated undefined extended: provide extended option node_modules\body-parser\index.js:105:29
body-parser deprecated bodyParser: use individual json/urlencoded middlewares api\routes.js:35:11
fs.js:114
    throw err;
    ^

Error: ENOENT: no such file or directory, open 'C:\Users\eduardo.herrera\codes\codefrompanama\ssl\ssl.key'
    at Object.openSync (fs.js:443:3)
    at readFileSync (fs.js:343:35)
@samayo I do understand what you're saying, but you're wrong. The way you've structured the data you now have to do what you're claiming you have to do with the second way
Plus, I don't think the interviewers wanted you to change their data layout
As it probably represents a real worl situation
15:56
i ran node index.js
The way you've modified it, you now have to interate through each entry in the array and check for the existence of a key on the object
It's much more difficult
@EduardoHerrera Error: ENOENT: no such file or directory, open 'C:\Users\eduardo.herrera\codes\codefrompanama\ssl\ssl.key'
a file is missing
@ndugger I thought I "improved" their code. I was gonna show my pride during the interview.
until the file exists, the code isn't going to run.
No, you definitely made it worse
15:56
okay
let me share the code
Maybe I should change this as well github.com/samayo/country-json/blob/master/src/… :/
preferrably only the code around line 242
No, that countries one seems fine
It's different than what you've done to the interview test data though
Don't change their expected data payload, though
(unless that wasn't theirs ofc)
yeah, reverting back now
15:58
It's gonna look like you can't follow directions and instead did your own way
I changed the data and it worked, thanks everyone.
Anyone knows, what is best way to deep clone Blob?
deep clone?
You don't "deep" clone a blob, but you can clone a blob with the slice method
oh, ok
16:02
new Blob([oldBlobl], options);
you can also construct a new one
It's crazy how two years ago, I used .find() method to do the same thing, but today I forgot it even existed and just forEached everything :/
I need to tattoo that shit
Just commit it to memory
@rlemon I read here on SO, that this approach will just create reference to existing blob.
1
Q: How to clone a blob in javascript

ncohenI'm desperately trying to clone a blob in javascript without using an external library (such as jQuery). I've tried JSON.parse(JSON.stringify(blob)) without success.

Then do it the way that does clone the data
That was like top google result, my dude
Yeah, I've found that few minutes ago, my dude.
But File() doesn't work on IE.
16:05
Then why ask here if you already knew how?
Well, you're either gonna want to use the mOxie flash fallback for IE, or not support IE
mOxie is a FileReader polyfill written in flash
Used it several years ago
heard about moxie, but it's flash...
If you're gonna need to support IE, you don't have a choice
Beggars can't be choosers
I'm not beggar...
I was just asking questions.
if it can't be done in IE without flash...
it can't be done in IE without flash
if there was an alternative surely someone would have come up with it by now
What a flurry of support in here this morning. I already feel like I need to inject some drugs into my eyeballs
16:08
is it worth considering avoiding the need to clone it?
No, I think I'll try with slicing the blob ;p
Good luck
looks like it's working
hmmm
i mean
i want to run it locally
but i canot
16:16
well from the errors you posted above, the issues seem clear... bodyParser was deprecated, and you're missing a file locally (an ssl key)
> no such file or directory, open 'C:\Users\eduardo.herrera\codes\codefrompanama\ssl\ssl.key'
can't get much clearer than that
It's your own error message. You've gotta read that stuff, it's not just gibberish
16:31
GITHUB_KEY= GITHUB_SECRET=MAILGUN_KEY= MAILGUN_DOMAIN= DB_PASSWORD=n1ep6rbiak9q17jq node index.js
?
whrere should i put this?
16:52
Well for one, you should not put passwords in a public chat
😃
also that's literally the command to run
@JohnDoenym why do you still care about IE? even microsoft says you shouldn't use it anymore.
00:00 - 17:0017:00 - 22:00

« first day (3217 days earlier)      last day (1954 days later) »