Calculate downloads floor

I wanted to calculate the ratio of active theme installs versus theme downloads, but the calculation often seemed very unfair, for example when a theme has been downloaded 999 times, the “active_installs” number would reflect that as 900  on the WordPress API because it lists theme and plugin count in very round numbers ( 10s, 100s, 1000s, etc. ).

So to equalize things just a little bit – I made this little function:

I don’t know whether this is how WordPress is doing it, but for me, it seems to do the trick.

Snippet: Get the correct page in WordPress

Here is another really quick snippet.
If you have a page where you’re using Query Posts you’re going to have trouble with Pagination.
Wordpress for some reason likes to use page and paged randomly.

If you assign your page as the “front page”, you’re going to have to get_query_var(‘page’), and if you’re going to assign it elsewhere, it’s going to be paged. This is all fine and dandy, at least when you’re in control, but as soon as someone else starts using your theme, you need something more trustworthy, and that’s what this is.
More

Sublime Susy

Sublime Susy 0.1

I just uploaded my initial commit to Github with snippets for the Compass Susy Grid system.
This is version 0.00001, which means I have no idea if I’ve made spelling errors or forgot something, but we’ll fix them over time, right ?

I hope that in the future we can add in some auto-completion for Susy variables, etc, but for now, I hope that you’re going to like my Susy Snippets

CoffeeScript Blows. Minds.

Was looking for a simple way to write an alternative of PHP’s in_array() function in JavaScript, and since I’m using actually writing CoffeeScript, decided to look there as well. And sure enough. Mind Blown.

 

Turns into

 

 

 

Filter an HTML Select Dropdown in Regex

I have had a repeated need for this.

Baiscally what it does it turns:


Awesome Number
Top Number

into

Awesome Number is 99
Top Number is 100

Sometimes useful, decided to save & share :nerd:

Search:
/([^<]+)/
Replace:
$2 is $1

Danish ZIP Codes (PHP Array)

Just in case someone needs this some day.

Usage: [0] => Region Title, [1] => Min ZIP Number, [2] => Max ZIP Number