Skip to content

Instantly share code, notes, and snippets.

View bryanl's full-sized avatar
🚩
Out in the streets

Bryan Liles bryanl

🚩
Out in the streets
View GitHub Profile
require 'benchmark'
def ifelse
val = rand(1000) >= 30
if val
1
else
2
end
end
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' ]
@bryanl
bryanl / .zshrc
Created April 25, 2009 15:56 — forked from qrush/.zshrc
# 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"
@bryanl
bryanl / run_tags.rb
Created April 2, 2009 16:49 — forked from tobias/run_tags.rb
http://vimeo.com/3989493 <--- more info here
#!/usr/bin/ruby
#-*-ruby-*-
# A script to run ctags on all .rb files in a project. Can be run on
# the current dir, called from a git callback, or install itself as a
# git post-merge and post-commit callback.
CTAGS = '/opt/local/bin/ctags'
HOOKS = %w{ post-merge post-commit post-checkout }
HOOKS_DIR = '.git/hooks'
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
class Example < ActiveRecord::Base
# includes
# associations
# named scopes
# validations
Job.new(:noncorporate => true,
:tech => :scalpel_edge,
:cause => Cause.new(:improve_healthcare,
:goodness => :noble))