Skip to content

Instantly share code, notes, and snippets.

View bradly's full-sized avatar

Bradly Feeley bradly

  • San Diego, California
View GitHub Profile
@bradly
bradly / 1st_chunk[py2k].py
Created August 26, 2012 21:53
Stripe CTF 2.0, level8, py2k webhook for getting the 1st chunk
from os import curdir, sep
import httplib
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
workvar = 0
# arrvar holds the remaining possible solutions to this block
arrvar = range(999)
globport = 0
# config vars:
serva8 = "level08-3.stripe-ctf.com" #level8 server
@bradly
bradly / clear_input.js
Created August 9, 2011 21:17 — forked from kevinthompson/clear_input.js
Clear Default Text Input Value on Focus
// Clear Default Text Input Value on Focus
function hasPlaceholderSupport() {
var input = document.createElement('input');
return ('placeholder' in input);
}
if ( hasPlaceholderSupport() == false ) {
$('input[type="text"]').each(function(){
var def = $(this).attr('placeholder') != '' && $(this).attr('placeholder') != undefined ? $(this).attr('placeholder') : $(this).attr('value');
@bradly
bradly / Questions
Created August 9, 2011 17:27
Frozen Rails Give-away
Day job:
Your Rails contributions (if any):
What's your Ruby/Rail experience?:
How do you use GitHub?:
function parse_git_branch {
[ -d .git ] || return 1
git_status="$(git status 2> /dev/null)"
branch_pattern="^# On branch ([^${IFS}]*)"
remote_pattern="# Your branch is (.*) of"
diverge_pattern="# Your branch and (.*) have diverged"
if [[ ! ${git_status}} =~ "working directory clean" ]]; then
state="*"
fi
# add an else if or two here if you want to get more specific
@bradly
bradly / gist:16841
Created October 15, 2008 02:39 — forked from cilquirm/gist:16840
#!/usr/bin/env ruby
require 'rubygems'
require 'thor'
require 'fileutils'
require 'yaml'
# Important - don't change this line or its position
MERB_THOR_VERSION = '0.0.5'
##############################################################################
@bradly
bradly / gist:4232
Created August 6, 2008 16:23 — forked from defunkt/gist:4169
# by bryan helmkamp with slight modification by chris wanstrath
# from http://www.brynary.com/2008/8/3/our-git-deployment-workflow
module GitCommands
extend self
def diff_staging
`git fetch`
puts `git diff origin/production origin/staging`
end