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
<!-- NOTE: some OPTIONS snipped --> | |
<h1>New Post</h1> | |
<form action="/posts/new" method="post"><div style="margin:0;padding:0;display:inline"><input name="authenticity_token" type="hidden" value="8/3HcKSLX+nP/IsAxQ1hEm9/KkdUHfZqJq3P92ny/28=" /></div> | |
<select id="post_comments_1_appears_at_1i" name="post[comments][1][appears_at(1i)]"> | |
<option value="2004">2004</option> | |
</select> | |
<select id="post_comments_1_appears_at_2i" name="post[comments][1][appears_at(2i)]"> |
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
ubuntu 9.04 | |
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] | |
gem 1.3.5 | |
rspec 1.2.8 | |
rspec-rails 1.2.8 | |
*** LOCAL GEMS *** | |
rails (2.3.3, 2.3.2) | |
Installed at (2.3.3): /usr/lib/ruby/gems/1.8 | |
(2.3.2): /usr/lib/ruby/gems/1.8 |
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
ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux] | |
gem 1.3.5 | |
rspec 1.2.7 | |
rspec-rails 1.2.7.1 | |
rails 2.3.3 | |
test-unit 2.0.3 | |
ZenTest 4.1.3 | |
cucumber 0.3.90 | |
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
# access_control :DEFAULT => '!guest' | |
# [:new, :create, :update, :edit] => '(admin | user | moderator)', | |
# :delete => 'admin & (!moderator & !blacklist)' | |
# 'admin & !(blacklist | moderator)' | |
# '(admin | moderator) & blacklist', | |
# '(admin) & (moderator & ((user | school)))' | |
grammar AclGrammar | |
rule roles | |
('('? (not / and / or / role) ')'?)+ |
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
-module(e224). | |
-compile(export_all). | |
%-export([start/0]). | |
%-define(LIM, 75000000). | |
-define(LIM, 75000000). | |
%% 7500 -> 311 ? 419 ? | |
%-- http://projecteuler.net/index.php?section=problems&id=224 |
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 'rubygems' | |
require 'couchrest' | |
db = CouchRest.database!("http://127.0.0.1:5984/loans") | |
db.recreate! | |
doc1 = db.save_doc({:loan_amount => 40000, :loan_period => 4}) | |
doc2 = db.save_doc({:loan_amount => 20000, :loan_period => 2}) | |
doc3 = db.save_doc({:loan_amount => 50000, :loan_period => 9}) |
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/app/controllers/admin/blogs_controller.rb b/app/controllers/admin/blogs_controller.rb | |
index ca3cdf2..390b53b 100644 | |
--- a/app/controllers/admin/blogs_controller.rb | |
+++ b/app/controllers/admin/blogs_controller.rb | |
@@ -1,4 +1,4 @@ | |
-require 'application' | |
+require 'application_controller' | |
module Admin | |
class BlogsController < ::ApplicationController | |
# GET /blogs |
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
cmd: bonnie++ -f | |
Ext4 on SSD | |
----------- | |
Version 1.03c ------Sequential Output------ --Sequential Input- --Random- | |
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- | |
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP | |
volcano.local 7G 54663 14 34749 13 98851 20 3694 21 | |
------Sequential Create------ --------Random Create-------- | |
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- |
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
-module(freq). | |
-export([main/0]). | |
freq(B) when is_binary(B) -> | |
Arr = array:new([{size,256}, {fixed,true}, {default,0}]), | |
freq(B, Arr). | |
freq(<<>>, Arr) -> Arr; | |
freq(<<B:8,Rest/binary>>, Arr) -> | |
Old = array:get(B, Arr), |
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
#!/usr/bin/ruby | |
# | |
# fetch new torrents from torrents.ru | |
# and display them as notifications | |
$KCODE='u' | |
require 'jcode' | |
require 'rubygems' | |
require 'net/http' |