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 }" |
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
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
## 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
class Dice | |
def initialize(sides) | |
@sides = sides | |
end | |
def throw(times) | |
rolls = [] | |
times.times do |c| | |
rolls << rand(@sides) + 1 |
NewerOlder