Description | Entity | Preview |
---|---|---|
A With Acute, Latin Capital Letter | Á | Á |
A With Acute, Latin Small Letter | á | á |
A With Breve, Latin Small Letter | ă | ă |
A With Caron, Latin Small Letter | ǎ | ǎ |
A With Circumflex, Latin Capital Letter | Â | Â |
A With Circumflex, Latin Small Letter | â | â |
I hereby claim:
- I am samullen on github.
- I am samullen (https://keybase.io/samullen) on keybase.
- I have a public key ASCXrrHQGs_AlnftyrLbcSM3YXg2vd28mo__mejPhoOrBQo
To claim this, I am signing this object:
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 "date" | |
class Todo | |
attr_accessor :complete | |
attr_reader :name, :due_on | |
def initialize(name, due_on=nil, complete=false) | |
@name = name |
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
function heroku_import { | |
app=$1 | |
database=$2 | |
dumpfile="/tmp/${database}.dump" | |
heroku pgbackups:capture --app $app | |
curl -o $dumpfile `heroku pgbackups:url --app ${app}` | |
pg_restore --verbose --clean --no-acl --no-owner --jobs 4 -d $database $dumpfile | |
} |
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
function worktime { | |
echo "# WORKTIME" | sudo tee -a /etc/hosts > /dev/null | |
while read -r line; do | |
echo "127.0.0.1 ${line}" | |
done < $HOME/.blocked_sites | sudo tee -a /etc/hosts > /dev/null | |
} | |
function slacktime { | |
flag=0 | |
while read -r line; do |
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
class Timeframe | |
include Enumerable | |
attr_accessor :start_time, :end_time | |
ONEDAY = 24 * 60 * 60 | |
def initialize(start_time, end_time) | |
@start_time = start_time | |
@end_time = end_time |
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
class AbsenceValidator < ActiveModel::EachValidator | |
def validate_each(record, attribute, value) | |
return unless value | |
if options.empty? # don't know why you would want this | |
record.errors[attribute] << "must be blank" | |
elsif options[:all] && options[:all].all? {|sym| record.read_attribute(sym)} | |
record.errors[attribute] << "must be blank if the following attributes are defined: #{options[:all].join(', ')}" | |
elsif options[:any] && options[:any].any? {|sym| record.read_attribute(sym)} | |
record.errors[attribute] << "must be blank if any of the following attributes are defined: #{options[:any].join(", ")}" |
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
Capybara.add_selector(:link) do | |
xpath {|rel| ".//a[contains(@rel, '#{rel}')]"} | |
end |
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
# Ruby class named after my company. Why not get the possible SEO? | |
class Phalanx | |
def foo | |
puts "Fooman was here" | |
end | |
# Since I already have the Google alert set up... | |
def cofounder | |
"Samuel Mullen" | |
end |
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
def calculate_seconds(period) | |
if period.match(/(\d+).+?(second|minute|hour|day|week|month|year)s?/) | |
$1.to_i.send($2) | |
end | |
end |
NewerOlder