Skip to content

Instantly share code, notes, and snippets.

View vinbarnes's full-sized avatar

Kevin R. Barnes vinbarnes

View GitHub Profile
[barnekr@pibook:~]$ type nt
nt is aliased to `. ~/new_term.sh'
[barnekr@pibook:~]$ cat /Users/barnekr/new_term.sh
#!/bin/sh
#
# Open a new terminal in the cwd
#
CWD=`pwd`
osascript<<END
<%= render :partial => 'license', :collection => @medical_provider.provider_licenses %>
# _license.html.erb
<li><%= license.license_name %><br />
<small><%= license.license_number %></small><br />
<%= license.locality %>, <%= license.state_or_province %><br />
Expires: <%= license.expiration_date %>
</li>
@vinbarnes
vinbarnes / gist:7978
Created August 29, 2008 14:28
hack && ship functions that are git-svn aware
function git-svn-repo? {
git branch -r 2>/dev/null | awk '{if ($1=="git-svn") {exit 0} else {exit 1}}'
}
function git-agnostic-pull {
if $(git-svn-repo?); then
git svn rebase
else
git pull origin master
fi
[barnekr@pibook:~]$ type testy
testy is a function
testy ()
{
if [ $# -ne 0 ]; then
AUTOTEST=$1 autotest;
else
autotest;
fi
}
[barnekr@pibook:~]$ /usr/local/bin/emacs --version
GNU Emacs 22.2.1
Copyright (C) 2008 Free Software Foundation, Inc.
GNU Emacs comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of Emacs
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING.
[barnekr@pibook:~]$ /usr/bin/emacs --version
GNU Emacs 22.1.1
Copyright (C) 2007 Free Software Foundation, Inc.
>> data = OpenStruct.new({:so => 'what', :what => 'ever'})
=> #<OpenStruct so="what", what="ever">
>> data.so
=> "what"
>> class << data; alias_method :old_so, :so; def so() old_so.upcase; end end
=> nil
>> data.so
=> "WHAT"
>>
[msg(chanserv)] set #nashdl TOPICLOCK OFF
-ChanServ(ChanServ@services.)- The TOPICLOCK flag is not set for channel #nashdl.
#+STARTUP: logdone #+STARTUP: showall
#+TAGS: { @HOME(h) @WORK(w) @COMPUTER(c) @PHONE(t) @ERRAND(e) } PROJECT(p) BILLED(b)
#+STARTUP: hidestars
saturnino:~ barnekr$ irb
>> require 'rational'
=> false
>> require 'mathn'
=> true
>> 1/3
=> 1/3
>>
require 'test/unit'
module ArrayExtension
def superjoin(args={})
start = args[:start]
before = args[:before]
joiner = args[:join]
after = args[:after]
ender = args[:end]