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
def alert_user(alert = "") | |
voice = NSSpeechSynthesizer.alloc.initWithVoice("com.apple.speech.synthesis.voice.Victoria") | |
voice.startSpeakingString(alert) | |
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
<FilesMatch "\.(ttf|otf|woff)$"> | |
<IfModule mod_headers.c> | |
Header set Access-Control-Allow-Origin "*" | |
</IfModule> | |
</FilesMatch> |
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
CSV.foreach(path, headers: true, header_converters: :symbol) do |row| | |
User.create(row.to_hash) | |
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
# spec/extensions/date_time_spec.rb | |
# PS: I know this spec code isn't particularly DRY or nice. | |
require 'spec_helper' | |
describe DateTime do | |
describe "#beginning_of_financial_year" do | |
subject do | |
DateTime.now.beginning_of_financial_year |
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 'nokogiri' | |
# Public: Find the absolute path to a file | |
# | |
# This method finds a file that is relative to the | |
# location of the script, expanding anything that | |
# needs expanding (~, etc.) | |
# | |
# filename - the filename to find |
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
@duplicate_pharmacists = @pharmacists - @pharmacists.reject { |pharmacist| @pharmacists.select { |p| p.email == pharmacist.email }.size > 1 } | |
@pharmacists -= @duplicate_pharmacists |
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
--- | |
BUNDLE_PATH: .bundle |
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
# Macbook Pro users - en0 is ethernet, so you should use en1 | |
alias ip="ipconfig getifaddr en0" |
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
%w(memcached redis-server htop fail2ban).each do |required_package| | |
package required_package do | |
action :install | |
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
node.override['firewall']['rules'] = [ | |
{"http" => {"port" => 80}}, | |
{"https" => {"port" => 443}}, | |
{"ssh" => {"port" => 22}} | |
] |