This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import webbrowser | |
import tweepy | |
""" | |
Query the user for their consumer key/secret | |
then attempt to fetch a valid access token. | |
""" | |
class CacooOAuthHandler(tweepy.OAuthHandler): | |
def _get_oauth_url(self, endpoint, secure=False): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from random import getrandbits | |
from time import time | |
import hmac, hashlib | |
import sys | |
import urllib | |
import urllib2 | |
import urlparse | |
# build parameters to post | |
consumer_key = 'your <consumer_key>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
cmd="git" | |
tmp_file="$TEMP/gitcmd.sh" | |
nkf -w << EOF > $tmp_file | |
#!/bin/sh | |
$cmd $* | |
EOF | |
chmod +x $tmp_file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -n "`git diff`" ] | |
then | |
git stash save --keep-index | |
git stash apply --index | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/gruff/base.rb | |
module Gruff | |
class Base | |
def label_with_ruby193(value) | |
if @marker_count.to_f == 0 | |
label = value.to_i.to_s | |
parts = label.split('.') | |
parts[0].gsub!(/(\d)(?=(\d\d\d)+(?!\d))/, "\\1#{THOUSAND_SEPARATOR}") | |
parts.join('.') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/sh | |
tags=`git branch -r | grep "origin/feature" | sed -e "s/ origin\///g"` | |
if [ -n "${tags}" ]; then | |
for t in "${tags}" | |
do | |
echo git push --delete origin ${t} | |
git push --delete origin ${t} | |
done | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import json | |
import os | |
import subprocess | |
import time | |
import urllib2 | |
devnull = open(os.devnull, 'w') | |
blink1_tool_path = './blink1-tool' | |
jenkins_url = 'https://buildhive.cloudbees.com/view/All/job/jenkinsci/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module RESTful | |
extend ActiveSupport::Concern | |
def resource_name | |
@resource_name ||= controller_name.singularize | |
end | |
def model_class | |
@model_class ||= resource_name.camelize.constantize | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for n in `seq 10000`; do git checkout -b br$n master; echo $RANDOM > $RANDOM$RANDOM$RANDOM$RANDOM; git add .; git commit -m"$RANDOM"; done; git checkout master; brs="`git branch | grep -v master`"; git merge $brs; git branch -D $brs; git rm *; git commit -m"del" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sample | |
class << self | |
def run | |
puts "hello, #{gets}" | |
puts "hello, #{gets}" | |
end | |
end | |
end | |
if __FILE__ == $0 |
OlderNewer