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
diff --git a/Gemfile b/Gemfile | |
index 8d95848..90fb80f 100644 | |
--- a/Gemfile | |
+++ b/Gemfile | |
@@ -2,12 +2,13 @@ source :rubygems | |
# Project requirements | |
gem 'bundler', '>= 0.9.26' | |
-gem 'rack-flash' | |
+gem 'sinatra-flash', :require => 'sinatra/flash' |
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
#!/bin/sh | |
play() { | |
/usr/bin/play -q /usr/share/sounds/gnome/default/alerts/glass.ogg > /dev/null 2>&1 & | |
} | |
mixer() { | |
/usr/bin/amixer sset 'Master',0 $1 > /dev/null 2>&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
# Invoked with : | |
# thin -DR config.ru start | |
# (single, undetached process, oracle Ok) | |
# thin -DR config.ru -s2 start | |
# (two forked processed, oracle error ORA-12154) | |
$LOAD_PATH << File.expand_path(File.dirname(__FILE__)) | |
require 'rack' | |
require 'init.rb' |
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 'daemons' | |
Daemonize.daemonize(File.expand_path('./log.txt'), 'test') | |
require 'oci8' | |
db = OCI8.new('theuser', 'thepassword', 'SID'); | |
db.exec('select * from utilisateurs where id = 74944') do |r| | |
puts r.join(',') |
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
Warning: NLS_LANG is not set. fallback to US7ASCII. | |
I, [2012-01-11T23:16:55.422561 #19184] INFO -- : (0.110660s) SELECT "COLS"."COLUMN_NAME" FROM "ALL_CONSTRAINTS" "CONS", "ALL_CONS_COLUMNS" "COLS" WHERE (("COLS"."TABLE_NAME" = 'UTILISATEURS') AND ("CONS"."CONSTRAINT_TYPE" = 'P') AND ("CONS"."CONSTRAINT_NAME" = "COLS"."CONSTRAINT_NAME") AND ("CONS"."OWNER" = "COLS"."OWNER")) | |
OMG this is gonna fail !! | |
E, [2012-01-11T23:16:55.572218 #19184] ERROR -- : OCIError: ORA-00942: table or view does not exist: SELECT * FROM "DBA_TAB_COLS" WHERE ("TABLE_NAME" = 'UTILISATEURS') | |
In rescue | |
E, [2012-01-11T23:16:55.688581 #19184] ERROR -- : OCIError: ORA-04043: object SOMEWHERE.UTILISATEURS does not exist: Connection.describe_table | |
metadata.c:151:in oci8lib_191.so: OCIError: ORA-04043: object SOMEWHERE.UTILISATEURS does not exist (Sequel::DatabaseError) | |
from /home/leucos/.rvm/gems/ruby-1.9.3-p0@testsequel/gems/ruby-oci8-2.1.0/lib/oci8/metadata.rb:2085:in `describe_table' | |
from /home/leucos/.rvm/gems/ruby-1.9.3-p0@testsequel |
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
My $TERMINAL is set to "gnome-terminal" | |
When introducing a typo in my i3 config, the nagbar is started this way (as seen in processes) : | |
i3-nagbar -t error -m You have an error in your i3 config file! -b edit config i3-sensible-terminal -e sh -c "i3-sensible-editor \"/home/user/.i3/config\" && i3-msg reload" -b show errors i3-sensible-terminal -e i3-sensible-pager "/tmp/i3-user.6swBVu/errorlog.11524" | |
Clicking 'edit config' or 'show errors' spaws a new window that disappear immediately. | |
The problem is that gnome-terminal expects a single argument after '-e', while other terminals are ok with that since -e is the last argument that can appear on their command line. Thus, the whole `sh -c "i3-sensible-editor \"/home/user/.i3/config\"` should be quoted. |
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
diff --git a/examples/app/todolist/controller/init.rb b/examples/app/todolist/controller/init.rb | |
index d5aaa92..3c74fec 100644 | |
--- a/examples/app/todolist/controller/init.rb | |
+++ b/examples/app/todolist/controller/init.rb | |
@@ -2,6 +2,12 @@ module TodoList | |
class Controller < Ramaze::Controller | |
layout :default | |
engine :Etanni | |
+ helper :paginate | |
+ |
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 Domains < MainController | |
def index | |
@title = 'Domains' | |
@domains = Domain | |
@sidebar = render_sidebar | |
end | |
def edit(id) | |
@domain = Domain[id] |
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 Domain < Sequel::Model | |
one_to_many :records | |
def before_destroy | |
Record.filter(:domain_id => id).destroy | |
end | |
end |
OlderNewer