Skip to content

Instantly share code, notes, and snippets.

View jimbojsb's full-sized avatar

Josh Butts jimbojsb

View GitHub Profile
@jimbojsb
jimbojsb / gist:1749610
Created February 6, 2012 04:17
How to Re-Download everything from iTunes Match
1) Create a smart playlist
2) Set the settings on the smart playlist to be "date added greater than or equal to" and choose a ridiculously early date, like 1/1/1995
3) Click the cloud download button on the playlist
4) Wait
@jimbojsb
jimbojsb / header
Created February 10, 2012 21:46
Test Gist
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Harbormaster</title>
<link href="/css/bootstrap.css" rel="stylesheet">
<link href="/css/bootstrap-responsive.css" rel="stylesheet">
</head>
<body>
@jimbojsb
jimbojsb / gist:1878040
Created February 21, 2012 18:39
Turn on RDS Query Cache
rds-modify-db-parameter-group orca --parameters="name=query_cache_size, value=1073741824, method=immediate"
@jimbojsb
jimbojsb / gist:1990186
Created March 7, 2012 00:56
PHPMate for Sublime Text 2
import sublime, sublime_plugin
from subprocess import Popen, PIPE, STDOUT
class RunPhpCommand(sublime_plugin.TextCommand):
def run(self, edit):
content = self.view.substr(sublime.Region(0, self.view.size()))
php = Popen(['/usr/local/bin/php'], stdout=PIPE, stdin=PIPE)
php.stdin.write(content)
output = php.communicate()[0]
newtab = self.view.window().new_file()
@jimbojsb
jimbojsb / gist:2140944
Created March 20, 2012 20:26
Bamboo is dead, long live bamboo
<?php
chdir("/home/offers/www/offers-qa/coral");
`git checkout next`;
`git reset --hard HEAD`;
`git pull`;
chdir("/home/offers/www/offers-qa/orca");
`git checkout next`;
`git reset --hard HEAD`;
`git pull`;
$date = `git log --max-count=1 | grep Date`;
master:
image: private.registry:master
ports:
- 8080
feature123:
image: private.registry:feature123
ports:
- 8081
@jimbojsb
jimbojsb / gist:3738925
Created September 17, 2012 18:28
php configure
'./configure' '--prefix=/usr/local' '--with-config-file-path=/usr/local/etc' '--with-mysql=/usr/local/mysql' '--with-mysqli=/usr/local/mysql/bin/mysql_config' '--with-pdo-mysql=/usr/local/mysql/bin/mysql_config' '--enable-mbstring' '--with-zlib' '--with-openssl' '--with-curl' '--with-xsl' '--enable-fpm' '--enable-soap'
@jimbojsb
jimbojsb / gist:4112010
Created November 19, 2012 17:16
args problem
<?php
passthru('clear');
$args = array(1,2,3,4,5);
class Foo
{
public function bar($args)
{
$args[] = 6;
echo '$args inside Foo->bar(): ' . "\n" . print_r($args, 1);
}
@jimbojsb
jimbojsb / gist:4171673
Created November 29, 2012 20:25
deduplicator
<?php
class Deduplicator
{
protected $items = [];
public function add($item)
{
// name field will be in $item->name
$this->items[] = $item;
}
@jimbojsb
jimbojsb / gist:4208428
Created December 4, 2012 20:38
PHPStorm constructor generation idea
From this:
class FtpTransport
{
public function __construct($host, $username, $password)
{
}
}
Allow me to generate this: