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/ruby | |
show_unmerged = ARGV[0] == '-u' | |
branches = `git branch -r`.split("\n") | |
branches.each do |branch| | |
is_merged = `git branch --contains #{branch}` =~ /master/ | |
puts branch if show_unmerged ^ is_merged | |
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
#!/bin/bash | |
declare -i f=75 s=13 r=2000 t=0 c=1 n=0 l=0 | |
declare -ir w=$(tput cols) h=$(tput lines) | |
declare -i x=$((w/2)) y=$((h/2)) | |
declare -ar v=( [00]="\x83" [01]="\x8f" [03]="\x93" | |
[10]="\x9b" [11]="\x81" [12]="\x93" | |
[21]="\x97" [22]="\x83" [23]="\x9b" | |
[30]="\x97" [32]="\x8f" [33]="\x81" ) |
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
javascript:var%20inputs=document.getElementsByTagName('input'),firstSearch=false,textinputs=[],i,t;for(i=0;i<inputs.length;i++)if(((inputs[i].type==='text')||(inputs[i].type==='search'))&&inputs.disabled!==true)textinputs.push(inputs[i]);for(t=0;t<textinputs.length;t++)if((/search/i).test(textinputs[t].className)||(/(^[sq]$|search|query)/i).test(textinputs[t].id)||(/^(q(uery)?|s|.*?search.*)$/).test(textinputs[t].name)){firstSearch=textinputs[t];break;}if(!firstSearch)textinputs[0].focus();else%20firstSearch.focus(); |
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
# A stupid script that actually makes a handy system service | |
# Use it to right click files and extract their text content to the clipboard | |
# Brett Terpstra 2013, no rights reserved | |
txtcount=`file "$@"|grep -c text` | |
response=0 | |
msg="" | |
if [ $txtcount -eq $# ]; then | |
cat "$@"|pbcopy | |
if [ "$?" -ne "0" ]; then | |
msg="Error running command" |
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
// Base64 encoding of your credentials | |
let clientID = '<your client id>' | |
let clientSecret = '<your client secret>' | |
let cred = clientID + ':' + clientSecret | |
let credEncoded = Data.fromString(cred).toBase64String() | |
let auth = 'Basic ' + credEncoded | |
// Get token | |
let tokenURL = 'https://accounts.spotify.com/api/token' | |
var reqToken = new Request(tokenURL) |
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
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled. | |
Using the code from twitter bootstrap documentation page, this code is customized for table header. | |
Create the table with following layout - | |
<table class="table-fixed-header"> | |
<thead class="header"> | |
<tr> | |
<th>Column 1</th> | |
<th>Column 2</th> | |
<th>Column 3</th> |
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
property S : a reference to application "Safari" | |
global W | |
on run input -- input is a list of URLs | |
if (count input) is 0 then ¬ | |
set the input to {¬ | |
"alfredapp.com", ¬ | |
"stackoverflow", ¬ | |
"google.co.uk"} |
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
#!/usr/bin/env python | |
from __future__ import print_function | |
import datetime | |
import feedparser | |
import time | |
import os | |
import sys | |
from six.moves import urllib |
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
#!/usr/bin/ruby | |
# Convert a Markdown README to HTML with Github Flavored Markdown | |
# Github and Pygments styles are included in the output | |
# | |
# Requirements: json gem (`gem install json`) | |
# | |
# Input: STDIN or filename | |
# Output: STDOUT | |
# Arguments: "-c" to copy to clipboard (or "| pbcopy"), or "> filename.html" to output to a file | |
# cat README.md | flavor > README.html |
OlderNewer