Skip to content

Instantly share code, notes, and snippets.

View pote's full-sized avatar

pote pote

View GitHub Profile
@pote
pote / optimal_hours.rb
Created November 8, 2012 19:19
Simple script to calculate how far from my target hours whenever I want to.
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 }"
go func() {
for i := 1; i < 100; i++ {
fmt.Println(i)
}
}()
go SomeMotherfuckingExpensiveLoop()
go AnotherMotherfuckingLoop()
// app is keep going here...
package main
import "fmt"
import uuid "github.com/nu7hatch/gouuid"
import (
"fmt"
uuid "github.com/nu7hatch/gouuid"
)
@pote
pote / planet.yml
Created May 21, 2012 18:15
default planet.yml file to test planet.rb against different blogging engines
## 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"
@pote
pote / DiceApp.rb
Created October 11, 2009 22:26
Just a simple Dice throwing app - I plan on adding a Shoes GUI later :)
class Dice
def initialize(sides)
@sides = sides
end
def throw(times)
rolls = []
times.times do |c|
rolls << rand(@sides) + 1