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 | |
#already installed? start service and exit | |
if ! [ -f /usr/bin/srvadmin-services.sh ] | |
echo "srvadmin utils not installed. installing" | |
else | |
echo "srvadmin utils installed" | |
/usr/bin/srvadmin-services.sh start |
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 | |
#already installed? start service and exit | |
if ! [ -f /usr/bin/srvadmin-services.sh ] | |
echo "srvadmin utils not installed. installing" | |
else | |
echo "srvadmin utils installed" | |
/usr/bin/srvadmin-services.sh start |
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
$ [[ $TERM =~ "screen" ]] && echo true | |
true | |
$ [[ -t 0 && "*screen*" = $TERM ]] && echo true | |
$ |
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
startup_message off | |
shell -$SHELL | |
term "screen-256color" | |
shelltitle '$ |bash' | |
# not sure why I have to do this! | |
# cat ~/.screen.d/shell => ${SHELL} --login | |
#shell /Users/bhenderson/.screen.d/shell | |
#caption always "%?%F%{gk}%:%{rk}%?%n(%t) : %{g}[%{b}%l%{g}]" | |
defscrollback 100000 | |
bind j focus down |
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
require "minitest/autorun" | |
require "post_stats" | |
class PostStats | |
class << self | |
attr_accessor :client | |
end | |
end | |
class Net::HTTP |
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
require 'minitest/mock' | |
require 'net/http' | |
m = MiniTest::Mock.new.expect(:foo, true, [Net::HTTP::Post.new("/")]) | |
p m.foo(1) | |
begin | |
m.verify | |
rescue Exception => e | |
puts "expected to raise" |
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 ruby | |
## | |
# Usage: | |
# | |
# aggregate -h | |
# aggregate -v | |
# | |
# echo {1..25} | xargs -n1 | aggregate_cli.rb | |
# |
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 | |
# Download: | |
# $ curl -O https://gist.github.com/bhenderson/1447788/raw/git-rpie | |
# $ chmod u+x git-rpie | |
# $ git rpie -h | |
help() { | |
cat <<-EOU | |
Usage: |
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 ruby | |
require 'optparse' | |
require 'version_sorter/version' | |
ARGV.options.version = VersionSorter::Version | |
# long options also have default short options | |
opts = ARGV.getopts('', 'reverse') rescue abort( ARGV.options.to_s ) | |
require 'version_sorter' |
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 Sequel | |
module Plugins | |
# The ForceTypecast plugin exists because as far as I can tell, ruby-oci8 | |
# nor sequel has a way of overriding the column type returned from the | |
# database. | |
# | |
# This plugin is copied from TypecastOnLoad and offers similar | |
# functionality. The differences being that instead of taking an array of | |
# columns it takes a hash. | |
# |