- Twitter: @reedy
- Blog: http://reedy.in
- Company: Leysin American School in Switzerland
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
| [ -n "$TM_FILEPATH" ] && \ | |
| PDF_FILE=~/Desktop/`date "+%y%m%d%H%M%S"`_`basename "$TM_FILEPATH"`.pdf | |
| PS_FILE=/tmp/`basename "$TM_FILEPATH"`.ps | |
| vim \ | |
| "+set number" "+syntax on" "+color slate" \ | |
| "+set printoptions=number:y" \ | |
| "+set printfont=consolas:h7" \ | |
| "+hardcopy > $PS_FILE" "+q" \ | |
| $TM_FILEPATH &>/dev/null && \ | |
| ps2pdf $PS_FILE $PDF_FILE && \ |
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
| class Time | |
| def in_business_days(number_of_days) | |
| result = self.in number_of_days.days | |
| while [0,6].include?(result.wday) || result.to_date.holiday?(:us) | |
| result += 1.day | |
| end | |
| result | |
| end | |
| end |
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
| Dummy::Application.configure do | |
| # Settings specified here will take precedence over those in config/application.rb | |
| # <snip> | |
| config.my_setting = "bar" | |
| end |
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 'minitest/autorun' | |
| module KnightIndustries | |
| def self.included (klass) | |
| klass.extend ClassMethods | |
| end | |
| def can_talk? | |
| false | |
| end |
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
| set t to "" | |
| set t to do shell script "security 2>&1 find-generic-password -gl ScreenSaverPassword" | |
| set KeyKind to "generic password" | |
| set text item delimiters to "acct" -- Get Account name | |
| set tlst to every text item of t | |
| set acct to item 2 of tlst | |
| set text item delimiters to "\"" | |
| set tlst to every text item of acct | |
| set text item delimiters to "\"" -- Get Password | |
| set tlst to every text item of t |
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
| haystack = [] | |
| 0.upto(100) do |i| | |
| 0.upto(100) do |j| | |
| 0.upto(100) do |k| | |
| 0.upto(100) do |l| | |
| test = [i,j,k,l].sort | |
| unless haystack.include? test | |
| puts "#{test.join(', ')}\n" if test.inject(&:+) == 100 | |
| haystack << test | |
| end |
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
| class UserController < ApplicationController | |
| def create | |
| @user = User.create(UserInput.create(params)) | |
| end | |
| def update | |
| @user = User.find(params[:id].to_i) | |
| @user.update_attributes(UserInput.update(params)) | |
| end | |
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
| # config/environments/development.rb | |
| # {{APP_NAME}}::Application.configure do | |
| # ... | |
| config.logger = Logger.new(STDOUT) | |
| config.logger.level = Logger.const_get( | |
| ENV['LOG_LEVEL'] ? ENV['LOG_LEVEL'].upcase : 'DEBUG' | |
| ) | |
| # ... |
I hereby claim:
- I am danreedy on github.
- I am reedy (https://keybase.io/reedy) on keybase.
- I have a public key whose fingerprint is BF04 8002 9242 1D14 869E 0689 7F1F A7D7 22DD 2BA3
To claim this, I am signing this object: