git clone git@gist.github.com:3713188.git ccvalidator
cd ccvalidator
cat input1.dat | ./validate_cards.rb
ruby test/credit_card_validator_spec.rb
| tell application "System Events" | |
| set isRunning to (count of (every process whose bundle identifier is "com.Growl.GrowlHelperApp")) > 0 | |
| end tell | |
| if isRunning then | |
| tell application id "com.Growl.GrowlHelperApp" | |
| -- Make a list of all the notification types | |
| -- that this script will ever send: | |
| set the allNotificationsList to ¬ | |
| {"Microphone Muted", "Mic Live"} |
git clone git@gist.github.com:3713188.git ccvalidator
cd ccvalidator
cat input1.dat | ./validate_cards.rb
ruby test/credit_card_validator_spec.rb
| 2nd row 4th column | |
| cat blah | awk 'NR==2 {printf "%s", $4}' | |
| NR -- ordinal number of the current record | |
| NF -- number of fields in the current record | |
| (see man for awk for other stuff) |
| from: http://recoveringphysicist.com/16/limitations-of-the-mac-osx-locate-utility | |
| (normally files in directories that aren't readable by the nobody user / world readable are not locateable). | |
| One can edit a copy of /usr/libexec/locate.updatedb and put the edited copy in place either by hand or via launchctl. I replaced three occurrences of “nobody” with my username in that script, reran it, and now locate reports on all files under ~/Library — indeed on all files readable by my user. |
| rundll32.exe keymgr.dll, KRShowKeyMgr |
| source 'http://rubygems.org' | |
| gem 'rack' | |
| gem 'sinatra' | |
| gem 'dm-core' | |
| gem 'haml' | |
| gem 'dm-postgres-adapter' | |
| gem 'dm-migrations' | |
| gem 'pg' |
| #execute the following from the command prompt | |
| mstsc /v:<ip-address> /admin | |
| you can kick other people off by running (on the remote box) | |
| query session | |
| then | |
| logoff <sessionid> /server /v |
| sudo apt-get install ruby | |
| sudo apt-get install curl git-core bison build-essential zlib1g-dev libssl-dev libreadline6-dev libxml2-dev autoconf libxslt1-dev libpq-dev postgresql --fix-missing | |
| bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer) | |
| #fix your bashrc | |
| # put the following line at the end of your .bashrc | |
| [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm | |
once setup (a la: http://guides.rubygems.org/make-your-own-gem/ )
gem build gemname.gemspec
gem push gemname-version.gem
| def errors_with_message(pattern) | |
| # Generate an anonymous "matcher module" with a custom threequals m = Module.new | |
| m = Module.new | |
| # next 3 lines are equivalent | |
| # (m.singleton_class.class_eval { self }).instance_eval do | |
| m.singleton_class.instance_eval do | |
| # (class << m; self; end).instance_eval do | |
| define_method(:===) do |e| | |
| pattern === e.message | |
| end |