« first day (2971 days earlier)      last day (2202 days later) » 
00:00 - 17:0017:00 - 00:00

00:58
For some reason I thought you could pass a string to a foreach argument and it would parse it as an array of letters
01:12
@hakre I did not know that. I'm pretty new to containers. That's a hell of a vulnerability point.
hi
I gots a question. Can anyone give me some pointers on a way that with nginx I can do the following:
have site.com. Have two folders in var/www/html lets say realsite and fakesite. Depending on a cookie I want to serve from the realsite folder. If cookie is missing... fakesite
the domain and urls must be identical
no subdomain or directory
but I cant find any examples or documentation on it related to what im trying to do
@pmmaga Doesnt this get unwieldy? I understand why you would do it, and I never really thought of that situation...
there is very little documentation whatsoever for that plugin
can anyone help me?
so to be clear site.com/pages/fuckyou.php could be from the fake folder or the real folder depending on a cookie. url is the same
This is sounding malicious @FrostyFire.
@Allenph its not. Im not a new user look at my history
01:21
I just did.
I can give details
but would rather not because this is for a client
Sounds like you want the equivalent of A B testing or are trying to A B test.
its not malicious though
@Allenph not really, we typically don't update the dependencies without a reason to do so, so it doesn't become a burden
01:22
not example @Allenph I did look into that. Not what I need. A reverse proxy in front of nginx would work. But I was hoping to acomplish this with nginx only
@pmmaga You dont worry about security updates etc?
the two folders are not clones
but they do have some files that are the same
same url etc
@Allenph I do, and that's one of the valid reason to update a dependency :)
It wouldnt be A B testing of they were clones now would it @FrostyFire?
On the first page of that result set I found someone doing exactly what you're asking for.
what did you google?
ohhh missed ur link sorry lemme look
01:23
Click my link.
the freecodecamp link?
result*
@pmmaga Hmmm. Just seems like a lot of work.
@FrostyFire I dont know...why dont you check?
what with the assholery
im not asking you to do my work, Im just a bit lost on how to get information
you could have just said hey if you google this you will prolly get useful info
Also @pmmaga that seems like a very good idea. I should start thinking about that.
@FrostyFire Here. Let me get you a direct link.
this is actually perfect! I was pointed to and b testing before but how I googled just resulted in getting very unrelated type tests. Led me to believe it was unrelated
but I see this actually would be perfect I think
http {
    # ...
    # application version 1a
    upstream version_a {
        server server 127.0.0.1:7770; ## Can be an external ip too
    }
    # application version 1b
    upstream version_b {
        server server 127.0.0.1:7777; ## Can be an external ip too
    }
    split_clients "app${remote_addr}${http_user_agent}${date_gmt}"   $appversion {
        80%     version_1a;
        *       version_1b;
    }
server {
        # ...
        listen 80;
        location / {
            proxy_set_header Host $host;
the only issue is....
its splitting. I need it to be based on a cookie
nvm scrolled down and they do just that
@Allenph Thanks, you have helped me. Just wish you were not an asshole about it. I used to be very active in chat a couple years ago. Huge difference between someone out of their depth and a code vampire. One can be a teaching one moment, the other is fair game for assholery.
01:29
Yep. Was about to link that one.
@FrostyFire I'm not very good at telling the difference. Initially the way the question was asked made me suspicious. Just knowing the right thing to Google seemed key her, so that's what I posted. Sorry
Its all good. Curious...why did you think this was malicious? LIke in what way were you thinking it could be used maliciously?
@Allenph Either way it's 2 separate things, you can still commit vendor even if you composer update every day
since it would be serving my own content im not sure what good it would be. If one was going to serve malicious content they don't need to use two folders same url
@Allenph
i'm legitimately curious from a cybersecurity standpoint, not arguing.
@FrostyFire I dont know. I'm sure people could think of something to do.
Rob
Rob
Probably your choice of page name. Also... silently swapping out content of a site seems a bit strange.
01:35
I mean you could definitely obfuscate whether you were really malicious or not.
@Allenph ohhh like serve people with a cookie malicious content and then when it gets reported serve a clean site to the people checking....if you could find some reliable way to detect the difference?
Rob
Rob
Or if you're really being malicious, breaching a server and only sending a small percentage of them to your hijacked site would make things a bit more difficult to detect.
Yeah. Something like that.
Yeah. Exactly what @Rob said.
@Rob true. Or you could make it based on referer. The admin is likely to visit his site directly
his visitors not so much
damn, I see now why this seemed so sketchy lol
And yeah. Page name and not saying "I'm doing A B testing" made me immediately assume it was something like that.
01:38
@Allenph yeah. Like I said I had completely dismissed A B testing because when someone mentioned it to me and gave me a link it was using php
and I clearly told them I cant be using php for this so I dismissed it as someone who lacks attention to detail. whooooooops that was me this time I guess haha
but this did make me think, that would be super sneaky if a site was breached and they wanted to be undetected. Asside from you know... the nginx conf file being completely changed but depending on the server setup an admin might not even have access to that.
 
2 hours later…
03:37
Note to Quora: hashing != encryption
 
2 hours later…
05:39
I thought if I could complete the advent calendar within the first hour I might end up somewhere on the leaderboard... but I'm #500 :O
I had no idea so many people participated
06:27
DateTime::diff Wrong result if subsecond difference – #77235
Many reflection functions are undocumented – #77236
 
1 hour later…
07:47
posted on December 04, 2018

08:00
brusquerie abruptness and bluntness in manner; brusqueness.
08:47
DateTime diff wrong when using milliseconds – #77237
09:20
morns
Wes
Wes
09:36
\o
10:30
- from Barcelona
Wes
Wes
10:50
microsoft is making a webkit/blink based browser.... read css-tricks.com/the-ecological-impact-of-browser-diversity also applies to any industry
the importance of competition in doing anything, not just browsers
Back on my ADHD medication \o/
11:10
yeah, got my oolong tea too
:P
Wes
Wes
11:28
nerd
isn't oolong usually what she said? I mean, IDK you, but…
Wes
Wes
i have seen that before
is it communist propaganda?
no.
11:44
"communist pig"… more on the contrary I guess
Wes
Wes
right
@Gordon capitalist pig?
Is there any difference between running an infinite loop using "while(true)" or goto?
@Wes That's Oolong from Dragon Ball.
@LeviMorrison Yes, to remove stuff from memory in long-running processes
Wes
Wes
:B ik
@Jimbo wrap into functions instead
11:55
@Wes Okay, I will change my paradigm
Wes
Wes
:B did i sound too aggressive?
you must use unset only if you are avoiding functions, like for speed
anyway no, i don't.. not in serious code @LeviMorrison
except for unsetting values from array-maps
@Wes I was about to say the same thing
Wes
Wes
yeah you can't avoid that
yo @StatikStasis
Wes
Wes
12:19
i sudden realized that the reason i do anything is the humiliation i'd get if i didn't do it
that must be the reason i suck at doing open source work
my public humiliation is not on the table
so i decided i am going to announce everyone what i am going to do
and get everybody hyped about it
does that sound like a reasonable plan to you? :B
sure
@Wes problem with that is some people get the psychological high from telling people what they're doing, and then don't follow through with it because they already got the high
rather than if they didn't tell anyone, finished the project, got the psychological high, then told people
@Tiffany that sounds like me :P
12:27
@MadaraUchiha wtf?
Developers! Developers! Developers! Developers!
DEVELOPERS DEVELOPERS DEVELOPERS DEVELOPERS
if that doesn't give semantic satiation, I don't know what will
@Tiffany Why'd I watch the whole damn thing again?
@MadaraUchiha it's catchy?
@MadaraUchiha more like "dev.. develo.. de.. devel..develop.. de.. developers"
12:32
@mega6382 Don't click so fast.
Wes
Wes
ah the dusk of the internet. badgers and cat videos
the days before youtube...
animations on newgrounds
back when Flash had a market share
12:48
guys is "$90k - 120k" a monthly salary or yearly?
2
@Shafizadeh usually yearly
yearly
ah ok thx
well .. for a developer
and in USA the salaries are advertised "before tax"
how much will be reduced after the tax is calculated ?
Wes
Wes
12:52
50%
wait what? 50% is the tax?? why really?
@Shafizadeh it depends on state and city and all that
@Shafizadeh If you find a place where that's a monthly salary, do give me a call :D
:D ...
Wes
Wes
12:56
a elite developer at google microsoft or similar companies might earn that :D
@Wes doubt it
Even they at best would get $50k-$60k a month
But a lawyer or an investment banker might earn that and even then some
Wes
Wes
a lawyer? one in a million you mean :B
@Wes I mean the partners at big firms
@Shafizadeh tax where I live is like... 20% ish
@Tiffany here is 5% (and free for poor guys)
13:04
@Shafizadeh Well its everywhere like that if your income is under a certain amount you don't have to pay any taxes
it's probably closer to 10%-15%, now that I calculate it
ah I see
@mega6382 I want to say that isn't true, but I don't have a way of verifying it. IIRC, my mom still paid taxes even though she was on disability and social security
she probably didn't have to pay as much, though
Wes
Wes
depends on what you include in taxes :B
@Tiffany Well it depends on the income brackets I believe, so the lowest income bracket(sometimes few of the lowest) usually doesn't pay any taxes(or at least federal) , I am not sure how it is in US though
Wes
Wes
13:08
for me it's more like 50% or nearly
@Wes you have cheaper health care though :(
Wes
Wes
includes any public service, retirement fund
lol...retirement fund... ours is a joke
Wes
Wes
:B
ours is a joke too, actually
in the state of Illinois, college/university employees pay into a separate system than our social security... but the state keeps fucking with it
13:12
@Tiffany apparently even the lowest tax bracket has to pay taxes in USA en.wikipedia.org/wiki/…
13:42
final solution?
13:55
Guys, this ip (216.244.66.237) has sent (and is sending) continuously request to our website. It seems like a bot, since his requests are too much and will not be tracked in the google-analytics.
Any idea how can I earn more info form that ip?
could be a search engine spider, but you'd have to decide if it's worth letting the spider crawl your site or not
oh .. is that a specific guy? I'm trying to understand is it our rival or a usual crawler?
did you click the link I sent?
@Shafizadeh most of the time, I just google IP addresses. I've found some sites that let me look up IPs to see where they're coming from, abuseipdb is one, mxtoolbox is another... there are others I use, but can't remember off the top of my head and most of them I've found just by googling the IP
14:01
ah I see ... thx
if I'm really curious, and a domain has annoyed or pissed me off, I scan it through pentest-tools.com/home
oh .. I will try it
Wes
Wes
14:13
@Wes for example, i am planning to publish an article today. if i don't, please insult me
!!reminder help
Have a look at the time again, yo!
blargh
!!git
@Wes is your time UTC+2?
Wes
Wes
14:21
yes
no, utc+1
!!reminder @Wes publish an article today at 22:00+1:00
Reminder 44745946 is set.
Wes
Wes
i am almost certainly be sleeping by that time :B
woke up at 4 am because i went running :B
oh
I was going to set it for 8:00, but I figured you'd be up later, lol
!!reminder unset 44745946
14:26
Reminder 44745946 was unset.
!!reminder @Wes publish an article today at 19:00+1:00
Reminder 44745992 is set.
now you can't get out of it
Wes
Wes
i think i needed more a reminder every 30 minutes... "don't procrastinate"
do you have a digital calendar that you follow regularly?
like google calendar or something
Wes
Wes
14:29
i wasn't serious :B but as i said, i don't care what google calendar thinks of me
i require actual fear of public humiliation
:B
I can try, but I can't promise anything
ugh, am I retarded or what? (don't answer that, it's just retorical)
3
can anyone explain to me why the day is being increased?
Wes
Wes
@Naruto nice warning :B
@Naruto you need to be more clear on exactly what you don't understand
@Wes if I didn't then probably alot of yes answers would ensue
I need every saturday between 2 datetimes, but when I add the saturday to the array, it will keep changing untill the last value of the loop
14:46
need help wrapping my brain around some logic: I need to parse a log file, I want to read out domains from the log file, but I only want to list the domain once. If the domain has already been listed, I want it to skip over it. I can probably do this with some kind of conditional? maybe a flag?
nvm, I found out what was wrong
it's like doing SELECT DISTINCT, but I'm not querying a database
fyi, you need to clone or create a new datetime object, else you just put a pointer into the array and that's why it keeps changing
I guess throw them into an array and do array_unique?
or they're already in an array
I have WAMP on my computer for these puzzles, and for some reason PHP is not working as it should
14:54
@Alesana I was using 3v4l
Wes
Wes
snow is gone, but can use skis on asphalt also, right??????????????
@Wes ofc you can, if people can use the sticks to walk around, you can sure as hell ski over asphalt ^^
Wes
Wes
:B
be warned that your skis may disappear partway
because they'll be ground into nothingness
@Tiffany At that salary they were talking about it's about 50%.
After State and Federal I'm at about 45%.
15:10
I only calculated federal
I don't pay enough for state tax and it's going to bite me in the ass in a couple months. I need to get it fixed
do you guys want to help beta-test my new PHP REPL ?
10
@Sjon yes
awesome - I've deployed the latest stable but can add more if people like it. Also interested in possible browser issues
^ mobile is a known challenge but should work too
@Sjon are you looking for bug reports mainly?
I was really confused, things like in_array() weren't working with big arrays, and some other random things. I was so confused when I couldn't usort an array, so I eventually used something like 3v4l with the same code and realized that it was my PHP
Really weird
15:14
@Tiffany yeah, but feature reqs are welcome. If you want to tell me its slow that's also fine :P
@Alesana that calls for a bug-report
wonder if it's an INI setting that's not set correctly
I'm not sure, I tried multiple versions
It worked with smaller arrays
@Sjon hmm.. can't use quotes on EN INTL w/ dead keys keyboard layout. very specific to me I guess, but worth mentioning :P
hey @Sjon I was wondering
20 hours ago, by mega6382
3v4l should have a way of adding composer based dependencies and pecl based dependencies, i think
@pmmaga I'll add it to the list, thanks for testing. I'll dive into the terminal library
15:18
@Sjon Wait do you mean a PHP bug report or 3v4l bug report?
@Alesana I meant a PHP bug-report, if you're PHP is acting weird :)
@Sjon Ah okay yeah, we're on the same page then haha
@mega6382 yeah - I agree but it's hard to prevent abuse. I can't stop someone from depending on a 1G library. Also, I currently have no network. But it's on my radar. Maybe I'll add it as a paid feature
I don't know if people will pay for it - but adding it for free will mean frequent issues due to abuse. I've learned the hard way ;)
Well its definitely something to consider
@Sjon this should be pinned /cc @Gordon
yeah, that's what I was thinking
15:23
@mega6382 what exactly should be pinned?
12 mins ago, by Sjon
do you guys want to help beta-test my new PHP REPL ?
done
cheers
testing...
@pmmaga does the quote appear after a space? Sounds like windows wanting to create special chars
15:26
@Sjon do you log what people type in the shell? I'm trying to find potential attack vectors, but I'm pretty amateur at it
@Sjon nope, that would be the normal behavior (ie. what happens in the normal 3v4l editor). not on windows at the moment
@Sjon Cntrl+y doesn't seem to paste
Cntrl+W is reserved for closing the tab in Windows
@Tiffany No I don't log anything :) If you find an exploit I'd be very impressed
@Sjon I think that when user adds an incomplete statement(like multi line) it should change from "PHP >" to ">>"
I was trying stuff like __DIR__, readdir(), etc, tried using mail, didn't think it would work but I was curious.
I tried clearing the screen using Ctrl-L, it didn't clear after the first press but did after the second, however, it left some stuff behind...
15:29
@Sjon: Once the memory is consumed, it's over: php > $func = function() use (&$func) {$func();}; $func();
@hakre ouch
not even var_dump($GLOBALS); any longer.
@hakre that matches normal php -a behaviour. It seems php is unable to free itself. Press ctr+d to start a new process
@Alesana right - readline has it's own buffer. So it works if you cut something and then paste it. But I agree that isn't very useful
Ah, I see
15:35
What lies at the bottom of the ocean and twitches? A nervous wreck
I read somewhere it would be on ARM systems only.. not sure
15:58
Hi guys. I'm trying to assert that an exception is thrown... Here's what the code looks like
try {
    // This method throws ValidationErrorException
    $validation = $handler->validate($something);
} catch (ValidationErrorException $e) {
    // Do something
}
and I'm trying to test it with this:
$this->expectExceptionObject(ValidationErrorException::class);
But it says ValidationErrorException is never thrown
I'm testing the try catch block, not the validate method
Must I test the exception is thrown in validate class only, or can I do it in the try catch?
I mean, the trown is being transversed anyway, so it should work testing the try catch
for some reason, even when it throws, it says "Failed asserting that exception of type "CFPP\Exceptions\ValidationErrorException" is thrown."
when is 7.3 planned for?
@LucasBustamante the method for that is expectException(): phpunit.readthedocs.io/en/7.4/…
how do I override the login method used by laravel's (5.7) email verification ? because it doesnt save my api_token in database.
by not using laravel
once user is verified it is directly logging in to home page
@tereško
even though it seems it's very strict, so I'm going with expectExceptionCode
@Tiffany and er... what... was he looking at?
by using what :-p
@FlorianMargaine thursday
16:12
@pmmaga thanks
@LucasBustamante also, a minor point: in php Exception and Error are different superclasses. Naming it ValidationErrorException seems quite wrong ... and then there is the whole "pointless suffixes" problem too
@pmmaga heh, tagged 4 mins ago
@FlorianMargaine haha, exactly, was about to share that: github.com/php/php-src/tree/php-7.3.0 :)
@tereško do you know that ?
16:14
couldn't find related to it
@LucasBustamante are you testing just the validate() method OR the entire try-catch block?
the entire try catch, one exception at a time
@LucasBustamante then this won't work, because the exception is being swollowed in the catch-block
yeah, that's what I was afraid
if you want to test, what exceptions get thrown, you need to test the handler itself in isolation
16:17
this is the code under test: pastebin.com/TJdyDyRM
I'm still getting the hang of OOP
crucify me, gently
Wes
Wes
TIL youtube.com/watch?v=lnAC-Y9p_sY amazing video and channel (cc @tereško)
what could I do to improve it?
@mega6382 apart from it's not Friday, that is obviously a Friday link.
I am not sure where to begin
the "package"/"payload" relation seems to be borked
16:22
@Danack you wish
also, you seem to have "factory methods" all over the place
a package is the final cubic result of a product dimensions and quantities
each shipping method has it's own rules of calculating that cubage, so I have to create that per shipping method basis
@LucasBustamante basically, you need to pick up this book: amazon.com/Clean-Code-Handbook-Software-Craftsmanship/dp/…
@Alesana are you planning on uploading your solutions to github?
what I see is in that code is strictly procedural mindset, that you are trying to get wrapped in object-like syntax
(that book is available on torrents, FYI .. and, no, there is no audiobooke version)
16:27
@LucasBustamante for any non-trivial code, you should write it independently of wordpress and then bind it into a wordpress plugin, separate to the logic of the code.
And any code relating to shipping will need to be full covered by tests.....writing some tests for that code will show up where it's not easy to use.
@mega6382 Yup
I made a repo I just haven't uploaded them yet
Yeah, I want to become a better developer, have a better understanding of OOP, I don't like building messy stuff
coming from the WordPress world, it has been some challenging times, but rewarding
I'm gonna read the Clean Code book you suggested @tereško
@LucasBustamante I'm so sorry to hear about that, I hope you're doing better now
It's not always easy to recover from that
Any other good books for improving OOP mentality?
@LucasBustamante the topic you've chosen to learn from is quite difficult....it might be better doing your learning against an easier topic, so that you can get the patterns you need first, separate to tackling a difficult problem. However if you do want to keep to shipping, I'd suggest reading amazon.co.uk/dp/0321125215/ref=asc_df_032112521557279432?
16:32
@LucasBustamante well .. amazon.com/Patterns-Enterprise-Application-Architecture-Martin/…, but that one is more of "intermediate level"
@LucasBustamante I don't know of any - but I'd recommend using github.com/rdlowrey/auryn to make it easy to tie stuff together. Without that, I've found doing stuff 'correctly' in OOP is annoyingly difficult, and that library makes stuff a lots easier to code.
@LucasBustamante amazon.co.uk/Timeless-Software-Development-Jerry-Fitzpatrick/dp/…? is a good modern clean code book.
thanks for the suggestions guys, all of them seems to be great books
@Wes John Rabe - The good guy Nazi(WTF, right)
16:34
@Danack I got your email with a couple tips. I think they're great, I didn't realize the fonts I was using were PC specific. Thanks for all the help, you have no idea how much this helps! (Well, maybe you do, but either way it helps a lot)
@Alesana np.
@Danack never seen IoC in WP, actually I have very little experience with IoC's, just used the one from Laravel, but never created one before
Hence:
> for any non-trivial code, you should write it independently of wordpress
@Danack wouldn't it be more work?
when I have to merge that into WordPress
WP is terrible, but it's not so terrible, it has evolved in the last years (just like what people say about PHP itself)
the REST API, for instance
> but it's not so terrible
16:38
yeah, actually... I will not try to defend it hehe
It's theoretically a tiny bit more work, but it means you can write clean code, that is covered by tests, and then only at the end do the messy crap that is needed to add it to a page.
posted on December 04, 2018 by CommitStrip

There's a Codeception module for WordPress
it's testable
example of good code in wp: github.com/lucatume/idlikethis
I mean, I'm not defending it, just saying it's possible
the problem in my opinion is the general mentality of the WP community, which is procedural
@FélixGagnon-Grenier he was playing a game, not sure what, I'll have to ask.
but the same has happened with PHP itself
now PHP is emerging from that stereotype
I believe the same can happen with WP, if enough people start writing good code in it
16:42
@LucasBustamante those are not unit tests. For the type of code you're writing, you really want unit tests.
someone want to add a dadjoke to @Jeeves: "I love the smell of my F5 key, it's so refreshing."
Feb 12 '16 at 15:36, by Danack
.....I told this joke when giving my talk.......There's tourist driving around rural Ireland countryside, and he's lost.
Feb 12 '16 at 15:37, by Danack
He sees a farmer standing at the side of the road, so he stops and asks the farmer "Excuse me, can you tell me how to get to Dublin".
Feb 12 '16 at 15:37, by Danack
And the farmer replies "Ah, to get there, you certainly don't want to start from here."
Rsrs, touchè.
rsrs = small laugh in brazil
well, thanks again @tereško and @Danack for the book recomendations, I'm gonna write it down and take the challenge of reading them eventually.
It's a long way to Dublin, better start walking. See ya
@samayo it might tak a lot of time to get used to it + the tech is still very new (there ain't so many good games to play on it)
@LucasBustamante Pragmatic Programmer is another good one
Wes
Wes
16:57
@NikiC around?
@Sjon It actually works on Windows (the same layout) :P
00:00 - 17:0017:00 - 00:00

« first day (2971 days earlier)      last day (2202 days later) »