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
# /home/bob/env | |
# USER=bob | |
# PASS=secret | |
docker run --env-file /home/bob/env -p 80:80 some/image | |
# Which is equivalent to: | |
docker run -e USER=bob -e PASS=secret /path/to/file -p 80:80 some/image |
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
def foo([head | *something*]) when head * 2 < *last* do | |
some return value | |
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
Name: Performance#description should replace an obscene description with an innocent one | |
Type: Failure Message: | |
expected: "Me performing care bear on my teddy", | |
got: "Me performing cunillingus on my teddy" | |
Name: Performance#title should replace an obscene title with an innocent one | |
Type: Failure Message: | |
expected: "care bear", | |
got: "fingerfuckers" (using ==) ./spec/wired/app/models/performance_spec.rb:763: | |
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
beans = [:arabica, :robusta] | |
beans.reject { |type| type == :robusta } | |
beans.flatten! | |
beans.compact! | |
espresso = beans.inject(:steam) {} | |
frapuccino = ([[:milk]] << [espresso]).freeze | |
frapuccino.take_while { |cup| !cup.empty? } |
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
<emotionml xmlns="http://www.w3.org/2009/10/emotionml" | |
xmlns:classifiers="http://www.example.com/meta/classify/" | |
xmlns:origin="http://www.example.com/meta/local/" | |
category-set="http://www.example.com/emotion/category/everyday-emotions.xml"> | |
<info> | |
<classifiers:classifier classifiers:name="GMM"/> | |
</info> | |
<emotion> | |
<intensity value="1"/> |
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 FbappController < ApplicationController | |
helper :google_optimizer | |
skip_before_filter :invitation_or_login_required, :only => [:index] | |
layout 'fb_app' | |
def index | |
if @user | |
return redirect_to '/fb_error' | |
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 InviteController < ApplicationController | |
helper :google_optimizer, :content, :competitions, :deals | |
include ContentHelper | |
skip_before_filter :invitation_or_login_required, :only => [ :index, :invite_deal, :invite_competition] | |
def index | |
######################################### | |
## Generic links |
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
<p> | |
<span class="black-txt"><b>Programme Benefits</b></span><br /> | |
<span class="black-txt">• High conversion rate and average spend (£77) per customer</span><br /> | |
<span class="black-txt">• Fantastic widget feeds and creatives to display on your website</span><br /> | |
<span class="black-txt">• Comprehensive Affiliate management from 7thingsmedia</span><br /> | |
</p> | |
<p> | |
<span class="black-txt">• £2.50 fixed fee commission for first customer sales</span><br /> | |
<span class="black-txt">• 10% commission of sale value on first customer sales</span><br /> |
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
>> d.wordpress_deal.merchant_value | |
=> 37.05 | |
>> d.wordpress_deal.merchant_value * 100 | |
=> 3705.0 | |
>> (d.wordpress_deal.merchant_value * 100).to_i | |
=> 3704 | |
>> |
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
# Rails 2 routing | |
# | |
map.resource :city, :as => ":city" do |city| | |
city.login 'login', :controller => 'cities', :action => 'login' | |
city.resources :orders, :only => [ :show, :update ] | |
end | |
# city_login /:city/login {:controller=>"cities", :action=>"login"} | |
# | |
# city_order GET /:city/orders/:id(.:format) {:controller=>"orders", :action=>"show"} |
OlderNewer