Skip to content

Instantly share code, notes, and snippets.

View sigmike's full-sized avatar

Michaël Witrant sigmike

  • Ouvrages
  • France
View GitHub Profile
# the steps:
When /^I go to the website$/ do
get '/'
end
Then /^there should be a link to the vote page$/ do
response.body.should include("layout")
end
require 'sinatra_app'
require 'hpricot'
# RSpec matchers
require 'spec/expectations'
# Required for RSpec to play nice with Sinatra/Test
require 'spec/interop/test'
require "rack/test"
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.1.1/lib/sinatra/main.rb:9:in `call'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.1.1/lib/sinatra/main.rb:9
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in `require'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.1.1/lib/sinatra.rb:5
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:36:in `polyglot_original_require'
/usr/lib/ruby/gems/1.8/gems/polyglot-0.2.5/lib/polyglot.rb:54:in `require'
./sinatra_app.rb:2
#!/usr/bin/env ruby
require 'rubygems'
require 'mechanize'
require 'pp'
def url_for(path)
base = "http://example.com/"
base + path
end
#########################################################################################################
# I18n French translation for Devise (http://github.com/plataformatec/devise)
# I18n traduction de français pour Devise
#
# Note from author: I'm not a native French speaker.
# Please correct my French under the "For generated views" section.
# (The main section is already corrected.)
# Note de l'autheur: Je ne parle pas beaucoup de français.
# Pourriez-vous corriger mon français au dessous de la section "For generated views",
# s'il vous plait?
CREATE USER '<username>'@'localhost' IDENTIFIED BY '<password>';
CREATE DATABASE IF NOT EXISTS `<database_name>`;
GRANT ALL PRIVILEGES ON `<database_name>`.* TO '<username>'@'localhost';
#!/usr/bin/env ruby
require 'rubygems'
require 'twurl'
begin
Twurl::CLI.run(ARGV.dup)
rescue Timeout::Error
STDERR.puts "Timeout. Retrying..."
retry
@sigmike
sigmike / gist:3127659
Created July 17, 2012 06:37
Locales using a comma as thousand separator
# generated with this command: cd /usr/share/i18n/locales; egrep -l '^thousands_sep +"<U002C>"' *
ar_AE
ar_BH
ar_DZ
ar_EG
ar_IQ
ar_JO
ar_KW
ar_LB
ar_LY
@sigmike
sigmike / gist:3127680
Created July 17, 2012 06:47
Thousand separator of each locale
# Generated with this command: cd /usr/share/i18n/locales; egrep '^thousands_sep ' *
# The value is the unicode character, you can search for them here:
# http://www.fileformat.info/info/unicode/char/search.htm
aa_DJ:thousands_sep ""
ar_AE:thousands_sep "<U002C>"
ar_BH:thousands_sep "<U002C>"
ar_DZ:thousands_sep "<U002C>"
ar_EG:thousands_sep "<U002C>"
ar_IQ:thousands_sep "<U002C>"
ar_JO:thousands_sep "<U002C>"
@sigmike
sigmike / gist:3972886
Created October 29, 2012 10:38
netstat disassembled diff
--- netstat-dump 2012-10-29 11:27:51.242470805 +0100
+++ netstat-changed-dump 2012-10-29 11:27:46.290470752 +0100
@@ -1,5 +1,5 @@
-netstat: file format elf32-i386
+netstat.changed: file format elf32-i386
Disassembly of section .init:
@@ -2089,21 +2089,22 @@