« first day (1203 days earlier)      last day (4040 days later) » 

00:22
I find you putting my question on hols is anexaptible.. — Lev 1 min ago
He's trying to annex his question from the rest of the site! :O
00:49
Seems legit-ish.
 
4 hours later…
05:01
Is there any reason why mods can't have two types of close votes: binding and non-binding?
 
2 hours later…
06:52
Handy: /** @noinspection PhpUnusedParameterInspection */
07:33
	$null = null;
	if ( !$revision = get_post( $post, OBJECT, $filter ) )
		return $revision;
	if ( 'revision' !== $revision->post_type )
		return $null;
I have no idea why a variable for null is needed here.
 
1 hour later…
09:13
@toscho what's wrong with my code style!? :)
@Rarst excessive line lengths and misplaced braces :P
line lengths I admit, but usually because I am trying to follow "don't create variables to be only used once". braces? they are set to WP coding style?
Why does @discourse need 1 GB of RAM? https://meta.discourse.org/t/why-does-discourse-need-1-gb-of-ram/12301?u=codinghorror
09:37
would need to dismantle half the core and write essay with headings to get 8 upvotes here nowadays :)
4
@Rarst don't create one-time variables has something to do with line length?
$string_used_once = 'don\'t create one-time variables has something to do with line length?';
$foo  = "don't create one-time variables ";
$foo .= "has something to do with line length?";
?
Why can't you split strings?
Or just use Enter? Won't harm anyone :)
it's about using something (not necessarily string) inline vs assigning to variable to be used inline
And what's the problem with hitting the ENTER-key in the middle and breaking it into two lines?
09:51
it might not be string
it might be function call. are you breaking lines in the middle of function name?
I'm pretty sure that my function/method calls close to never exceed line length of 100 by their name.
I know how to make lines shorter, I just don't bother with making them as short as possible, that's toscho realm
not only his. lots of people think like that. especially those who often browse source code on GitHub, etc.
they don't, but line can get long if there are several things in it, as opposed to creating multiple "once" variables
it's line length/count tradeoff
I guess we'd need a real world example to really discuss this.
09:54
ask toscho, he has issue with my coding style
me too :)
it's not about liking, it's about readability. some people enjoy "clever" code, but its readability on average suffers
beginner coder would waste time on "wtf this means", not "wow, I appreciate that this line is very short"
One thing that you could consider: One argument/check per line for arguments in functions or for if statements. example.
what?
I don't really care about "this is very short". only if I have to scroll horizontally. And if I can easily check which arguments are set - which is easier if I know that there's one per line.
$parent_id = array_pop( wp_filter_object_list( $items, array( 'title' => $args->submenu ), 'and', 'ID' ) );
vs.
$parent_id = array_pop( wp_filter_object_list(
    $items,
    array( 'title' => $args->submenu ),
    'and',
    'ID'
) );
09:59
I do it for long crap, that line fits under 120. as above - screw it, forget I asked.
Poking you always works out that good :)
you attack me in the mornings when I am vulnerable
Seems like proper line length limit for WP.SE is ~90 chars
@Rarst not attacking you. you got that in the wrong throat.
or in other words: sorry if it can be taken that way. wasn't meant as an attack :)
everything is forgiven. no, I need my tea, then everything is forgiven.
10:18
@Wyck Are you sure that merging this plugin "framework" into WPGear was a good idea? Just looked at the source.
 
2 hours later…
12:11
get_all_user_settings(): Conglomeration of $_COOKIE and DB values... what a mess. And still the most "user settings" are saved as user meta values.
12:25
No composer.json and the bit on custom post types doesn't sit well
what with the whole array property on main class
dunno. it's just a fake namespace and seems more of a wrapper for some random args.
12:49
Not fully tested, but here it is: Plugin that temporarily disables the User specific Meta Box order on Admin UI > Post/Post-New screens.
aaaand it doesn't work.
aaaand it works. perfect! :)
13:16
From codex To schedule an hourly event in a plugin, call wp_schedule_event on activation (otherwise you will end up with a lot of scheduled events!)
if ( ! wp_next_scheduled( 'prefix_hourly_event' ) ) {
	wp_schedule_event( time(), 'hourly', 'prefix_hourly_event');
}
if I use this code. Do I still get lots of scheduled events? Shouldn't I get only one as I am scheduling it when not available?
13:40
@kaiser I didn't look at the code, is it shit or something?
@Wyck pretty much. and from a 3-minute code review, it's quite pointless as well.
@kaiser ya I just read the readme and I don't see the point of it
I don't really curate usefulness, it's not horrible per se, just fairly pointless
@Wyck you'll see even less point when you look at the custom post type class or the admin page things.
It's really just a wrapper above the API that doesn't add any value. I couldn't find the point where argument injection was made easier, safer or better in any other way. Maybe even worse: Arguments seem rare and pretty random.
It's like having an extra wrapper on a candy bar
Ill remove it later, I think maybe curation is a good idea
If I understand what you're trying to say: "It's like having an extra wrapper on a candy bar" > "It's for suckers".
@Wyck curation would be superb
13:48
14:08
One time i put an entire Reece's peanut butter cup in my mouth, immediately after having removed the wrapper. There was an extra wrapper still on it.
14:21
we are up to 65 questions/day... yay for new mods
14:46
@Rarst i think part of reason we have less opportunities to earn rep here is a good moderation team. there is a lot less duplicate answering than at SO, for example, and a lot more pointing to existing resources. SO is like answering how to hide something with jQuery x infinity
SO been rep farm for a long time :) most of other stacks are more normal about it
15:02
Wow. This is some adult content, but seriously freaking awesome: Biting Elbows - 'Bad Motherfucker' Official Music Video - YouTube
@TomJNowell gcloud.civilservice.gov.uk so that is real lol
wow the writing...
15:46
Stumbling upon that from time to time, but never found a really got answer (or forgot it) or resource: What's _the_ way to retrieve an admin URL for a default/built in admin screen? - for e.g.: post type = foo, ID = 1234, action = edit, etc.
Asking as I'd ask a question if nothing pops up.
get_current_screen ?
@kaiser get_edit_post_link()?
there are specific ones like edit_post_link(), for arbitrary admin_url() and add_query_arg() as needed
@Wyck nope, not really. that's only pointers and would only work for "parent file". And it doesn't really help when you aren't on a specific page.
@toscho Yeah. But others? Like post-new.php?post_type=foo?
@Rarst everything is arbitrary in admin, right? :P
most of it :)
15:51
The admin menu and URLs suck that hard ...
16:11
oh, people are screaming at new mods already :) that was fast...
@kaiser the admin menu is one of those dank closets no one wants to touch
@Wyck I tried to replace it with a real WP Nav Menu once. Gave up after an hour I think. Still I believe that it would work. Was supposed to become part of WP Strip Naked plugin.
there a trac about it but it's tightly coupled to non menu functionality, so it aint go anywhere anytime soon
Hm? Hope you don't mean the one by Mike.
16:23
do you think you could live on a 256GB hard drive?
it's a long one
for development
@kaiser you commented on it 3 years ago hehe
@GhostToast me, no way, unless you using cloud for all assets or something
only really considering the first 3 options there
ha ya thats why I upgraded my pc
16:25
and how they impact price
so, anyone has wordcamping plans for may?
i want portability options, and have really come to enjoy working on a mac
i have to install virtual machines to test F8y3(ing IE and old OS's, they take up a shitton of space
Just fixed one of my old SO answers with a rewrite example for a web server which isn’t available since 2010. Beat that!
17:14

PHP Web Developer

MorningStar Media Group

We are looking for a PHP Web Developer to join our team at MorningStar. This individual must be adept at designing,…

Posted on Careers 2.0 on January 31, 2014

Experience working with marketers and other designers and developers – wait, what?
shrug i didn't write it
17:45
Anyone heard of concrete5 ?
heard, can't remember what though :)
Nothing stands up to WordPress imo
it does not seem one can choose their own term_id when doing wp_insert_term after all
actually maybe i can. but, i am hitting a peculiar problem. i can't believe i'm doing this but i'm going to ask a question on main site!!!
18:03
freak
18:23
lol
solid webdev there... http://t.co/7JtdMY6kl6
I know people appreciate good code art in this room
18:40
I like it
has a certain style
and that style, is insane
and so is the source of my site: ghosttoa.st --> look for class="ghost-grid"
this is what I found on a friend’s site today:
<?
//----------------------------------------------------------------------------------
//----------------------------------------------------------------------------------
//---------------------------- if($button == "Absenden") ---------------------------
if($button == "Absenden")
 {


//************************************************************
//************************ captcha ***************************
function encrypt($string, $key)
500 lines of shit
prägnant (DE) = pithy / pregnant(EN) ... when the belly is pithy ... aha
i understand making headers, but A) those are a big and B) stick to one style
@toscho What friend?
18:47
you don’t know her
she wrote it?
hell no, she asked me to fix it
some “SEO expert” had improved her site for a while. I told her to fire him, and she did.
he is a comment expert
it is much worse than bad code style
His SEO weapons of choice are his private GA account, used for all clients and PowerPhlogger (last updated 2003) for “analytics”.
not to mention a contact form which my grandma could hack
19:05
19:18
anyone has a clue why might first work, but second fail with DomCrawler?..

$cell->filter( 'a[href^=title_profile]' )->extract( array('href') ),
$cell->filter( 'a[href^=title_profile]' )->attr( 'href' ),
never mind, I was being stupid looking at first element and it was crashin at n-th
20:00
how do I express in CSS "table, next to table, contaiing particular image" ?
I can google too, but having trouble bridging theory to reality :)
@Rarst table + table img
el immediately followed by el is +
that would get me table with img, I need another one (which is after table with img)
when it's nested
20:07
this isn't working #indicators table img[src*="1pix.gif"] + table
container + nth selector
n is variable
@Rarst o.O
yep
so "table that contains img" = rule (1) "followed by table" = rule (2) ?
20:08
img:nth-child(2) or something
don't think that's possible, @Rarst - maybe better ask @toscho
I don't need image, I need table next to the one with image
There's no if in CSS, you know ;)
maybe I should just iterate through the tables in PHP
Use jQuery :D
20:10
jquery to the rescue
the < selector was proposed, but isn’t implemented wide enough for now
jQuery in PHP? I am writing DomCrawler code here
<style>table ~ table { color: white; }</style>
<table class="test">
    <tbody>
        <tr>
            <td>test</td>
            <td><img width="20" height="20"></td>
        </tr>
        <tr>
            <td>test</td>
            <td>test</td>
    </tr>
   </tbody>
</table>
  <table class="test"><tbody><tr><td>test</td><td>test2</td></tr><tr><td>test</td><td>test2</td></tr></tbody></table>
table ~ table works. but seems like table img ~ table doesn't work as it takes img and tries to match table after img.
No idea how to proceed from there.
I dont think you can chain selectors can you like table ~ table + img[src$=".jpg"]
the problem is, that you can't go down the DOM tree again, when you already walked into it with the 1st selector.
20:18
css sucks
any idea if DomCrawler implements it?
probably not
I'll leave that for another day, I ended up counting rows until I get table with right number of them
crap, number of rows sems variable as well
20:34
if ( 10 < (int)$rows ) { // I am not proud of this condition
box build lalala, not hearing any feedback about it this evening
nope, wrong numbers. ffs.
20:55
okay, ultimate technique - iterating through every row in every table, looking for the right one. I feel dirty.
what exctly are you doing
scraping
updating his geocities page
box build dammit!
scraping wat
@GhostToast omg
20:59
some scientific crap for friend's work. she got assigned a lot of stupid recurrent work with it.
I remember @Wyck linked a porn research PDF from Technical University Vienna where someone scraped hundreds of Pornsites for his PhD. Something like that?
yeah, sans porn
boring
tell me about it...
but seem to be done for now
donut heads imo (feel free to google image that)
21:12
@Wyck .... just... why?
why do birds suddenly appear
I blame cats
seems canonically better known as "bagel heads"
ah ya that's it
euuugh
21:16
thats what I typed into google last week and saw that, I forgot why I put those 2 words together, apparently it's a thing
$fatherhood_goals[] = 'Prevent children from becoming bagel heads';
@Wyck @GhostToast omg ... why the fuck did I read that and google it? urgh!
ya sorry NSFL tag was missing from WSPE
Loop-heads.
It's so simple kids, really. Drinks and other fluids go in the mouth. Only waste goes out your bum. Don't smoke anything that hasn't been legalized in at least a few developed countries. And nothing in excess.
it seems about as intelligent as vodka enemas
21:22
Is an inhaler device called vaporizer?
@GhostToast except for cigarettes
right
yea cigarettes are bad but i'd rather my kids learn to smoke those than try meth or something. it won't kill you in one terrible, accidental incident. its those tragic, foolish choices by adolescents that terrify me as a parent.
nobody ruined their entire life smoking cigarettes, i guess
err except for cancer... you know what i mean
lol ya just 1 or so million people a year
unverified stat I just googled and didn't read^
@kaiser depends on the actual device in question. Asthma inhalers are not vaporizers as they do not use heat in order to vaporize anything - they are simply canisters of compressed gases. Many e-cigs are not technically vaporizers for the same reason, though many are and indeed use heat to vaporize nicotine. While several of these devices release controlled bursts of vapors, they do not actually vaporize material.
"Vaporizing" itself is the process of heating a material to a specific temperature in order to release active compounds without actually combusting the material, as does happen when something is "smoked"
I mean the electrical stuff that you combine with a towel above your head when you're sick and try to get crap out of your nose.
21:30
humidifier?
there are machines people with sleep apnea use
which are vaporizer i think
or PAP? something
i think vaporizer/humidifier are synomymous for breathing treatments, at least some overlap
@GhostToast certainly - I would agree. They are "vaporizers" by way of heating water to the point that it becomes vapor.
We'd call it Inhalator I think.
Anyway, what I wanted to say... I always was interested how it'd be to use that thing with some alcohol instead of water. Not sure if it still would be alcoholic as vaporized fluid, but I surely want to give that a shot. Much like pouring Vodka in a Sauna (which works extremely well). @GhostToast that much about your previous statement.
ever drank glögg ?
what does pouring vodka in a sauna do?
doesn't it just evaporate?
unless you mean in your mouth
21:37
@GhostToast jup
but dangerous since you're introducing alcohol directly into the bloodstream
@Wyck it's vaporized alcohol in the air
as it goes that fast, the chemical chains don't break.
can be hard to get it close enough to your mouth to drink it, while its really hot. the effervescence (wow i spelled that right first try) goes right up your nose
but you have to be very careful. you get drunk in just a minute. and I mean really drunk
21:39
hmm I never knew that
similar mechanism to absorbing alcohol directly through the intestinal lining...
@boscho wow. shit. never thought about the lever in that ase...
trying to do an SQL JOIN of two tables, where one table is categories, but glue the "array" of category terms to the result, instead of having essentially duplicate rows (that differ only in the category term attached)
does that make sense and anyone have a clue? here is statement:
$sql = 'SELECT * FROM calendar_events JOIN calendar_eventcats ON calendar_events.eventId = calendar_eventcats.eventId';
better JOIN Vodka with ORANGE JUICE first.
RETURNED 1 ROW(S): Screwdriver
21:45
lol
0 results. But found a beer
is this achievable easily enough in SQL or should i post-process my results with PHP?
Idea: extract all strings for a given text domain from unit tests, so you can use a dynamic expression for the text domain and don’t have to use a fixed string. Any objections?
22:14
I finally got PHP The Right Way banner, upvote please
Whoa, lotta information there.
never even heard of that
22:41
@Rarst a.k.a. PHP: The Lost Guide
Has anyone used this VagrantPress, or do you prefer custom boxes?
Most hilarious question + comments ever:
buh
> Question I have this php function in xampp server using php 5.5, using a live server with php 5.3 I get no error. The error says Fatal error: (...)
Ask the author of the Monetizer_Pro_Monetizer plugin, it's their code. — Andrew Bartel 2 hours ago
i am the author — disertation 2 hours ago
haha!
lol, that's awesome :P
indeed
22:55
@kaiser interesting that it lists the comments as being written 2 hours ago on your end, but visiting the question from my side lists them as 1 hour ago
That's simple @boscho - @kaiser is from the future
> That for sure — kaiser in 1 hour
huh. explains a few things...
> I'm your grandson — kaiser in 3 hours
Oh. ScottB is back again and already at 305 questions.

« first day (1203 days earlier)      last day (4040 days later) »