» Publishers, Monetize your RSS feeds with FeedShow: More infos (Show/Hide Ads)
A quick ping today by Jeff Chandler reminded me that nine years ago this blog started running on WordPress. Time flies when you're worry-free :)
So, before everyone celebrates WordPress' 10 years birthday, I'll blow a few candles first: happy 9th birthday planetOzh :)
(cc) Ozh for planetOzh, 2013. | Permalink | One comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: My Life, planetOzh, WordPress
Feed enhanced by Better Feed from Ozh
As you might know, YOURLS development is now hosted on Github. It's now easy to download the current development snapshot, since Github provides an archive/master.zip.
But not so long ago, YOURLS dev was hosted on Google Code, where there is no such convenient way to download the current SVN trunk as a .zip archive. To generate "nightly builds", I wrote this little script:
- #!/bin/bash
- # Simple bash script to generate YOURLS nightly builds
- # Export in a year-month-day directory
- PWD="/home/ozh/yourls.org/nightly-builds"
- BUILD=$(date +%Y-%m-%d)
- svn -q export http://yourls.googlecode.com/svn/trunk/ $PWD/$BUILD
- # Make package and remove dir
- cd $PWD
- zip -r -q yourls-$BUILD.zip $BUILD
- rm -rf $BUILD
- # Remove old (>7 days) builds
- find $PWD/*zip -mtime +7 -exec rm {} \;
Now you just need to add the script to your cron jobs and call it every night.
(cc) Ozh for planetOzh, 2013. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Bash, Code, YOURLS
Feed enhanced by Better Feed from Ozh
As soon as YOURLS 1.6 ships, I'll move the project development from Google to Github (why? long story short: read this). So, I wrote down a little todo list to make sure the transition is as smooth as possible for everyone, which is:
On Github
- Move in issues and tickets from Google. I wrote a tool for this
- Move in wiki documents from Google. There are a few tools around, like wikiconvert.py, but in worst case scenario doing it by hand is an option.
- Neatly organize the wiki on Github with a home page, sidebar, header and footer. Everything is explained in this article.
- Make a custom CONTRIBUTING.md with a few guidelines (aka RTFM). This one is a very comprehensive start.
- Create labels for issues: I was thinking bug, enhancement, duplicate, invalid, wontfix, RTFM, PEBKAC, worksforme, possiblewithaplugin.
- Tag older commits in Git to recreate the same download list as in the original project
- Maybe clarify the dev and branch strategy, such as in Zenphoto-Development-Process
On Google
Simply mention that the project has moved: modify issues, frontpage and wiki with the adminTabs feature at http://code.google.com/p/YOUR-PROJECT/adminTabs. Example.
Misc downloads
The inability on Github to host files other than your source code bugs me. In YOURLS there are a couple extra files that are available for download, or images used in the wiki documents.
So far the idea I've come up with is: create a branch named downloads and commit those little files there.
And?
Am I missing something? Any idea welcome :)
(cc) Ozh for planetOzh, 2013. | Permalink | 3 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Checklist, Github, Google, YOURLS
Feed enhanced by Better Feed from Ozh
The fine folks from WPMU DEV are running a cool giveaway for 1 annual membership, a $219 value.
Who ? Win what?
WPMU DEV is a WordPress community that features premium WordPress 24-7 support, plugins, and themes. Members get unlimited access to WPMU DEV plugins and themes, as well as constant access to our talented team of developers. One lucky contestant will earn a one year membership ($219) to all this goodness.
To know more about WPMU DEV you can also check their WordPress.org profile, their blog WPMU.org or one of their most popular plugins, MarketPress.
If you need to know one thing about them: their authors dress like super heroes and read awesome books ;)
Contest rules
That'll be simple:
- Create a free account at http://premium.wpmudev.org/join/#signup (real name & real email recommended, obviously)
- Leave a comment right here on this post on planetOzh (using the same name and email, obviously, and mentioning your WPMU DEV username)
That's it. Feel free not to leave a boring comment (like, introduce yourself, your favorite PHP function or your best coding moment maybe?) but that's just bonus to make the web a more interesting place.
Nope, no cheesy tweet to spam all over the internet, although one mentioning @ozh and @wpmudev will be greatly appreciated :)
By next Friday 18pm GMT I'll have my kid to draw a random comment number and I'll announce the winner on Twitter.
Good luck everyone!
(cc) Ozh for planetOzh, 2013. | Permalink | 10 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Giveaway, WordPress
Feed enhanced by Better Feed from Ozh
Here is a story about a guy who tried to speak a language he didn't know. Like Twilight, there are several chapters in that story, but don't worry, it's not about sissy hormone troubled teenagers trying to grasp the meaning of life.
(...)
Read the rest of I don't speak Parseltongue, but I speak PHP (380 words)
(cc) Ozh for planetOzh, 2013. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Github, Google, Harry Potter, PHP
Feed enhanced by Better Feed from Ozh
I have a new face! Move your mouse over me to see, hoo, look, no more glasses! At the end of 2012 I decided I had enough of wearing glasses and went for some laser eye surgery, pew pew. Before: short sighted to the point I would not recognise someone 50 centimeters away when not wearing my glasses. Now: I feel like an eagle with infinite vision!
I've been wearing glasses since the age of 13 and I can tell you It's awesome. New places to discover! Like, at the swimming pool or inside the shower! :) But the best side effect is that, whenever I just remember that I don't need glasses anymore, it brings a big smile on my face and I'm all cheered up for the next minutes :)
My last "new face" was in 2006. Time to change all the gravatars and stuff again!
(cc) Ozh for planetOzh, 2013. | Permalink | 3 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Glasses, My Life
Feed enhanced by Better Feed from Ozh
Do you know that logo? It's the logo of the Open Source Initiative, a non-profit formed to advocate for the benefits of open source, and de facto, the logo for open source stuff in general.
Personally, I rarely see that logo used anywhere, which is a shame. For the sake of promoting Open Source, and because I like that logo (sort of an open lock, see?), I think it would be great if that logo was much more common that it is today.
Anyway, the other day I stumbled upon the Green Lantern logo and the similarities with the Open Source logo immediately occurred to me. I thought it would be fun to make a mashup of the two, which I did. But then, why stop? So, during the last few days, I've been having some Photoshop fun and made, so far, ten Open Source Super Hero logos. Can you name them all?
They're all available as nifty Open Source Super Heroes tshirts from Redbubble, an tshirt company responsible for a large share of my wardrobe and provider of awesomeness (seriously, can you handle that coolness?)
Feedback, criticism and suggestions for other Super Heroes welcome!
(cc) Ozh for planetOzh, 2013. | Permalink | One comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: My Life, super heroes, tshirt
Feed enhanced by Better Feed from Ozh
I was having a look at my Profile page on WordPress.org and wondered how many downloads all my plugins had. Start Menu, Accessories, Calculat.. HEY? What am I doing here?
Bookmarklet Fun
The following Javascript snippet will do the job for you:
- (function () {
- var total = 0,
- count = 0;
- jQuery('p.downloads').each(function (i, e) {
- count++;
- total += parseInt(jQuery(e).text().replace(/,/g, ''));
- });
- total = total.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
- alert(count + " plugins and " + total + " downloads");
- })();
Which makes that bookmarklet: Plugin Count. Drag to your bookmarks or right click and bookmark it, head to your wp.org profile page and trigger the bookmarklet!

More Bragginess: Tweet It!
Yeah, a humble alert box won't make the world and your Mom proud of you, right? Tweet Plugin Count!
FYI
Bookmarklets are fun. Two tools will help you:
- The Crunchinator will convert your nicely indented code into an ugly browser-bookmarkable one liner
- JS Beautifier will make the opposite
Have fun!
(cc) Ozh for planetOzh, 2012. | Permalink | One comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Bookmarklet, Code, Javascript, Plugins, WordPress
Feed enhanced by Better Feed from Ozh
I wrote a simple WordPress plugin to address a simple problem: every 2 weeks, on every computer I'm working on, I have to login again to my blogs and, oh the annoyance, click the "Remember Me" checkbox because by blogs can't remember to remember me.

Longer auth cookie expiration (one year instead of 2 weeks) and always checked checkbox: that's Always Remember Me.
(cc) Ozh for planetOzh, 2012. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Plugins, WordPress
Feed enhanced by Better Feed from Ozh
I said the other day that I wanted Git t-shirts, because when I like something, I want t-shirts of it. I couldn't find any. So I made some: Git t-shirts
The Git logo by Jason Long has a very permissive license (CC BY) that allows practically anything as long as the author's name is mentionned. And to be extra sure, I also asked him and he confirmed :)
I've ordered numerous shirts from Redbubble and I really like them: tshirt quality and lastability (?) are excellent, there are plenty of awesome designs to chose from, and it's dead easy to upload your own. Ditto.
I've set the Redbubble commission to a low percentage to keep the t-shirt as affordable as possible (I don't give a flying damn about making dollars of money from this, I primarily made that for myself). What are you waiting for? I'm sure a Git t-shirt would look nifty on your Christmas wish-list! :)
(cc) Ozh for planetOzh, 2012. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Git, My Life, tshirt
Feed enhanced by Better Feed from Ozh
I think I've set up a pretty efficient Git environment on Windows and, as promised in a previous post about my Git initiatic journey, I'm sharing it, hoping it'll be useful to someone. Another quite lengthy post I'm afraid, feel free to grab a cup of something before you start reading.
(...)
Read the rest of Efficient Git Setup on Windows (1,857 words)
(cc) Ozh for planetOzh, 2012. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Git, tricks, Windows
Feed enhanced by Better Feed from Ozh
I've been speaking lately with folks from Spamhaus about anti spam measure in YOURLS and a YOURLS plugin for this. Currently the #1 result in Google for "spamhaus PHP" is a post on Lockergnome which gets it totally wrong and provides a script that does not work, so here is a PHP script that does work.
This script checks a URL (its domain part, in fact) against the 3 major black lists: Spamhaus, SURBL and URIBL.
The script:
- /**
- * Check a URL against the 3 major blacklists
- *
- * @param string $url The URL to check
- * @return mixed true if blacklisted, false if not blacklisted, 'malformed' if URL looks weird
- */
- function ozh_is_blacklisted( $url ) {
- $parsed = parse_url( $url );
- if( !isset( $parsed['host'] ) )
- return 'malformed';
- // Remove www. from domain (but not from www.com)
- $parsed['host'] = preg_replace( '/^www\.(.+\.)/i', '$1', $parsed['host'] );
- // The 3 major blacklists
- $blacklists = array(
- 'zen.spamhaus.org',
- 'multi.surbl.org',
- 'black.uribl.com',
- );
- // Check against each black list, exit if blacklisted
- foreach( $blacklists as $blacklist ) {
- $domain = $parsed['host'] . '.' . $blacklist;
- $record = dns_get_record( $domain );
- if( count( $record ) > 0 )
- return true;
- }
- // All clear, probably not spam
- return false;
- }
Usage:
- if( ozh_is_blacklisted( $url ) ) {
- // do something brutal (eg die() your script, yell at user, etc...)
- }
- // all is fine *for today*, do your regular stuff.
- // This said, it'd be nice to recheck every couple of days
Feel free to steal.
(cc) Ozh for planetOzh, 2012. | Permalink | 9 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: blacklist, Code, PHP, Spam
Feed enhanced by Better Feed from Ozh
I'm a SVN user.
Nowadays, all the cool kids have a Github account where they host stuff and use Git as their primary Source Control tool, and prefer it over the usual SVN you've probably got to use.
I'm not a cool kid and for the last few years (since WordPress started the plugin repository using SVN I think — more or less 8 years ago), I've been happily using SVN. You know SVN, right? Easy to use and to understand, right? Does the job simply, right? So, why switch, right?
I'm regularly pestered to move YOURLS from Google Code to Github, to which I responded more or less that I was happy with SVN and I didn't want to spend time learning a new complicated tool. Because, Git is complicated, right?
But I wanted to be a cool kid anyway, so I gave Git a few looks and tries.
(...)
Read the rest of So, I've Tried Git. And it's… (2,175 words)
(cc) Ozh for planetOzh, 2012. | Permalink | 22 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Git, Github, My Life, SVN
Feed enhanced by Better Feed from Ozh
There's a really nice post that's getting shared all over the intarnets right now, showcasing useful keyboard tricks in various editors, but I thought it missed Notepad++ which does support most of those tricks out of the box.
I decided to list a few quick keyboard tricks in Notepad++ I use daily, and there are really a few cool ones.
Delete whole words
Delete previous word: Control + Backspace
Delete next word: Control + Delete
Actually I think that works in any Windows application since it works right here in my WordPress Write interface.
More power: you can delete from carret to start of line or to end of line adding Shift in the combo:
Delete to start of line: Control + Shift + Backspace
Delete to end of line: Control + Shift + Delete
Duplicate or delete current line
Duplicate current line: Control + D
Delete current line: Control + L
I use the first one pretty often, especially when wanting to test something slightly different: duplicate line, comment first one out and slightly alter second one. Which goes along really well with next trick:
Comment or uncomment one or several lines
Comment or uncomment: Control + Q
That one toggles a leading // in current line or for a line selection. You can also add "stream comments" (ie /* stuff */) with the following key combo:
Add stream comment: Shift + Control + Q
Move that line
Switch current and previous line: Control + T
Move whole line to another place: Shift + Control + Up or Shift + Control + Down
The totally cool stuff is, that second trick works with a multiple line selection. This works great to move an entire small function or CSS declaration.
Column Editing
I've always thought that one was insane :) Pretty usefull if you want to edit several lines of a file where the same text is repeated, such as a CSS file.
Column selection: Alt + Left Click
Where does that code block starts or end? Find matching brace
Go to matching brace : Control + B
Of course the highlighting helps but when the block is taller than your screen, it's not enough. That one is one of my favorites, it makes navigation in if then else or function blocks really easy.
Automatic indentation
Select several lines and move them to the right (indent) or to the left (unindent? outdent?) in a blink
Indent several lines: Tab
Unindent several lines: Shift + Tab
Scroll through the document without using your mouse
Scroll without changing carret position: Control + Up or Control + Down
More !
That's just a few quick and useful keyboard tricks I use all the time, but there are a lot more. Notepad++ has also a gazillion plugins to do just anything you'd think of. The ones I use all the time are Function List (displays a function list in the sidebar, very handy to quickly navigate) and Finger Text, one of the many snippet plugins available.
(cc) Ozh for planetOzh, 2012. | Permalink | 7 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Notepad, text editor, tricks
Feed enhanced by Better Feed from Ozh
Ho haï, blog, long time no see! :)
I was checking stuff on various URL shorteners and noticed is.gd has one interesting feature: you can generate short URLs that are "pronounceable" (no "vgfhgt"). This is a great little touch: a random but pronounceable word will be more memorable and the probability for typos is reduced, which makes it a killer feature for random generated passwords for example.
Generating pronounceable random words isn't difficult :
- start by a vowel or a consonant
- alternate and add letters till proper word length
Simple, but this generates words that are too simple maybe: 'abuco', 'misolo', 'xulanipo', etc... Natural words also use a few consecutive consonant combinations as well as vowel combos ('cheepo', 'bergam', ...)
I ended up with this simple piece of code that gives more natural words:
-
<?php
-
/**
-
* Generate random pronounceable words
-
*
-
* @param int $length Word length
-
* @return string Random word
-
*/
-
function random_pronounceable_word( $length = 6 ) {
-
-
// consonant sounds
-
$cons = array(
-
// single consonants. Beware of Q, it's often awkward in words
-
'b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm',
-
'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'z',
-
// possible combinations excluding those which cannot start a word
-
'pt', 'gl', 'gr', 'ch', 'ph', 'ps', 'sh', 'st', 'th', 'wh',
-
);
-
-
// consonant combinations that cannot start a word
-
$cons_cant_start = array(
-
'ck', 'cm',
-
'dr', 'ds',
-
'ft',
-
'gh', 'gn',
-
'kr', 'ks',
-
'ls', 'lt', 'lr',
-
'mp', 'mt', 'ms',
-
'ng', 'ns',
-
'rd', 'rg', 'rs', 'rt',
-
'ss',
-
'ts', 'tch',
-
);
-
-
// wovels
-
$vows = array(
-
// single vowels
-
'a', 'e', 'i', 'o', 'u', 'y',
-
// vowel combinations your language allows
-
'ee', 'oa', 'oo',
-
);
-
-
// start by vowel or consonant ?
-
$current = ( mt_rand( 0, 1 ) == '0' ? 'cons' : 'vows' );
-
-
$word = '';
-
-
while( strlen( $word ) <$length ) {
-
-
// After first letter, use all consonant combos
-
if( strlen( $word ) == 2 )
-
$cons = array_merge( $cons, $cons_cant_start );
-
-
// random sign from either $cons or $vows
-
$rnd = ${$current}[ mt_rand( 0, count( ${$current} ) -1 ) ];
-
-
// check if random sign fits in word length
-
if( strlen( $word . $rnd ) <= $length ) {
-
$word .= $rnd;
-
// alternate sounds
-
$current = ( $current == 'cons' ? 'vows' : 'cons' );
-
}
-
}
-
-
return $word;
-
}
-
-
?>
(bleh, just noticed the fuckingfancy curled quoted are back in code blocks. pastebin for cut'n'paste code)
Play with the demo: random pronounceable words.
Nothing elaborated enough to help you create an alien language for your next sci-fi movie, but I'm rather pleased with the random words it creates. It's also easy to implement this in another language: modify the group of consecutive vowels and consonants to match what exists in your language.
(cc) Ozh for planetOzh, 2012. | Permalink | No comment | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Code, password, PHP, random
Feed enhanced by Better Feed from Ozh
I recently discovered Rodrigo y Gabriela, a duo of Mexican guitarists playing fast rhythmic acoustic guitars. Think Flamenco on steroids meets furious Rock. I'm totally hooked and want to share :)
The first track a friend introduced to me was their cover of Led Zep's Stairway to Heaven, and I immediately thought "wow, gotta check out more from them"
Being a metal head myself, I looked for more covers and boy I got excited by tons of live performances: Metallica's Orion, One, a quick reference to Slayer's Rain in Blood at the beginning of a song, Symphony of Destruction, Whiskey In The Jar. Do not miss that live jam session with living monster Robert Trujillo, they just fit too nicely together to be skipped.
OK, these guys obviously like classic metal and know how to cheer a live crowd up with hits everyone love. Their studio compositions are just pure awesomeness too.
Hanuman gives me giant goosebumps. Diablo Rojo makes me want to jump all over the place. On Tamacun my head just shakes all by itself. I could just list all their songs.
Seriously, go and search the whole interwebs for more videos of them. They're insanely good. ZOMG when I grow up I want to be a guitarist like Rodrigo :)
(cc) Ozh for planetOzh, 2012. | Permalink | 4 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Flamenco, Guitar, Music, My Life
Feed enhanced by Better Feed from Ozh
Often when viewing a Twitter profile, the same comment pops into my mind: "Does this person follow me?". That's a basic information Twitter profiles still fail to clearly show.
There's a neat site you may know already, doesfollow.com, which lets you know if user1 follows user2 in a very simple way: check http://doesfollow.com/user1/user2 (example). Simple, but this lacks automation and geek fun. Let's make a cute bookmarklet out of this.
(...)
Read the rest of Mutwual, A Twitter Bookmarklet To Quickly Check If Someone Follows You (180 words)
(cc) Ozh for planetOzh, 2011. | Permalink | 5 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Bookmarklet, Code, Javascript, Twitter
Feed enhanced by Better Feed from Ozh
Look at what the mailman finally brought me today:
OMG. I'm all excited. Writing stuff is great, submitting Word documents for proofreading is great, reviewing PDF chapters is great, downloading the whole ebook is great but, man, holding the hefty nifty paperback, feeling its weight, substance and existence... Wow :)
(cc) Ozh for planetOzh, 2011. | Permalink | 17 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: #plugindevbook, Books, Cult, My Life, WordPress
Feed enhanced by Better Feed from Ozh
A few days ago, the fine folks from DigWP have published a .htaccess trick to enable logging in from yoursite.com/login instead of yoursite.com/wp-login.php.
Their trick is perfectly valid, yet improvable: it requires editing of the .htaccess, a file you don't want noobs to mess with. So my thoughts were: "OK, that's nice and everything, but a simple plugin would be cleaner, easier for beginners, and more portable". Let's do this?
(...)
Read the rest of Pretty Login URL: a Simple Rewrite API Plugin Example (368 words)
(cc) Ozh for planetOzh, 2011. | Permalink | 38 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: htaccess, Plugins, Rewrite, WordPress
Feed enhanced by Better Feed from Ozh
Every year, Christmas is a truly awesome event at my parents' with my sisters, wife and brothers-in-law. We offer each other a shitload of gifts while eating fine food cooked by Mom and drinking top notch wine prepared by Dad. In those dozens of gifts, of course a lot are mostly jokes or inexpensive stuff, and every year I make several DIY stuff that are funny and anticipated for.
Two years ago one of my presents was, for each couple, a little pack of "Love Coupons". I liked the cute sissiness of the idea but wanted to make it more funny and less sissy, so I scouted the web for Barbie and Ken pictures to make several cool coupons, such as these ones (in Fwench). Good for... a romantic night, a massage, kinky stuff, shopping with you, etc..., each time trying to more or less match the Barbie pic.




It was funny and girls loved it :) When I showed them to friends, several asked for the file so they could print the same, so here it is, in its full .PSD glory complete with 13 layers of different Barbie pics (and English messages).
If you happen to use the PSD template and make some cool Love Coupons, be sure to share some pics :)
(cc) Ozh for planetOzh, 2010. | Permalink | 7 comments | Add to
del.icio.us | splogmenotplz
Read more posts tagged with: Barbie, Christmas, Gifts, Ideas, My Life
Feed enhanced by Better Feed from Ozh












