Skip to content

Instantly share code, notes, and snippets.

View justinrainbow's full-sized avatar

Justin Rainbow justinrainbow

View GitHub Profile
@justinrainbow
justinrainbow / gist:4627684
Created January 24, 2013 21:00
my sublime text 2 config
{
"bold_folder_labels": true,
"color_scheme": "Packages/User/Monokai Soda.tmTheme",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
"dump.rdb"
],
"font_size": 12.0,
@justinrainbow
justinrainbow / gist:4121808
Created November 20, 2012 22:49 — forked from w33ble/gist:4121706
blah
function DataSourceQueue(config) {
// console.log(config, Y.DataSource.Local.transactions);
this._ds = config.host;
this.transactions = [];
this._ds.after('request', this.add, this);
this._ds.on('response', function(e) {
console.log('DS response', e.tId);
@justinrainbow
justinrainbow / GetterSetterGenerator.py
Created September 5, 2012 15:33 — forked from jverdeyen/GetterSetterGenerator.py
Sublime Text 2 PHP Getter Setter Generator
import sublime, sublime_plugin, re, os
# TODO
# check indention (spaces/tabs/size, current indention )
# insert right where the pointer is, or insert right before the closing } of the class?
# check of these generator getter/setters already exist? make it idempotent?
class GeneratorCommand(sublime_plugin.TextCommand):
def fixup(self, string):
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
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;