Skip to content

Instantly share code, notes, and snippets.

View justinrainbow's full-sized avatar

Justin Rainbow justinrainbow

View GitHub Profile
begin
require 'highline/import'
rescue LoadError
puts "we need highline, please run:", "", "\tgem install highline", ""
exit 1
end
begin
require 'gh'
rescue LoadError
@karmi
karmi / _readme.markdown
Created April 19, 2011 16:05
Simplistic Full-Text Search With Redis' Sorted Sets

Simplistic Full-Text Search With Redis's Sorted Sets

Howto

git clone git://gist.github.com/923934.git redisearch

cd redisearch
@asm89
asm89 / gist:5797852
Last active December 18, 2015 14:29
Rerun PHPUnit on file changes in a given dir (defined in my .bashrc)
# watch files and rerun phpunit on changes
phpunitwait() {
while inotifywait $(find $1 -name '*.php');
do
clear;
phpunit --colors $2;
done;
}
@bcarpio
bcarpio / mongodb.py
Created March 30, 2012 15:51
mongodb.py
from fabric.api import *
from fabric.operations import local,put
from fabric.colors import *
from pymongo import *
import sys
import difflib
import paramiko
import socket
import subprocess
import os
@progrium
progrium / sshmany
Last active April 20, 2016 12:37
bash script for executing a command via ssh in parallel on multiple servers with colored output
#!/bin/bash
#
# Usage:
# $ echo "host1 host2 host3" | ./sshmany uname -a
# $ cat myservers | ./sshmany echo Hello world
#
cmd="$@"
servers="$(cat)"
i=37
for server in $servers; do
@pauldix
pauldix / gist:981916
Created May 19, 2011 22:14
Redis SORT command examples
# Optimized for writes, sort on read
# LVC
redis.hset("bonds|1", "bid_price", 96.01)
redis.hset("bonds|1", "ask_price", 97.53)
redis.hset("bonds|2", "bid_price", 95.50)
redis.hset("bonds|2", "ask_price", 98.25)
redis.sadd("bond_ids", 1)
redis.sadd("bond_ids", 2)
@immutef
immutef / SecurityController.php
Created October 27, 2010 09:58
Symfony2 Security Form Login
<?php // src/Application/UserBundle/Controller/SecurityController.php
namespace Application\UserBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller,
Symfony\Component\Security\SecurityContext;
class SecurityController extends Controller
{
public function loginAction()
@nzakas
nzakas / gist:1164118
Created August 23, 2011 01:47
Ant target for autogenerating changelog based on Git tags
<!--
Ant target for autogenerating a changelog based on Git tags
Workflow:
1. Do all of your checkins for a given version.
2. When you're ready to officially create a new version, tag it using git tag, such as "git tag v0.3.0".
3. If you don't already have a file named CHANGELOG in the root directory, make one.
4. Run "ant changelog.update"
@markjaquith
markjaquith / plugin-deploy.sh
Created November 16, 2012 05:04 — forked from scribu/plugin-deploy.sh
Plugin deploy script
#!/bin/bash
# args
MSG=${1-'deploy from git'}
BRANCH=${2-'trunk'}
# paths
SRC_DIR=$(git rev-parse --show-toplevel)
DIR_NAME=$(basename $SRC_DIR)
DEST_DIR=~/svn/wp-plugins/$DIR_NAME/$BRANCH
@marcinbunsch
marcinbunsch / codewall.badges.js
Created March 10, 2012 22:18
Coderwall - display missing badges
// How to use this:
// 1. Go to the desired profile page on coderwall, like http://coderwall.com/marcinbunsch
// 2. Paste this gist in the JS console
//
// You can also probably use this in greasemonkey and dot.js
//
// Also, it was tested in Chrome, Firefox and Safari, it probably will
// not work in IE, but I just don't care about it ;)
//
// UPDATE: Coderwall made changes to the site and I cannot retrieve the achievements, so they are hardcoded, taken from a cached version of the achievements page