« first day (2178 days earlier)      last day (2769 days later) » 

12:02 AM
Grumble... i'm not drunk and you guys left me... ended up talking to some scottish guy about the wonders of buckfast...
 
@Wes Yes.
 
Wes
luckily i didn't delete what i was doing this afternoon :B finishing it...
 
12:18 AM
@bwoebi i had a day to get used to your accent. I thought you were funny :)
 
Wes
dang
@LeviMorrison pastebin.com/BR3RnMqN
basically you want to match:
<a href="#this_one">
<a href="#">this one (scroll to top)
<a href="">this is reload page so no
<a href="current_page_url#this_one">
<a href="another_page_url#not_this_one">
also event.target could be a child element, eg <a href="#foo">hey <b>if you click here</b></a> that's going to fail. so you want event.target.closest("a")
closest("a") is DOM LS, i think only firefox implements it right now
and to that code you need to add the one that blocks the automatic scroll on window.onload and replace it with your custom offset
 
12:34 AM
@Wes Eh... default # can just insta-scroll to the top.
I don't care to smooth scroll that one.
 
Wes
i didn't add it on purpose, i just excluded href="current_page_url_without_hash" which is supposed to refresh the page instead, as opposed to href="current_page_url_without_hash#" that scrolls to top
 
The only one that doesn't work is the current_page_url#hash but we generate our anchors and they don't usually do that; they just begin with # since there is no reason to write the full URL when you are just linking to a part on the page.
 
Wes
i'm fairly sure some mirrors had the full href printed in the attribute, or at least it was when i wrote that thing
 
I am fairly certain this isn't the case but... maybe I'll work on it anyway.
 
Wes
12:53 AM
it will solve it forever :P
also for the DOMContentLoaded handler, do like i did it on php.net, get the element, remove the id and let the page load. once it's loaded do scroll_to_id() but without doing history.pushState (which creates a new entry in the history and you don't want to do that)
then re-set the id to the element
i searched again, there is no way to prevent automatic scrolling
 
 
4 hours later…
4:57 AM
morning happy Sunday all
 
5:21 AM
!!dad
 
What do you call an Argentinian with a rubber toe? Roberto
 
 
1 hour later…
6:27 AM
Moin
 
7:27 AM
o/
 
Anonymous
@Leigh at bar if you're up
 
7:46 AM
@Leigh Bah, my accent annoys me :-P
 
I'm still fucked, - and I've got a talk in a few hours. I'm going back to bed BRB
PEEHAA THIS IS ALL YOUR FAULT
7
 
Hahahahahah.
 
@Sean You don't know if there's any food or anything do you?
 
8:23 AM
@Jimbo Just some small pastries
 
8:43 AM
@Jimbo don't be a pussy... I blame bob
 
@PeeHaa What about you blame yourself instead? ;>
 
waddup guys
 
@PeeHaa is not able to get in 10 minutes from bed to packing to conference…
 
Anonymous
@PeeHaa Hahahah
 
Is there any beer yet btw?
 
8:52 AM
@PeeHaa Not for you
 
@PeeHaa :P
 
Anonymous
@PeeHaa I think you cleared them
 
Nah that was just the tequila
In all seriousness though the bar is unmanned atm so no beer for now
 
Ugh no beer. No what?
 
If I'm getting a segfault I use strace to get a dump right? and not valgrind?
 
9:14 AM
There really is no beer :(
 
9:35 AM
morning
@DaveRandom @PeeHaa @JayIsTooCommon enjoy last day :)
 
Yeah thanks
 
Anonymous
@Traxstar cheers :3
 
@JayIsTooCommon already in drinking moode ?:D
 
Anonymous
Lol no, that's just @PeeHaa
 
@JayIsTooCommon haha okay ^^ whats on programm for today ?
 
Anonymous
9:50 AM
Already had two talks just one left which is @Jimbo's then hopefully saying hi to @JoeWatkins, then off home \o/
 
where is your home at :D
 
Anonymous
Devon :)
 
devon iowa ? : D
 
man those controller batteries drain out really fast :/
 
Anonymous
No, south west UK :)
 
9:56 AM
this is the last day of the conf, right?
 
yeah
 
 
1 hour later…
Wes
11:15 AM
\o
 
good mornings :D
 
is there a way to improve thjis
return $firstNumber+$n/2 <= $n-1 ? $firstNumber+$n/2 : $firstNumber+$n/2-$n;
 
Wes
use a var
 
11:30 AM
then i got 2 lines instead of one, right ?
 
@bwoebi we're going to do a group photo in the courtyard outside the bar after the final keynote if you're still around.
 
@Danack Sure I am :-)
 
Cool.
 
@Ocramius GeeH really likes you :-P
helpfulness 3/10 for you :-P @Ocramius
 
11:46 AM
there are quite a lot people who have died this way
it's what you get in society which insists that children's stories are real
 
Damn, I have to learn Laravel if I want to take that job 😭
 
Anonymous
12:27 PM
11 room 11 crew at #phpnwconf https://t.co/lHo7idzbLC
13
 
RT @MrDanack: 11 room 11 crew at #phpnwconf https://t.co/lHo7idzbLC
 
@Shafizadeh do they pay well?
I have had jobs where I had to use yii, codeigniter and kohana
I have also worked in multiple companies, that used their home-grown solutions - one of them was worse than any framework I have seen
@Shafizadeh my recommendation would be: work there for a year, learn whatever you can - when you can learn no more, find a better company
or you can work on improving the existing one (which might be a lot harder .. especially, since you do not have any job history to draw on)
 
12:43 PM
@tereško emm not bad. 5 dollars per hour
@tereško alright .. thx for the recommendation
 
hmm .. thats ~$800/mo
 
Yes almost, btw, dollar is more valuable than my country money-unit
I mean 800$ seems much more to me than you
 
@Shafizadeh it's more than your country's GDP per capita
you should be able to live quite comfortably
btw, how was the practical test?
 
Yes almost, however I dont have any house, and this job is in another city (not in my family's home). I mean I have to spend a big part of that money to rent a home
 
you probably meant "apartment"
 
12:54 PM
@tereško actually that was somewhat talking, the asked what is the concept of oop, also they wanted me to write a complex query (contains some joins, an order by which has a case when and group by, limit ... also finally they told me create a micro mvc
@tereško correct
 
and how did it go?
 
Wes
@JayIsTooCommon so much sexy in one photo
 
I explaind the concept of opp as well, also I've written a optimal query which returns expected output. But I wasn't perfect at micro mvc. There was some routing problem
 
there always are
did you mention SOLID principles?
 
I don't know what do you mean solid
 
12:59 PM
oh, so you havent discovered them yet
In computer programming, SOLID (single responsibility, open-closed, Liskov substitution, interface segregation and dependency inversion) is a mnemonic acronym introduced by Michael Feathers for the "first five principles" named by Robert C. Martin in the early 2000s that stands for five basic principles of object-oriented programming and design. The intention is that these principles, when applied together, will make it more likely that a programmer will create a system that is easy to maintain and extend over time. The principles of SOLID are guidelines that can be applied while working on software...
 
Well what is that 😊
@tereško thx
 
it's what you could call "intermediate level OOP thing"
 
😊
 
Anonymous
@Wes :P
 
Wes
@JayIsTooCommon guess who they are game: is Leigh between dave and bob?
on peehaa's left, is that you?
i recognize bob, dan, dave, joe, jimbo, sean, peehaa
 
1:12 PM
Who's the richard stallman?
 
a master hipster
well, not that interestingly actually
 
evenin
 
@Wes are you to scared to talk to each other ^^ ?
 
Wes
what does that mean? :B
 
to talk to other people ? :D
 
Wes
1:21 PM
lol, how so?
 
I recognize joe,PeeHaa,bob,thw,danack and Jimbo .
 
Wes
also who the hell are you? :D
 
Who is in extreme right?
 
Wes
maybe that's Leigh. i imagine Leigh having a beard
 
Somebody has put his smoke on bench :p
 
Anonymous
1:24 PM
@Wes nope, that's @ThW. @Leigh is above Jimbo and Joe. His left? Yeah. Excuse the face and hair, I promise I'm better looking in real life
 
Wes
you need to grow yourself a beard :D
and extreme right?
 
Anonymous
Yeah @bwoebi has inspired me to grow one
 
Wes
lol
 
and btw @Jimbo how is your talk?
 
1:38 PM
@Linus NOT ENOUGH AMPHP ;-D
 
0
Q: How to use controllers and actions(methods) in MVC(php)

beginnerIn MVC we use URLs like controller/action, I have a .htaccess file according to this Options +FollowSymLinks RewriteEngine on RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [NC,L] But i want to use a URL blogs/'blogname' , Where blogs is a ...

 
Is someone aware of a certain DBMS that would allow me to store big (1-10M) sets of IDs, and to be able to version those lists, so that I could retrieve easily a diff between two revisions?
 
can someone hep?
 
:p
 
@Linus Went awesome thank you :-)
 
Anonymous
1:42 PM
@Wes you planning on coming to any UK conferences?
 
Wes
are there others?
 
Anonymous
PHPSC, PHPSW, PHPScotland, PHPUK
 
Anonymous
Few more too
 
@JayIsTooCommon Great to meet you man, shame you couldn't have stayed longer :-)
 
Anonymous
@Jimbo you too dude, yeah bummer but always next time, thanks for ws intro :)
 
1:49 PM
can anyone hlp?
 
Wes
will there be videos of your talks online eventually?
 
Anonymous
Yeah they recorded all of them so I presume YT
 
Wes
nice
 
2:23 PM
!!dad
 
If prisoners could take their own mug shots, they'd be called cellfies
 
On the train folks, glad I was roped into coming (:
 
Anonymous
2:43 PM
@Sean nice meeting you \o/
 
@beginner you are doing it wrong - stop trying to do the routing in htaccess
 
@JayIsTooCommon No worries, I could use joind.in feedback, I got a 3 because of the lighting :-/
 
Why can't I put $_SERVER into constants ?
like const PAGE_URL = "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
 
@yessure use define()
 
Thanks
 
2:54 PM
@yessure btw, your classes should not contain any superglobals
 
@tereško I have defined it outside the class, does it change?
 
depends on what you mean by "outside"
 
Like this:
define('FOO', 'bar');
class Example { ... }
 
@Jimbo But admit, dark blue on black is never fine on projectors. Also font size sometimes being too small:-/
 
Wes
and constants themselves are also globals. chances are you want to use variables instead
 
3:01 PM
@yessure yes, that's bad: class should be defined in a separate and no other things should be defined there
 
Okay.
And for the superglobal $_POST? Is it good to use it in the constructor?
 
@yessure if your class needs access to superglobals, then they should be passed as a dependency
 
umm... why are singletons bad?
 
Wes
3:16 PM
because global @Archer and because using them implies no polymorphism and tight coupling
 
@Archer do you think global mutable variables are bad?
 
Anonymous
@Jimbo sorted :)
 
@tereško Thanks sir, now i will use php for routing, in index.php
 
Anyone knows how to call a variable from another query? Something like $_REQUEST['id']=$somevariable. or may I ask if it's possible?
 
@beginner ideally the routing wouldnt happen in the index file, but in a file that is include in the index file from outside of document_root
kinda like this:
<?php
require __DIR__ . '/../application/bootstrap.php';
the point of this to protect your source from accidents
if mod_php fails to load, it would cause your sourch code to be dumped in plain text to the browser
 
3:29 PM
@tereško Ok , I think now i get it, Thanks alot.
@tereško Iam just new to all this kind of stuff , and sometimes its just very confusing , but stackoverflow and masters like you helping me alot. thanks again sir
 
SLY
Want to fix php7 OCI8 extension SEGFAULT, anyone had such experience?
 
Btw people cc @Wes @JayIsTooCommon is kinda really hot for a 12 year old girl
8
 
Wes
lol
 
3:44 PM
It's true
 
Wes
3:57 PM
damn i choose the wrong pic, has no crown in that one :B
 
Anonymous
@PeeHaa aw, thanks man <3
 
Anonymous
@Wes hahahaha brilliant
 
4:26 PM
@Wes holy fuck. Best thing I've seen today
 
@Wes wow. that's awesome.
 
@Wes I thought this were real Dan...
 
Anonymous
@PeeHaa ahem
 
:P
 
4:41 PM
@JayIsTooCommon no, you weren't that a beautiful girl....
 
@bwoebi Yeah it's really hard to get that much info on slides... I liked the colour theme :-( but I reckon yeah I need to change it to light vs dark instead. Definitely looked worse on an ancient projector
Also great to meet you! :-)
@JayIsTooCommon Cheers for the feedback, much appreciated :-)
 
@Jimbo yep, and also it wasn't that dark in the room.
 
No it was too light because of the lighting I think
 
Well both
 
@NikiC thanks!
 
4:45 PM
posted on October 02, 2016

New Cyanide and Happiness Comic

 
@JayIsTooCommon besides @JayIsTooCommon's pretty face that is
Soooo what just happened is that my name got announced again
I'm pretty sure they just like it for some reason
 
:P
 
Omfg captain is a woman (m/f because code of conduct)
 
Anonymous
5:09 PM
@PeeHaa that's racist
 
@JayIsTooCommon s/racist/sexist
 
5:23 PM
@PeeHaa what's so omfg about that?
 
Why should I don't use the globals $_POST and $_GET in a class?
 
5:36 PM
Brb.... flight mode...
 
6:08 PM
@yessure because at some point you will want to test that class, without using a webserver
hell, not just test, but also use - like for command lines or executing from crontab
instead you pass the superglobals a dependencies in the class's constructor
that way your class become independent from the context in which it is being executed
 
6:31 PM
@JayIsTooCommon ikr
 
Wes
someone knows where i can find a imbecile-proof CSP guide?
should've asked in the js room probably
also evenings
 
o/
 
there are like 20 things that "CSP" can mean
 
\o
 
o/
 
6:34 PM
@Ekin o/
@tereško i would guess that browser security thing
 
that leaves about 5 options
 
Wes
anything i'm reading is a reference, not actually explanatory
 
o/
 
Wes
6:49 PM
\o
 
its there anyhow to trim of the last 3 new lines from string?
like its 5 but i wonna trim the last 3
rtrim rmvs all
 
Wes
is your keyboard broken?
 
7:11 PM
So back in saneland and it's actually raining like hell :(
 
Everyone make it home safe?
 
Check!
 
@ChrysUgwu preg_replace('~(\n\n\n$)~', ...)
Or if you know there's always X many newlines, substr()
 
@Leigh I'm at a bar right now. Does that count for home?
 
For you, yes :)
 
7:36 PM
@PeeHaa you.......... oh, well.
 
Btw @Wes why are you dicking around with csp?
 
Wes
just for learning
 
Anonymous
@Leigh aye, I ended up sat opposite a PHPSC organiser weirdly
 
Anonymous
@PeeHaa alcohol won't replace the gap I've left. Just miss me like a real man
 
leo
Hi, does anyone know about "GitLab" ?
 
7:51 PM
@JayIsTooCommon :P
 
leo
I guess.. no one :p
 
@leo "maybe"
 
leo
do u?
 
Anonymous
!!wotd
 
understory: the shrubs and plants growing beneath the main canopy of a forest.
 
7:53 PM
@leo just ask your question instead of polling people. If somebody is online and wants to help they will
 
leo
@PeeHaa, well.. how can i proceed further with the question, if no one here knows about GitLab.
thats why, i wanted to make sure first
 
Wes
8:09 PM
wtf is wrong with microsoft
they are being too nice, they made an open source ide for frontend development and it works even
 
Anonymous
@leo don't ask to ask, just ask
 
@Wes I should take up boar hunting....
2
 
Wes
ahaha nope better stick to programming :D
 
wb
 
8:26 PM
@Wes what's that?
 
Wes
Visual Studio Code
but is not related to classic VS at all, it's a lightweight editor like sublime
 
Yeah first thought was: bloated
 
@Danack :-P
 
Wes
no, it's notepad levels weight
 
I'm that tired …
 
Wes
8:30 PM
it also has a minimal interface
 
E_PHPNW
 
great to see you guys had some fun!
 
Wes
wb guys. what was Dan's talk about? other interesting talks? :P
 
@Wes Lemme have a looksy
 
@Wes docs.basereality.com/InterfaceSegregationPHPNW/#/59 is the summary - delete the number to get to the start.
2
also, brb - got to fix the typo...
 
Wes
8:39 PM
impatiently looking forward to watch the video
@PeeHaa lol, i just checked it even supports php
 
Yeah there are loads of plugins for it
 
whats 5MB in php?
 
Same as 5MB anywhere else?
 
@ChrysUgwu That's like asking what's 1kg on the moon — It's 1kg mass everywhere, but weight may differ depending on reference frame
 
like hw do i calculate it. (eg max_size => 10485760..)
like what number represents 5MB in php
 
8:54 PM
o/
Hmm an idea came up.. what if for certain rooms you need a 'card' to access it. I was thinking to 'your' ID-card for it and store data like access hours into it linked to your ID, now I have no idea if something like that already exists to read your 'card'.. like what hardware to use.. Just an idea that came up ..
@ChrysUgwu google.be/… ?
 
@Duikboot You are basically describing a punch clock
 
yes but with an ID card.. not with a 'card' created by a company.
 
@ChrysUgwu If you're talking about the ini file you can use 5M
 
@Duikboot Yeah because that's not totally scary
 
Anonymous
@Wes interface segregation and it was awesome, pretty sure it's one of/the highest rated talk on join. Nailed it :)
 
9:21 PM
@Wes He's advocating 1 line per file :)
 
Wes
:D
 
Well almost, lots of tiny things
 
Wes
he's right :P
> Everything is a trade-off
most important thing to know about programming. i wish my OCD could accept that
@Danack i've read somewhere that if a class has no state then it should just be just standalone functions docs.basereality.com/InterfaceSegregationPHPNW/#/51
stuff like controllers methods, services, etc, should be just functions
 
9:37 PM
@Wes sure.....but it's easier to store things like credentials in a class rather than pass them around everywhere.
Also - some people would say that:
interface FileDownloader {
    function __invoke($localFilename, $storageName);
}
if you rename the single method to just invoke, it is just a function.
Just a typed one.
 
Wes
indeed :P
 
@Danack Should be function __invoke(FileDownloadLocations $fileDownloadLocations); :P
 
@pmmaga ;-P There's only so much you can fit on slides...
But yeah....
 
:)
 
Home safe @PeeHaa?
 
9:43 PM
Yeah just got home
 
Sweet. Train was packed
 
Because of the match?
 
One of the main lines went down because a train hit a bunch of cows, so other trains are allowing those bookings
 
:|
 
#JustBritishThings
 
9:49 PM
train vs. cows 3D
 
Wes
would watch that
 
the train must at least come to live and cows need to turn out to be cyborg cows.
 
Wes
can't be worse than sharknado
 
oh hey, i was close to mention it and then spared it... ^ ^
 
Wes
:P
 
9:59 PM
anyone know what is the best solution to deal with Persistent login with safest option?
 
safest option is normally when https is required and it's not available over http
 
let say that we use https , what we should store on the cookie? do you think it is safe to store the hashed password using password_hash function?
`public function EncryptPassword($passwordstring) {
return password_hash(
base64_encode(
hash('sha256', $passwordstring, true)
), PASSWORD_DEFAULT
);
}`
 
@MohammedShannaq: Sounds you've got a lot of questions, perhaps a FAQ is helpful to you: owasp.org/index.php/OWASP_Application_Security_FAQ
@MohammedShannaq You don't encrypt passwords, so most likely your code example turns out to be a smell. Better educate a bit more first (you can safely delete the code for now and start over later).
 
10:55 PM
@Wes You'd like Go :)
@Danack didn't Joe have an RFC for that?
 
Wes
yes, it didn't pass
 
@MohammedShannaq All you need is: password_hash($password, PASSWORD_DEFAULT);
@Wes fools
 
@Leigh yes but that will force me to use 27 digit maximum password
 
@MohammedShannaq No, no it doesn't
 
I'm not sure how many of you play on codingame.com but doing these puzzles in Dart and then switching over to PHP makes me just feel so bad.
 
10:59 PM
You might be thinking of 72, because bcrypt, but nothing to do with 27, or digits
 
It's significantly more verbose in PHP :(
 
Dart will never be any more of a thing than it is now, I feel sorry for the people who wasted effort on dartium
 
yes I meant 72
 
Wes
@Leigh i don't know if i would have liked it wiki.php.net/rfc/functional-interfaces
 
so i use base64_encode to not forcing the use of 72 password
 
11:01 PM
@Leigh I really like it as a language. They've embraced compile-to-js for the browser but there is a fully supported Dart VM you can run for stand-alone apps like servers.
It's a nice mix of dynamic and static features and is high-performance.
 
@MohammedShannaq if you're bypassing the 72 char limit, the only thing there you DON'T need is the base64_encode. You only need hash and password_hash
 
and for the Persistent login i will create a database tanle contains the token and the username
@Leigh so you think it must be like this
`password_hash(
hash('sha256', $passwordstring, true)
, PASSWORD_DEFAUL`
 
oh of course, you have "true" as the last param of hash, so yes, you need encode to prevent null chars
or, drop the true
 
aha
@Leigh the problem now is how to deal with the Persistent login , i know its a token saved on cookie and the token also saved on the database table.
but I'm trying to make it possible safe to be stolen
 
Use https, use secure http-only cookies, encode outputs
 
11:06 PM
thats was the best option
only ssl for cookies
`CREATE TABLE `plogin` (
`plogin_id` int(11) NOT NULL COMMENT 'auto id',
`plogin_userid` bigint(20) NOT NULL COMMENT 'user id from users table',
`plogin_token` varchar(64) NOT NULL COMMENT 'token 64bit'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Persistent Login table';`
@Leigh do u think i must link it with specific IP or this will disadvantage from the Persistent login system while users IP can change anytime
I think also I must use expire time on the database table to expire any token that not used for a long time
 
session hijacking isn't something you should protect against with application level complexity. There are tools available to do all of the work for you (the things I mentioned above). The remaining attack vectors are things you cannot protect against
 
Yes I know , but im just thinking :)
 
Well, ask yourself, "Do I need to invent a new session mechanism, or is the standard one good enough?"
usually, the standard one is good enough
 
if you see that sometimes when you login to fb from another far geolocation they harden the login page with more check points
 
sure, or google, or steam, they detect logins from new geographic locations and challenge you
 
11:11 PM
really I think the Persistent must be disabled at the backend and enabled in the frontend, do you agree with me?
When I use the IP2country database I can know if the logged in user changed his country so I can make a check point or ask him to login again
 
I think it's OK to ask them to log in again if you detect a geographic change
 
also , for some actions I will ask him to relogin if he is logged in from Persistent , for eample if he try to change his password and he is logged in from Persistent login i will ask him to relogin
so I must have a function that check if the current user logged in using Persistent login
 
sure, that's a behaviour used by a lot of other people too
it's familiar, and sensible
 
`public function isFromPersistentLogin() {

return false;
}`
 
11:26 PM
internet makes me sad
2
 
@tereško why
 
running meteor makes my laptop sad
 
@Ekin I never use it , I still using netbeans
and I still have problems while writing non english letters , and I'm thinking to shift to visual stodio
or return back to Zend studio
 
11:47 PM
@MohammedShannaq I meant meteor.com, not an ide. but I switch between atom and phpstorm in general.
 

« first day (2178 days earlier)      last day (2769 days later) »