Skip to content

Instantly share code, notes, and snippets.

View jboonstra's full-sized avatar

Joel Boonstra jboonstra

View GitHub Profile
# add to .ssh/config
Host !login.itickets.com *.itickets.com
ProxyCommand ssh john@login.itickets.com nc %h %p
Host *.itickets.com
IdentitiesOnly yes
User john
Host *
AddKeysToAgent yes
@jboonstra
jboonstra / buster.php
Created July 22, 2013 13:10
cache-busting
<?php
// assumes SITE_VERSION, BASEPATH constants are set; assumes CodeIgniter configuration
function buster($url) {
if (!($url && is_scalar($url))) {
return '';
}
// trim off any leading '/' in the URL; we'll re-add it later
$url = ltrim($url, '/');
updateVersionDropdown : function() {
var versionsByLang = {},
getLang = function (v) { return v.get('lang'); },
selectorHTML;
// Loop through the version model
_.each(
// Group versions by language,
// and sort the lang keys alphabetically.
_.groupBy(_.sortBy(this._versions.models, getLang), getLang),
updateVersionDropdown : function() {
var versionsByLang = {};
// Group versions by language, and sort the lang keys alphabetically.
_.each(_.groupBy(_.sortBy(this._versions.models, function (ver) {
return ver.get('lang');
}), function (ver) {
return ver.get('lang');
}), function(version, lang) {
// Sort the versions within each lang group,
<?php
function i18nPOStrings() {
$locale = str_replace('-', '_', get_instance()->config->item('language_ui')->locale);
//$default = str_replace('-', '_', get_instance()->config->item('language_ui_default')->locale);
$dir = APPPATH . 'language/locale/' . $locale . '/LC_MESSAGES/';
$files = glob($dir . '*.po');
foreach ($files as $file) {
$contents .= file_get_contents($file) or die('Could not read from file.');
@jboonstra
jboonstra / turntable.user.js
Created June 28, 2011 15:01
Userscript for Fluid apps (assumes window.fluid, so probably won't work with Greasemonkey)
// ==UserScript==
// @name Turntable Growl Notifier
// @namespace http://joel.boonstras.com/
// @include http://turntable.fm/*
// @author Joel Boonstra
// ==/UserScript==
//
// Adapted from https://github.com/kyanny/turntablefm-growl-notify by
// http://twitter.com/kyanny
// option 1 - "versions" key points to an array
{"versions":
[
{"version":{"id":...}},
{"version":{"id":...}},
]
}
// option 2 - "version" key points to an array
{"versions":