This file contains hidden or 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
| require 'restclient' | |
| require 'pp' | |
| require 'hpricot' | |
| if ARGV.size == 0 | |
| puts "Usage: showheaders.rb <url> [headers]" | |
| puts | |
| puts " Headers are optional, but should come in as pairs of arguments." | |
| puts " showheaders.rb <url> If-None-Match 4eb6dc" | |
| exit 1 |
This file contains hidden or 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
| require 'socket' | |
| require 'openssl' | |
| # port can be anything. here it's ldaps | |
| socket = TCPSocket.new("some.secure.server.com", 636) | |
| ssl_context = OpenSSL::SSL::SSLContext.new() | |
| unless ssl_context.verify_mode | |
| warn "warning: peer certificate won't be verified this session." | |
| ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE | |
| end | |
| sslsocket = OpenSSL::SSL::SSLSocket.new(socket, ssl_context) |
This file contains hidden or 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
| [core] | |
| gitproxy="/Users/name/bin/gitproxy" for github.com |
This file contains hidden or 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
| # Counts the number of files in each subdirectory of the given directory | |
| # and then outputs the count in a Tufte-esque style histogram, where the | |
| # number before the | is the 10's column, and each number after the | | |
| # represents one data point with that value. This lets you see the | |
| # spread to get a sense of the distribution. Each 10's value has two | |
| # rows: one for values 0-4, one for 5-9 | |
| # | |
| # 0| | |
| # 0|99 | |
| # 1|0001233333333344444444444 |
This file contains hidden or 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
| TERM=xterm-color | |
| # \[ starts a sequence of non-printable chars | |
| # \] ends that sequence | |
| # \e[1m turns text that follows Bold | |
| # \e[m turns text that follows Normal | |
| # | |
| # \[\e[1m\] tells the shell not to count the non-printable bold command in it's wrapping calculations | |
| # \[\e[m\] tells the shell not to count the non-printable normal command in it's wrapping calculations | |
| # | |
| # Unlike HTML <b></b> elements; this is more like <b>...<normal> It's important that the shell counts |
This file contains hidden or 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
| parse_git_branch() { | |
| git symbolic-ref HEAD 2> /dev/null | cut -d/ -f3- | sed -e 's/\(.*\)/ (\1)/' | |
| } | |
| PS1="\w\$(parse_git_branch) $ " |
This file contains hidden or 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
| @record = [] | |
| def record_match? | |
| record_string = @record.join(" ") | |
| record_string =~ /shadel/i && record_string !~ /svnmerge/ | |
| end | |
| def print_record | |
| puts @record.join | |
| end |
NewerOlder