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
# APP_PATH is your application root path | |
# YUI_COMPRESSOR_PATH is the path to the yuicompressor-x.x.x.jar | |
# Files are replaced. Designed to run over the build artifacts on the CI server | |
desc "Minify the javascript and css files that are within the artifacts folder" | |
task :minify => [:copy_artifacts] do | |
#http://developer.yahoo.com/yui/compressor/ | |
puts "Minifying javascript" | |
js_files = FileList["#{APP_PATH}/**/*.js"].exclude(/.min.js/) |
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
-# Instead of this simple_form 2.0.0.rc Twitter Bootstrap complication: | |
= form.input :savings, :label => "Your Savings:", :input_html => {:class => 'span2'}, :wrapper => :prepend do | |
%span.add-on= £ | |
= form.input_field :savings | |
%p.help-block Enter the amount of money you have in your savings account | |
-# I'd like to do something like this (simpler) |
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
# defining various components of the system | |
# notice the classes know nothing about the container | |
# as they require the dependencies to operate, they should be passed into the constructor | |
class Nails | |
def to_s | |
"nails" | |
end | |
end | |
class Glue |
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
@samphippen: https://speakerdeck.com/samphippen/types-and-refactoring | |
@andypike: https://speakerdeck.com/andypike/take-the-pain-out-of-your-tdd | |
@benlovell: https://speakerdeck.com/benlovell/fast-testable-and-sane-json-apis-with-rails-api-et-al | |
@tenderlove: https://speakerdeck.com/tenderlove/brighton-ruby-conf-2014 |
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 Toolbox | |
@tools = {} | |
def self.register(tool) | |
@tools[tool.material] = tool | |
end | |
def self.tool_for(material) | |
@tools.fetch(material) { BareHands } | |
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
# ./config/environments/development.rb | |
config.eager_load = false | |
# ./lib/registry.rb | |
module Registry | |
def self.included(base) | |
base.send(:extend, ClassMethods) | |
end | |
module ClassMethods |
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
defmodule FizzBuzz do | |
def convert_num(0, 0, _), do: "FizzBuzz" | |
def convert_num(0, _, _), do: "Fizz" | |
def convert_num(_, 0, _), do: "Buzz" | |
def convert_num(_, _, n), do: n | |
def fizz_buzz(n) do | |
convert_num rem(n, 3), rem(n, 5), n | |
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
. |
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
<!-- | |
In the template just use the @view object and call it's methods to clean up | |
the presentation logic. Maybe think about adding a helper method called `view` | |
that just returns `@view` so we can remove the noise of the `@`. | |
--> | |
<%= @view.users.each do |user| %> | |
<%= @view.user_link(user) %> | |
<% 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
Originals | |
--------- | |
The Trouble With Tribbles | |
Space Seed | |
Originals Movies | |
---------------- | |
Wrath of Khan | |
Search for Spock | |
Voyage Home |
OlderNewer