Skip to content

Instantly share code, notes, and snippets.

@worldeggplant
worldeggplant / instagramwinners.js
Created June 27, 2013 08:21
Draws n random instagram followers for competitions etc.
/**
* Draws random winners from followers on Instagram
* To be used on Statigram's My Followers page
* @author Jonas Skovmand (jonas.skovmand@tres-bien.com)
* @usage Paste the code in to your browser console and let it rip.
* You will have to scroll to the bottom of your followers list as well.
**/
var followers = $('.detailUser'),
winner_count = 5,
@worldeggplant
worldeggplant / functions.php
Created November 3, 2011 09:01
Different post count on each additional page (i.e. 9 posts on page 1, 6 on each additional page). Does some recalculations WP needs in order to get the page count right.
<?php
$tbs_per_additional_page = 6;
function tbs_paged($query) {
global $tbs_per_additional_page;
if ( $query->get('post_type') == 'post_editorial' || $query->get('section') != '' )
{
if ( intval($query->get('paged')) > 1 )
@worldeggplant
worldeggplant / transcode-convert-wav-mp3-ogg.sh
Created October 10, 2011 16:10
transcode/convert wav mp3 ogg
# convert all .wav files to ogg/vorbis
for x in *.wav; do ffmpeg -i "$x" "`basename "$x" .wav`.ogg" -acodec vorbis; done
# convert all .mp3 files to ogg/vorbis
for x in *.mp3; do ffmpeg -i "$x" "`basename "$x" .mp3`.ogg" -acodec vorbis; done
#convert all .wav files to .mp3
for x in *.wav; do ffmpeg -i "$x" "`basename "$x" .wav`.mp3"; done
#convert all .mp3 files to .wav
@worldeggplant
worldeggplant / bashful.php
Created October 5, 2011 14:57
A PHP library for colorful bash output.
<?php
/**
* bashful.php
*
* Colors output to bash console
* @author Jonas Skovmand <jonas@satf.se>
* @version 1.0
* @package default
*/