« first day (2862 days earlier)      last day (2311 days later) » 

00:48
@forresthopkinsa I went ahead and added properties to Vue.prototype. This way certain functions and read only data is accessible everywhere. vuejs.org/v2/cookbook/adding-instance-properties.html
01:38
i'm trying to setup nginx on my ec2 (linux ami) and i can't find side-available anywhere
do u mean sites-available?
it is usually in /etc/nginx/sites-available/
it isn't on my ec2.
[ec2-user@ip-172-31-62-133 nginx]$ cat /etc/issue
Amazon Linux AMI release 2016.09
139
Q: nginx missing sites-available directory

Fr0ntSightI installed Nginx on Centos 6 and I am trying to set up virtual hosts. The problem I am having is that I can't seem to find the /etc/nginx/sites-available directory. Is there something I need to do in order to create it? I know Nginx is up and running because I can browse to it.

There is your answer I think. It wasn't created automatically.
You have to do it manually.
01:44
guy says you can do it if you wanted
what do i want it tho . i just want a single nginx config that proxies a few domain/paths to a few express server processes
so like reverse proxy?
I'm sure someone else here can be of more help.
yes
can i use /etc/nginx/nginx.conf
that file has a bunch of stuff in it
I dont think so.
does it have a line that imports from sites-available?
that's how it usually works, there is a main config file that imports all config files from a directory
yea i'm seeing that
01:53
does ur nginx.conf have include /etc/nginx/modules-enabled/*.conf;
should be like the fourth line
i see a lot of comments
and
@AlexBollbach I had to make my own directory, and added this line to my nginx.conf: include sites/*.conf;
include /etc/nginx/default.d/*.conf;
is default.d a place to put my testProxy.conf?
sorry my bad, david is right
you need this line ` include /etc/nginx/sites-enabled/*;
`
Yeah u can override default
override?
its an empty dir
02:00
or make your own dir
but sure, use theirs
lol
02:46
nginx: [emerg] "server" directive is not allowed here in /etc/nginx/default.d/testConf.conf:1
looks like the include line has to be within an http block
did you put it there?
i changed nothing of /etc/nginx/nginx.conf
it includes default.d in the http block
03:15
Hi all, whats a good way to check if my state attribute is an array of object or not in my React Jest test?
`expect(control.state().Data).toBe(//check if Data is an array of object or not);`
@ZeroDarkThirty except by looping over each element, you can't be certain that each and every one of them are "objects".
sql.ObtainPort(function(res){
SeverPort = res;
ServerPort is undefined but res is 8080
03:37
sounds like you've got on of them asyncs
you're checking serverport before the callback completes
putting console.log(res); below SeverPort = res; Gives 8080
cause i was thinking the same thing
oh weirder...
@david ur right.
all callback hell just took on a whole new meaning
04:04
 
1 hour later…
05:05
0
Q: Callback is not setting variable?

MoonEater916So I have a callback that obtains the port to listen on from a SQL server like so below and a looped output. var ServerPort; sql.ObtainPort(function(res){ SeverPort = res; server.listen(res); console.log("Server Started"); }); setInterval(function(){ console.log("Loop "+ServerPor...

@MoonEater916 you need to give all your code
you are misunderstanding something, which means you're not showing the bit that's broken because you don't think it's broken
thats alot of code...
then try cut it down
to the smallest amount that will show the problem
that will help you to understand it too
because i can tell you that the code you posted in that question won't have the problem
odd...
@david
your going to laugh...
typo
05:27
sever instead of server?
06:06
ya!
06:48
07:14
@Maartenw SOURCE!
Goddamn xD
Hm, copycat.
-1
A: convert the jquery to javascript

Ankit Agarwal$('.progress-bar').attr('style', p); corresponds to the below JavaScript: document.querySelector('.progress-bar').setAttribute("style", p); Considering that you have one element with progress-bar class. If you have multiple such elements then you need to do querySelectorAll and loop through th...

15k user posts a incorrect answer. I tell him, and he's accusing me of not reading the Q/A
Oh, on a "translate this jQuery to JS please" question...
I can't find the source @Cerbrus
I've tried
@Maartenw I can only find ripoffs
@Cerbrus Oh, make that 18.5k
FFs, that shitty answer got accepted
07:27
Please close-vote the question. It's crap.
did, but idk what reason to put. I said "its a fix my code question"
or is it just low quality?
Too broad
Uhh
What the fuck SO
I'm trying to ask a question and it tells me I can only post every 90mins?
07:34
Yeap
I've not posted a question in weeks
Are you on a public network?
I am
On a company network
Maybe someone else asked a question recently
Why on earth would you ever use eval for something that can be done without evil? — Cerbrus 6 secs ago
eval alert! Whoop Whoop!
0
Q: Ngrx store is updated but not displayed

MaartenwI am currently running through a ngrx/store + RxJS6 course and have made several adjustments to bring them up to date with the latest version. This however means that the code in the solution looks different then mine. The problem My store successfully gets all the paprticipants and updates the ...

Oof
had to do it via my phone
07:45
something tells me you mailed the text to yourself
indeed
I attempted to keep it consive and tidy so no way I could type that on my phone :p
any reason why you are skipping 2 values? also shouldnt you be using a selector?
The fake service takes a while to update the value, so the 2 first gets are all undefined resulting in an error ofcourse
08:03
Q: Does this make a difference? I always was taught to just do text/javascript or nothing and even when I spell it wrong it works
Does the browser care or is it a help for humans?
I believe that's more of a legacy thing.
@SurajRao Hey Suraj, I will definetly look into that (As menioned, still learning ngrx) but for this application it should not be needed
08:32
Is it possible at all to set up laravel mix to expose some module exports to the global scope for inline page JS to use?
There's a single page that its content changes only using Ajax, now how should I make sure if the user has not logged out (e.g on another open tab) and redirect the user to the login page? (Is that necessary at all?)
(The backend is PHP just in case)
You can use a poll heartbeat
Every X seconds, fire an ajax request to an endpoint which checks if the user is still logged in, when it reports back that they aren't, do something
If the page is heavily action based, you can build it into when they do things too. If an action causes the server to respond that it didn't work because they're not logged in, then you can do something then too. Depends on whether you want the screen to be open until they perform an action
I don't know poll heartbeat(I'll Google it now thanks) but do you mean I use a JavaScript time interval and make Ajax calls every X seconds?
The former is a term for the latter, yup
stackblitz.com/edit/angular-uwqg6e?file=src%2Fmain.ts Why does everytime I want to make a stackblitz, I get this error?
08:44
Thanks a lot.
Googling the error doesn't provide a solution either, neither does the QnA on stackbliitz
What error?
Import error, can't find files:
src/environments/environment.ts
src/app/index.ts
Yeah I'm not getting that.
Wtf
I save the project
08:49
Oh, you need the editor to be open in another tab for that page.
And it automatically reverts it to the default one
Since that starts the dev server
uhh
I'm not sure I quite understand @BenFortune
The editor (stackblitz.com/edit/angular-ha6g5z) starts a temporary dev server to run the page (angular-ha6g5z.stackblitz.io)
If you close the editor, the dev server is no longer running
hmm I see
Whenever I press save and export the link, it reverts it back to the original state though
like the default created project
08:53
It's not yours to edit, might have to fork it
oh, it is
It is mine
fuck knows then
use a better editor
Someone asked me to provide em with a stackblitz lol
even thaht fucks up
 
1 hour later…
10:13
@RaisingAgent You don't need to provide a type for scripts
Does this count as "typo" ? stackoverflow.com/questions/51893090/…
Hello @Zirak. Long time no see
@DenysSéguret hey :D
I'm trying to differentiate one stylesheet from other, but I kinda fail
externally loaded stylesheets don't have "rules" property, or rather it exists but it's inaccessible
Correct, otherwise it'll be a violation of the same origin policy
10:24
for example, this "document.styleSheets[5].rules" on an externally loaded stylesheet throws an error
Failed to read the 'rules' property from 'CSSStyleSheet': Cannot access rules...
but "rules" in document.styleSheets[5] returns true
yep, you can't read content delivered from another origin
(unless the relevant CORS headers are set (disclaimer: I never tested CORS headers with CSS))
I'm not really trying to read it. I just want to skip that stylesheet. And to skip it, first I need to detect it
where does it come from ? A userscript ?
You can see that the stylesheet's href doesn't come from the same origin, or you can wrap in a try...catch
What's your endgame?
10:28
Google fonts. I'm iterating stylesheets and looking for something in locally loaded sheets. I need to skip externally loaded stylesheets in the loop. The problem is that I can't detect them. Can't use "rules" property because it's inaccessible
That sounds like a good detection mechanism
try...catch the bad boy
I could use the href but that's the last resolt. I thought doing a simple propery check would be easier
54 secs ago, by Zirak
try...catch the bad boy
@Zirak Hey :) @Zirak I know I don't need to, but what happens if I set it to "application/x-ecmascript" and then write normal js, it probably still works
Also @Zirak seeing your smiley face always makes me 😊
@RaisingAgent Let's do a game of Search the Sources
cs.chromium.org is a codesearch for Chromium, we search for your type value and get to a bunch of results: cs.chromium.org/search/?q=application/…
Some of the results are third party, some are tests, but one is interesting and found in mime_util.cc
And there we go
10:42
How do you approach the problem of global + individual page JS files with shared libraries for es modules? I'd rather not have to bundle & load something like jQuery twice on that specific page
I usually have a script element for the shared things and one for the specific scripts
I need at least a little faith that webpack has something that can handle that scenario, because laravel mix is lacking massively
@Zirak woah, is this the matrix? It all makes sense now! Basically it ain't not making no difference at all
I was trying to get the applied rules to an element and try/catch did the trick
@RaisingAgent yeah, feeling comfortable with browser sources is a great fountain of extra knowledge
10:50
sup
Do we still put Shaders in HTML oder is there a better way as of 2018?
11:26
when making demos, it's ok. When not making demos, you tend to have more structured approaches
also, we have template strings now
so it might just be easier to get them in the string right away: codepen.io/towc/pen/yVdKga?editors=0010
1 message moved to Trash can
@JacobSchneider Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. For posting large code blocks, use a paste site like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
yes, yes, shut it bot, It was an accident, I swear
class something {
	constructor () {
		this.value = new bob();
	}
	sayHi() {
		console.log('saying Hi')
	}
}
class bob {
	doSomeCall() {
		parent.sayHi();
	}
}
where in the class bob, I am accessing a variable from the parent class, note that both are instances of classes on the same scope
what is your question?
also, please don't ask the bot to shut it. It's doing a great service for this room
She has feelings too.
Well... She has protocols to simulate feelings.
11:34
I actually feel hurt by that
Haha, sorry, it was a formatting error, where I accidentally hit tab rather than space
my first instict was to say something about that guy being german and to close some of his holes
yea
haha
So, My class,
you still haven't asked a question
yes, I am trying to ask it in a way that will make sense
11:36
you want parent to refer to an instance of something, right?
yes, a property of the something instance
use new bob(this), and create a constructor that defines a parent
so, in bob, constructor (parent) { this.parent = parent; }?
sure
now, shut it
11:38
Tow
you can't tell randoms to shut some of their holes
I will if they mistreat a bot for no apparent reason
I mistreated the bot because she told me to format my code when I pressed tab instead of space and hit enter instead of shift+enter for a newline!
and that was your fault
just take the hit and move on
you might not have expected the message to go away, sure, but how about "woops"
she invited me to the "Trash Can" chat, can't say I'm not a little offended. :/
also, I appologised on the trash can chat
so it's all good
that happens automatically when your messages get moved to another room
11:42
oh
Haha
anyway, so If I want to declare a new instance of the something class but the bob class is required, can I still pass the something instance to the bob class with an inline initialisation?
so for example:
let x = new something(new bob(this))
try and see
k?
this doesn't work
this as an argument
@rlemon Hello
12:23
@towc don't.
12:34
1 message moved to Trash can
@SebastianNielsen Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
you receive a string of HTML code
there is no 'DOM' there
1 message moved to Trash can
@SebastianNielsen Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
is about the best you can do
okay, so there is no way of using the usual findElementsById
no
you don't have the DOM api on node
that's a browser thing
12:47
hello
why do i lose the backslahses ?
@Joseph backslashes must be escaped in string literals
!!> "^Releases\GP-PLURI\GP-PLURI V2.2.0\GP-PLURI V2.2^"
@DenysSéguret "^ReleasesGP-PLURIGP-PLURI V2.2.0GP-PLURI V2.2^"
i get it but how ?
should i add \\
yes
12:50
ok but can i not do it like in general a way ?
like is there some function that does it ?
i hate to do search and replace
a function only works on what's here. The string has no \ anymore when interpreted
there is a way with raw string literals
!!> String.rawhello\world
@rlemon "hello\\world"
but that's more work than s/r
12:52
but otherwise, the other thing is using a filesystem with forward slashes
when adding the escape backslash
i'd expect my alert box to show one backslash
yet it is showing two
does windows allow for forward-slashes yet? I seem to remember it might
usually yes
(and it's not new)
guys i don't control the data, i just receive it
i have to work with the \
we get that. @towc is just lightly trolling
12:55
if you receive data with `\` in it, it will still be there
I'm guessing you're making a mock of that data and typing in the paths manually?
i read it from a csv
in that case, maybe create a key/value pair file for that data, and parse it with JS, this way your testing data is all in one place and is easier to manage (you won't have to re-escape the backslashes, for example)
@Joseph then it's probably already there
@Joseph That's because it's not showing the raw string, it's showing JSON
the backslash thing only happens if you declare a string with backslashes from within JS
how can I delete an instance of a class via its own method? delete this doesn't seem to work
12:58
@JacobSchneider you let the GC do that
just stop using it, don't hold a reference to it, and it will be picked up by the GC
Okay
Also, I get an Illegal Invocation error when running this:
this.callback = (function () {
    this.parent.unrender();
    this.parent.oncancel();
})
we'd need more code (think MCVE) to tell you what's buggy here
note that there's no need to wrap such a function declaration in parenthesis
@towc exactly , thanks :) . it was bc i was mocking it :)
iamverysmart
idk about that, but you sure are more experienced than i am in this subject
13:08
towc is very colourful too
either way i am grateful for his help
13:45
hi,
I have some angular questions to ask -- is it possible in this room? the Angular room is badly deserted.
hello?
Well, this is javascript chat
!dontask
!!dontask
in C#, Jul 3 at 19:41, by Kendall Frey
Don't ask if you're allowed to ask a question. Don't ask if anyone's available or knows how to use what you're using. Don't say you're going to post a question. Just ask your question.
okkay, ...
1 message moved to Trash can
!!tell PrabirChoudhury format
13:51
@PrabirChoudhury Format your code - hit Ctrl+K before sending and see the faq
okkay,

let's try
you're going to want to split the messages up
it won't work otherwise.
also, if you have a lot of code to share consider pasting it into a gist and just sharing that
much easier to read
no, not very much, manageable ....
some html and some TS
Nevermind I'm a moron
what I just saw was probably too much code to be read here comfortably.
13:54
ok let me split up with the explanations separately ..
thankyou
so this is my thing --
I have a select list which is being bound with data from db. the data format you can see above which is being returned by my web api. and subsequently I am binding it to my list.
Now
upon select change, I want to get the id(value) as well as the selected text.... my code isn't working... I am only getting the id but not the name/text ...
1 message moved to Trash can
@PrabirChoudhury Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq.
o okk, sorry,
my payment typescript --

export interface IPayment {
    Id: number;
    ptype_id: string;
    ptype_name: string;
}

export class Payment implements IPayment {
    Id: number;
    ptype_id: string;
    ptype_name: string;
}
this is how I bound my select list --

<select (change)="onSelectPayment($event)" style="height:42px">
            <option value="0">--- Select ---</option>
            <option *ngFor="let p of payments" [value]="p.id">
                {{p.ptype_name}}
            </option>
        </select>
and
on change code --

** declared at class level of TS file

public selectedPayment: Payment ;
public payments: Payment[];

**

onSelectPayment(pay_Id: any) {

        this.selectedP_id = pay_Id;
        for (var i = 0; i < this.payments.length; i++) {
            if (this.payments[i].Id == pay_Id) {
                this.selectedPayment = this.payments[i];
                this.selectedPName = this.selectedPayment.ptype_name;
            }
        }

    }
my data from web api is as


[
    {
        "id": 1,
        "ptype_id": "P01",
        "ptype_name": "By Cash"
    },
    {
        "id": 2,
        "ptype_id": "P02",
        "ptype_name": "By Card"
    },
    {
        "id": 3,
        "ptype_id": "P03",
        "ptype_name": "By IMPS [Paypal or Others]"
    },
    {
        "id": 4,
        "ptype_id": "P04",
        "ptype_name": "Western Union Money Transfer"
    }
]
so that's it mostly,
unable to get the selected name/text for current selection from the select list;
although I can get the value/id promptly as event.target.value
...
what to do,
can you tell me,

« first day (2862 days earlier)      last day (2311 days later) »