Skip to content

Instantly share code, notes, and snippets.

View justinrainbow's full-sized avatar

Justin Rainbow justinrainbow

View GitHub Profile
require 'formula'
class Jmeter < Formula
homepage 'http://jakarta.apache.org/jmeter/'
url 'http://apache.mesi.com.ar//jmeter/binaries/apache-jmeter-2.7.tgz'
md5 '73435baa6ed99c528dacfa36c7e1f119'
def startup_script name
<<-EOS.undent
#!/bin/bash
@justinrainbow
justinrainbow / .shellaliases
Created July 26, 2012 17:01
My shell aliases
alias mongo.start="mongod run --config `brew --prefix mongodb`/mongod.conf"
alias apache.start="sudo /usr/sbin/apachectl start"
alias apache.stop="sudo /usr/sbin/apachectl stop"
# alias cake="${dev}/framework/cake/console/cake"
alias cakephp="${dev}/framework/cake/console/cake"
alias run.elasticsearch='elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.5/config/elasticsearch.yml'
javascript:(function()%7Bvar%20s=document.createElement(%22div%22);s.style.display=%22none%22;s.innerHTML=%22%3Cstyle%20type='text/css'%3Ehead,%20title,%20link%5Bhref%5D%5Brel%5D,%20title,%20meta,%20style,%20script%20%7Bdisplay:%20block;max-width:1000px;margin:1em%20auto;text-align:left;%7D%20link%5Bhref%5D%5Brel%5D::after%20%7Bcontent:%20attr(rel);%20text-transform:%20capitalize;%20%7D%20meta%5Bcharset%5D::after%20%7Bcontent:%20'Charset:%20'%20attr(charset);%20%7D%20meta%5Bname%5D%5Bcontent%5D::after%20%7Bcontent:%20attr(name)%20':%20'%20attr(content);%20text-transform:%20capitalize;%20%7D%20/*%20That%E2%80%99s%20it%20really.%20The%20following%20is%20just%20to%20add%20some%20style:%20*/%20head%20%7Bmargin:%2020px%20auto;%20width:%20960px;%20font:%2014px/1.5%20Arial,%20sans-serif;%20%7D%20title%20%7Bfont-size:%2026px;%20font-weight:%20bold;%20%7D%20link%5Bhref%5D%5Brel%5D%20%7Bfloat:%20left;%20cursor:%20pointer;%20padding:%200%2010px;%20margin-bottom:%2010px;%20height:%2030px;%20line-height:%2029px;%20text-de
@justinrainbow
justinrainbow / flashpanels.php
Created April 25, 2012 18:35 — forked from aforwark/flashpanels.php
flash panel plugin
<?php
/*
Plugin Name: Flash Panels
Description: This plugin handles the flash panels that can be used on SheKnows Blogs
*/
class FlashPanelPostType
{
private $args = array(
'labels' => array(),
YUI().use('connect-api', function (Y) {
var connect = Y.Connect.getInstance();
connect.set('baseUrl', 'http://jrainbow.dev.connect.sheknows.com');
connect.set('commands.favorites', {
url: '/me/favorites.json',
method: 'GET',
// cors: false, // disabled the CORS / Ajax requests
credentials: true, // needed for accessing User data
@justinrainbow
justinrainbow / parameters.php
Created April 4, 2012 16:38
Dynamically changing DIC parameters based on location
<?php
$ip = trim(`/usr/sbin/arp $(hostname) | awk -F'[()]' '{print $2}'`);
if (0 === strpos($ip, '192.168.100.')) {
$container->setParameter("mongodb_servers", "mongodb://mongo-home.local");
$container->setParameter("redis_dsn_primary", "redis://redis-home.local");
} else {
$container->setParameter("mongodb_servers", "mongodb://mongo-work.local");
$container->setParameter("redis_dsn_primary", "redis://redis-work.local");
@justinrainbow
justinrainbow / gist:2294905
Created April 3, 2012 19:25
see all the gifs on bukk.it at once
var r=/gif$/,b=document.body,i="",h="innerHTML";b[h].replace(/href="([^"]*?)"/g,function(m,u){if(r.test(u))i+="<img src='"+u+"'>"});b[h]=i;
@justinrainbow
justinrainbow / watch.js
Created March 27, 2012 21:19
Auto building of YUI3 modules
var watch = require('watch'),
spawn = require('child_process').spawn,
queue = [],
proc;
function run(path) {
if (proc) {
return queue.push(path);
}
@justinrainbow
justinrainbow / gist:2002574
Created March 8, 2012 18:38
Hipchat emoticon list
:-)
:)
:-)
:o
:$
:/
:(
:-*
:#
:'(