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
_##_ | |
(..) | |
/ ~ \ | |
|| || | |
m|||m | |
||| | |
n^n | |
_. | |
)'' |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>name</key> | |
<string>Solarized (dark)</string> | |
<key>settings</key> | |
<array> | |
<dict> | |
<key>settings</key> |
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
group :development do | |
gem "ruby-prof" | |
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
<style> | |
.donate-button { | |
text-align: center; | |
} | |
.donate-button .bitcoin-address { | |
font-size: 1.5em; | |
} | |
</style> | |
<div class="donate-button"> |
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
# http://rosettacode.org/wiki/Twelve_statements | |
#1. This is a numbered list of twelve statements. | |
#2. Exactly 3 of the last 6 statements are true. | |
#3. Exactly 2 of the even-numbered statements are true. | |
#4. If statement 5 is true, then statements 6 and 7 are both true. | |
#5. The 3 preceding statements are all false. | |
#6. Exactly 4 of the odd-numbered statements are true. | |
#7. Either statement 2 or 3 is true, but not both. | |
#8. If statement 7 is true, then 5 and 6 are both true. |
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
require 'ruby-prof' | |
require 'ruby-prof/task' | |
RubyProf::ProfileTask.new(:integration) do |t| | |
t.test_files = FileList['test/integration/**/patients_test.rb'] | |
t.output_dir = File.join(Rails.root, 'tmp') | |
t.printer = :graph_html | |
t.min_percent = 10 | |
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
class DevelopmentProfiler | |
def self.prof(file_name) | |
RubyProf.start | |
yield | |
results = RubyProf.stop | |
# Print a flat profile to text | |
File.open "#{Rails.root}/tmp/performance/#{file_name}-graph.html", 'w' do |file| |
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
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8 | |
def unbundled_require(gem) | |
loaded = false | |
if defined?(::Bundler) | |
Gem.path.each do |gems_path| | |
gem_path = Dir.glob("#{gems_path}/gems/#{gem}*").last | |
unless gem_path.nil? | |
$LOAD_PATH << "#{gem_path}/lib" |
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
# Recursive backtracking algorithm for maze generation. Requires that | |
# the entire maze be stored in memory, but is quite fast, easy to | |
# learn and implement, and (with a few tweaks) gives fairly good mazes. | |
# Can also be customized in a variety of ways. | |
DIRS = (N, S, E, W = 1, 2, 4, 8) | |
DX = { E => 1, W => -1, N => 0, S => 0 } | |
DY = { E => 0, W => 0, N => -1, S => 1 } | |
OPPOSITE = { E => W, W => E, N => S, S => N } |
NewerOlder