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 'benchmark' | |
def ifelse | |
val = rand(1000) >= 30 | |
if val | |
1 | |
else | |
2 | |
end | |
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
module Sinatra | |
module Authorization | |
def auth | |
@auth ||= Rack::Auth::Basic::Request.new(request.env) | |
end | |
def unauthorized!(realm="flixcloud.com") | |
response['WWW-Authenticate'] = %(Basic realm="#{realm}") | |
throw :halt, [ 401, 'Authorization Required' ] |
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
# autocompletion for ruby_test | |
# # works with tu/tf aliases | |
# # see also ~/bin/ruby_test.rb | |
_ruby_tests() { | |
if [[ -n $words[2] ]]; then | |
compadd `ruby_test -l ${words[2]}` | |
fi | |
} | |
compdef _ruby_tests ruby_test | |
alias tu="ruby_test unit" |
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
A User through Oinkmaster's config disables rules in a downloaded rule pack to remove unwanted rules. | |
A User through Oinkmaster's config modifies rules in a downloaded rule pack to customize rules for his environment. | |
A User through Oinkmaster's config ignores files in a downloaded rule pack to remove unwanted rule categories. | |
A User through Oinkmaster's config enables rules disabled in a downloaded rule pack to include deprecated rules he wants to run. | |
A User through Oinkmaster's config prevents updated rules from being copied to the Snort installation so it will not override an older version of the rule he wants to run. | |
A User running Oinkmaster compares the rules in a downloaded pack to the rules already installed to determine which rules downloaded are to be copied over. | |
A User running Oinkmaster downloads one or more rule packs to update their Snort installation so his server will have current rules. | |
A User running Oinkmaster downloads rule packs over http to get rules from Snort.org or BleedingSn |
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 Example < ActiveRecord::Base | |
# includes | |
# associations | |
# named scopes | |
# validations | |
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
Job.new(:noncorporate => true, | |
:tech => :scalpel_edge, | |
:cause => Cause.new(:improve_healthcare, | |
:goodness => :noble)) | |