Skip to content

Instantly share code, notes, and snippets.

View voondo's full-sized avatar

Romain Lalaut voondo

View GitHub Profile
@voondo
voondo / scaleway-inventory.rb
Created February 19, 2016 11:11
Scaleway ansible dynamic inventory
#!/bin/ruby
require 'json'
require 'optparse'
require 'net/http'
require 'pry'
require 'yaml'
auth_token = ENV['SCALEWAY_AUTH_TOKEN']
uri = URI('https://api.scaleway.com/servers')
<%= simple_form_for [parent, resource], html: {class: "form-horizontal"} do |f| %>
[...]
<%= f.simple_fields_for :master do |p| %>
<%= p.input :price, as: :currency %>
<%= p.input :description, input_html: {style: "height: 8em"} %>
<% end %>
@voondo
voondo / timer.rb
Created November 30, 2011 18:02 — forked from glejeune/timer.rb
A very very simple timer
require 'rubygems'
require 'eventmachine'
class Timer
def initialize
@run = false
@timeout_proc = nil
end
# Run <tt>blk</tt> every <tt>every</tt> seconds during <tt>during</tt> seconds