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
Hyrule ~/code/tmp | |
▸ go run scoping.go | |
./scoping.go:14: variable is shadowed during return |
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
gem 'nokogiri', :git => 'git://github.com/sparklemotion/nokogiri.git', :tag => 'v1.6.0' |
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
# Use in subclasses like: | |
# delegate_details :win_ratio, :tanning_time, to: :wrestling_details | |
def self.delegate_details(*attributes) | |
options = attributes.extract_options! | |
association_name = options.fetch(:to) { | |
raise ArgumentError.new "You must specify the name of the details association" | |
} | |
define_method association_name do | |
super() || send("build_#{association_name}") |
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
--- | |
- hosts: web | |
sudo: yes | |
accelerate: true | |
vars: | |
app_dir: "/var/www/the_application_name_goes_here" | |
server_env: | |
RACK_ENV: "production" | |
SSO_SALT: "esta no es la salt de verdad" | |
REDIS_URL: "redis://rest_of_url" |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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 Dice | |
def initialize(sides) | |
@sides = sides | |
end | |
def throw(times) | |
rolls = [] | |
times.times do |c| | |
rolls << rand(@sides) + 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
## Planet.rb default config file, modify it and spawn awesomeness! | |
planet: | |
posts_directory: source/_posts/ | |
templates_directory: source/_layouts/ | |
blogs: | |
- author: "Pablo Astigarraga" | |
feed: "http://blog.poteland.com/atom.xml" | |
image: "http://poteland.com/images/avatars/red_mage.png" |
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
package main | |
import "fmt" | |
import uuid "github.com/nu7hatch/gouuid" | |
import ( | |
"fmt" | |
uuid "github.com/nu7hatch/gouuid" | |
) |
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
go func() { | |
for i := 1; i < 100; i++ { | |
fmt.Println(i) | |
} | |
}() | |
go SomeMotherfuckingExpensiveLoop() | |
go AnotherMotherfuckingLoop() | |
// app is keep going here... |
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 'date' | |
today = Date.today | |
beginning_of_month = Date.parse("#{today.year}-#{today.month}-1") | |
workable_days_until_now = (beginning_of_month..today).reject { |d| d.saturday? || d.sunday? }.count | |
optimum_hours_until_now = workable_days_until_now * 6 | |
puts "Workable days until now: #{ workable_days_until_now }" | |
puts "Optimum hours until now: #{ optimum_hours_until_now }" |
OlderNewer