Validating the new No Captcha reCaptcha in PHP

Thursday May 7th, 2015

Google has released a new nicer looking reCaptcha (finally) but it does not currently have the drag and drop PHP library to match it. Here is what it looks like if you haven’t seen it yet.


Also, it ended up being so easy I didn’t even bother to search Packagist for it. So here is how you do it like a boss. Depends on PHP (obviously) and cURL (functionally). I am not going to talk about how to embed it on the site, because when you generate the API key, it tells you right then the 2 lines of HTML to paste to make it show up. This code is for after that.

(it is also worth noting that if you were using the old reCaptcha, the old Public/Private keys will not work. You will have to delete them and regenerate them)

Why is everyone stuck?

Tuesday April 21st, 2015

Everyone has an opinion on things. Honestly, I don’t care what your opinion is. What bothers me is how you generated your opinion.

If you actually really read this post, and still somehow think that I am just ranting about code standards, formatting, or specific software products, then you completely missed the point and I promise it is not going to be worth your time putting your 2 cents in.

  • Tabs vs spaces.
  • PascalCase vs camelCase.
  • Red vs blue.
  • Strict Typing or soft typing.
  • Break-braces or inline-braces.

Bob, You Don’t Know How To Work With Other People.

I honestly believe I am a problem solver. You have a problem, I have a problem, I will solve the shit out of it to the best that both of us can be as happy as possible. I am a motherfucking debugging debugger who doesn’t even use a debugger.

I honestly believe nobody else wants actually wants their problems solved, though.

Believe it or not, I actually respect your opinion enough to find a solution that is flexible to give us both exactly what we want. If you are going to shoot down viable solutions just because of your old hat tricks, then it is not that I don’t know how to work with you – I DON’T WANT TO, I CAN’T HELP YOU. Everything I do is about progression, not regression. Everything.

Computers Should Do What I Want.

I find code easier to read if the indents are a bit wider, six spaces to be exact for me. I’m not going to put six actual spaces in my code though, because, like I said above, I actually fucking respect your opinion, and so I shall use a solution that allows us both to have what we want (the tab). You can now have your visual four spaces, I can have my visual six spaces, plus we cut out a shitload of whitespace bytes that PHP is reading off disk every page load. But here the rest of you go, shooting down viable solutions to make everyone happy just because it is not the time honoured tradition you have been dogged into from before we had GUIs on our computers.

Git hooks. Why the fuck can I not include them in the repo? Because someone could put rm -rf ~ in the hook and fuck me over when I clone? Well, the same jerkbag move could be put in the unit tests to screw me over when I run them the first time. Why should I have to copy in my .git/hooks every time I clone a repo? This is insanity, the computer has one job, to do the things for me after the first time I teach it how to. All I want is to pre-install a pre-commit hook that auto runs the linter FOR YOU to make it EASIER FOR YOU when you clone and test my code. I want it to be easy FOR YOU and FOR ME. I actually want you to use my code, and contribute, and I want it to be as easy as possible for both of us.

I also want it done without waiting for the network negotiation, meaning, I don’t want to put them in the Github side of the operation. True, I can, but you aren’t commiting and pushing to Github. You are commiting locally and then doing a pull request. So I don’t want it in the Github side.

Then just include them in a folder so they can be copied in after clone? Did you not listen at all? That is literally, the exact extra step I want to avoid. In order to make it work out of the box, I have to make a box for my box. Why wasn’t the first box good enough? Why can’t it be better?

Every Thing I Do Is For The Next Time I Do It.

Write a library. Use the library. Now stop and think about how simple [or not] it was to use. Now stop and ask yourself “why”.

  • Why did I have to do this to do that?
  • Christ, why did I have to do ALLLLL of that just to do this?
  • Could the computer have done this for me?
  • Why didn’t the computer do this for me?
  • Why isn’t the computer doing this for everyone?

If those are actual questions that you can stop and ask yourself because some function was just too hard to use, you need to go back over shit and make it easier.

Before you release it.

I do this. Why doesn’t everyone else?

Bob, All You Have To Do Is This. And This. And This. And This. And This. It’s Easy. Stop Fighting Everyone.

You realise for any given topic, the number of “just do this” and “just do that” actually adds up to basically spending an entire day just to set up something that, if it had been done right the first time, would have taken like 10 seconds.

I call this Duct Tape Syndrome. Instead of taking more time the first time to do it right, developers will just duct tape a bunch of random shit together, building a product that has the learning curve of Mount Everest.

Bob, Then Just Write A Script And Be Done.

ohpifdagjg;oiuewqtlkuihdsafglkuihfdawsjlkh rewgaflkhsea ljhregkjhfhdsljkahlk fdjhslkfvjhasd;kijhgfdasr;ljhgar elkhvg;krha;w efhdflkghfs;aihgrwe;oihjgra;lkjhk;rsagj;lbsfdj;lkfdsgj;lkgfds;khi rgek;jre ;kjdfg ‘

fdgfd fdg fd g fdg

I shouldn’t be surprised nobody actually reads or considers. For some reason I am seen as just a community clown.

I in fact have many such scripts. But I long for a day that I shouldn’t have to hack around to do what it should have already just done.

Then Commit Back Patches To Fix Things!

I used to be very pro opensource. In fact, I was an open source nazi. I had my phase where I refused to use Microsoft products. Here is the thing about contributing to established projects. I used to contribute a lot of patches to Linux, Compiz-Fuzion, Colloquy, X-Chat, PHP-GTK, and lots of smaller projects. With the exception of PHP-GTK, most of my patches were ignored.

The very last patch I submitted was a patch to Colloquy to make it so that when you click the Red X on the title bar, the app would minimise instead of terminate. Why would I do that? Because that’s how every other OSX app works, like, iTunes. You hit the X, that shit keeps playing your tunes. The window just goes away. It doesn’t disconnect and stop your music.

So I made this patch, it added a checkbox to the options which allowed you to toggle between minimise or terminate, and it even defaulted to what they wanted – terminate. Then, in classic form like I have been accustomed to with open source, I was told the idea was stupid and the patch was dropped.

  • Judged by visiblity. Do they know your name? Nope? They act defensive, but you may have a chance.
  • Judged by notability. If they do know you, do they like you? If not, you’re fucked even if your patch is the most amazing thing ever.

That was the last day I contributed to open source. I decided I would no longer allow random jackwagons on the internet to make me feel bad. For many years, I was very happy and unstressed. Now I am trying to get back into it and nothing has changed.

I feel bad, disliked, hateful, and demotivated. If you were my girlfriend, I would have dumped your ass a long time ago. So why am I still trying?

Nexus 7 slow after upgrade to Lollipop?

Thursday March 26th, 2015

After upgrading to Lollipop my N7 was completely useless. It would take MINUTES just to bring up the settings app – and i am not exaggerating for dramatic effect. It was seriously that bad.

It was so slow I just shoved it under the bed and forgot about it for a few weeks. Finally decided to try and figure out what is up, I saw a few posts that suggested to try TRIMing it. Well, let me save you some time now, the N7 doesn’t support TRIM, so don’t waste your time.


While doing this, even though my device was prerooted and unlocked from many previous installs, it turns out that my root was disabled. Not only that, Root is now an actual option in the Android Settings which leads me to believe the hacky root enablers are no longer needed. I found all this out when I was getting ready to reroot/unlock the device over USB by enabling USB debugging. However the moment I enabled root in Android Settings, my N7 started going super fast just like it was new. Brilliant!

I would also suggest disabling Adaptive Brightness, as I noticed that my framerates suffer a bit while it sits there constantly dicking with its brightness while sitting on the desk in a bright room.

So, give that a try. Here are some screenshots so you can figure it out since they moved everything in Settings this release.

First open up Settings > About Tablet. Then tap on the build number field 7 times to enable the Developer Options.


After that hit the back button, now you should have a Developer Options menu at the very bottom of Settings. Open that and enable Root access for all the things.



After doing this if you are using SuperSU like you should, SuperSU will be able to update the SU binary. Then reboot. Hopefully, like me, you will enjoy your “fast” tablet after this, as well as all your crap being able to be full featured again.

No matter what this tablet is going to be slow the bigger Android gets, remember how cheap it was when we bought it? At least it is usable now and that is what matters to me.

Facebook’s URL sharing is the bane of the internet.

Friday December 26th, 2014

Sharing a link. It sounds so fucking easy, doesn’t it?

I’ve been dicking with this for over a year now. If you try and fight me on this, I will end you.


Adding the Share code to your page causes Facebook to prematurely hit your page and cache it even if nobody ever actually clicks share.

Why is this a problem?

Because when a profile is created it has no images. My og:image tag is telling to use the sites logo, but of course Facebook ignores this shit and instead pulls a random image from the web page, usually the QR Code, which is not even visible by default. This is fine, whatever, nobody has even shared that page yet anyway because its brand new.

Oh wait, but, just the act of loading the share button causes Facebook to cache it. Now when the user uploads their own images to the profile header and icon, the share dialog is still using the old cached copy instead of with the new images. This means the first time they actually try and share their nice and completed profile, Facebook is all like “here is the shitty looking one from 4 hours ago”


[Fail] Call the Graph API to tell them to scrape your shit when someone changes something on the profile. It works, they hit your shit. It almost never actually updates the cache though – at least not nearly instant enough to make it work right. I can confirm every time the user changes their images now Facebook is hitting the page with curl "" -d "scrape=1&id=URLENCODEDURL" tail -f access.log .. and the JSON it returns even says “HEY I FOUND YOUR UPDATED OG:IMAGE” – except here we are, still seeing stale cache in both the share dialog and the final feed post if we decide to be bold and click share anyway.

[Fail] Use version’d URLs. I now have pending=RANDOMNUMBERRRRR on the front of any profile which does not yet have images. It doesn’t work, Facebook seems to be ignoring the query component. There are lots of suggestions of using fbrefresh=rando too, but that is also defunct.

[Fail] Use the FB.UI (from the JS SDK) manually instead of their prefab share code. This calls a newer version of the popup than Facebook’s Share Button generator which seems to be better about showing the latest cache. This button refuses to work except on the domain your app is configured for. It will toss a giant red error to the user.

Ok, that is fine, Facebook allows you to set multiple domains in the App control panel. WRONG. IF YOU TRY, THEY TELL YOU TO FUCK OFF BECAUSE THE DOMAIN MUST MATCH THE CANVAS URL, WHICH NOBODY FUCKING USES FOR SHARING EITHER.


[Fail] Do not include the Facebook JS SDK and Share button until the profile has images. This fails because now my users think they can’t share their page ever because they can’t see the share button from step one. Users need to see all their shit from the moment they open the account or they think it is broken.

[Fail] Wait 24 hours. Screw you.

It actually gets a little worse.

When using the prefab Facebook share button, it uses an older version of the share popup, and this popup seems to have its own cache which is separate from the Graph API cache. This means it is possible to click share, see the QR code, be unable to change it, hit share, and then some totally different image… sometimes random, sometimes og:image, is actually what is displayed on the Facebook feed.

Stop Composer from caching the Packagist index (on Windows)

Friday May 30th, 2014

If you are actually trying to develop a package for Composer and you manage to do it without getting yourself into a bloodrage, then you are a much more zen person than me. One of the things that pisses me off the most is that it caches the Packagist index on my local machine, and when I am pushing tweaks to Github several times an hour, that is super annoying.

  1. Find your AppData\Local\Composer folder. For me, C:\Users\bob\AppData\Local\Composer.
  2. Delete all the crap in it.
  3. Right click the empty space you just made, choose Properties. Security tab, Hit Edit.
  4. Select your user, put a checkmark in the Deny box for Write. Hit Apply and accept its warning that you know you are denying yourself.
  5. Enjoy Composer being unable to cache.


I assume on Linux you can find wherever it hides it in your home directory and chmod 000 it.

Unadultered LibreOffice bashing – because I earned it

Thursday February 13th, 2014

Version on Windows 8

How to delete Icons from the new Android 4.4 desktop

Friday January 24th, 2014

Certainly it cannot be that difficult… right? Just like before… long press… drag to… wait… what? I spent about 15 minutes trying different things before figuring this one out.

Finally the option to hide the Google Search bar is an option in the default launcher. But wait, did you hide it? It turns out the Google Search bar is what turns into “x Remove” when you long press an icon. If you get rid of the search bar, you cannot delete any icons. To get the bar back, long press an empty spot on the desktop, and then choose settings.

Screenshot_2014-01-24-02-21-26 Screenshot_2014-01-24-12-36-20 Screenshot_2014-01-24-02-21-14

Of course, this will not be an issue for you if you are using a different launcher.

Google Chrome taking a long time to load on Windows 8.1

Monday January 20th, 2014

I came across this “fix” completely by accident. About two weeks ago my Google Chrome started taking 7+ seconds to launch, which made it as slow as both Firefox and Internet Explorer, while Opera launches in less than 1 second.

Hit up your about:flags page. At first I thought it was this option “Enable Instant Extended API”:




If you do not set that to disabled, the act of creating a new tab takes for-fucking-ever, and you have to sit there and wait for your search box and most visited sites. This fixed slow tabs, but did not fix slow launch. It ended up being this option “Enable D3D11″:




As soon as I enabled that, Chrome was launching in under 1 second again. I assume just like games, the “Default” option is using D3D9, and perchance may be buggy on modern computers. No idea.



Wednesday October 23rd, 2013

Don’t get me wrong, I love PHP. But I also don’t have delusions about it. IMHO she fits it perfectly, lol.


Constructors, Factories, and Typecasts… oh my.

Friday October 18th, 2013

Or – why I prefer a factory style object management system. For the duration of this post we shall assume I have a class called App\User, of which represents a user account in our database.

I am rather used to having unpopular views, so this post will probably be flamed or ignored. Does that at least peak your interest a little to wonder what in the world I could be talking about in here? Lowercase lol.

TL:DR – leveraging all three of these to work together for you is pretty awesome.

Continue to full post…