I hereby claim:
- I am ltw on github.
- I am ltw (https://keybase.io/ltw) on keybase.
- I have a public key whose fingerprint is 5A72 31D2 CA91 4525 3F9F 7ACE 1FB5 E1E6 7F97 AB9D
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
± SILENT=true cap torquebox:squash:uat torquebox:install | |
* 2013-11-20 11:05:10 executing `torquebox:squash:uat' | |
triggering start callbacks for `torquebox:install' | |
* 2013-11-20 11:05:10 executing `multiconfig:ensure' | |
* 2013-11-20 11:05:10 executing `torquebox:install' | |
* executing "IMMUTANT_HOME=/absolute/path/to/the/immutant-1.0.1-slim ~/bin/lein immutant overlay torquebox" | |
servers: ["my-server-uat.dcs1"] | |
[my-server-uat.dcs1] executing command | |
** [out :: my-server-uat.dcs1] Downloading http://downloads.immutant.org/incremental/torquebox/LATEST/torquebox-dist-bin.zip | |
** [out :: my-server-uat.dcs1] [=> ] 3% 2.29MB / 62.23MB |
(import '[org.eclipse.jetty.server.handler GzipHandler]) | |
(defn- configurator [server] | |
"Ask Jetty to gzip." | |
(.setHandler server | |
(doto (new GzipHandler) | |
(.setMimeTypes "text/html,text/plain,text/xml,application/xhtml+xml,text/css,application/javascript,text/javascript,image/svg+xml,application/json,application/clojure") | |
(.setHandler (.getHandler server))))) | |
(run-jetty #'app {:port port :join? false :configurator configurator}) |
def get_bucket(buckets_filled, max_buckets, idx) | |
quot, rem = idx.divmod(2) | |
quot = rem == 1 ? quot + (max_buckets/2) : quot | |
quot > buckets_filled ? :B : :A | |
end | |
p get_bucket(11, 12, 8) == :A ? "OH YEAH 1" : "shit 1" # AAAAAAAAAAAB | |
p get_bucket( 1, 12, 11) == :B ? "OH YEAH 2" : "shit 2" # ABBBBBBBBBBB | |
p get_bucket(11, 20, 1) == :A ? "OH YEAH 3" : "shit 3" # AAABABABABABABABABAB | |
p get_bucket(11, 37, 1) == :B ? "OH YEAH 4" : "shit 4" # ABABABABABABABABABABABBBBBBBBBBBBBBBB |
fn main() { | |
for int::range(1, 101) |num| { | |
let mut answer; | |
if is_fifteen(num){ | |
answer = "FizzBuzz"; } | |
else if is_three(num) { | |
answer = "Fizz"; | |
} | |
else if is_five(num) { | |
answer = "Buzz"; } |
# app/controllers/api/v1/users_controller.rb | |
class Api::V1::UsersController | |
def index | |
render json: { path: 'v1/users#index' } | |
end | |
def show | |
render json: { path: 'v1/users#show' } | |
end | |
end |
class Letterpress | |
def self.run(board) | |
all_words = File.open('/usr/share/dict/words').readlines.map! { |line| line.strip.chomp } | |
valid_words = all_words.select { |w| w =~ /[^#{board.join}]/ } | |
valid_words = valid_words.select do |w| | |
bool = true | |
bool = false if w.size <= 2 | |
split_word = w.downcase.split('') |
FactoryGirl.define do | |
factory :contact do | |
name 'Nigel Weiner' | |
factory :admin_contact do | |
admin true | |
end | |
end | |
end |
namespace :routes do | |
desc 'print list of routes' | |
task :list => [:environment] do | |
Rails.application.routes.routes.map do |route| | |
p "#{route.requirements[:controller]} #{route.requirements[:action]} #{route.verb}" | |
end | |
end | |
end |
class Model < ParentModel | |
include Foo::Bar | |
extend Bar::Baz | |
acts_as_authentic | |
dsl_specific_flags | |
module InternalModule | |
... | |
end |