Skip to content

Instantly share code, notes, and snippets.

View jonasschneider's full-sized avatar

Jonas Schneider jonasschneider

View GitHub Profile
$ rails -v
Rails 2.3.5
$ rails bugtest
$ cd bugtest
$ script/generate model Project name:string
$ cat app/models/project.rb
class Project < ActiveRecord::Base
require "sinatra"
require "dalli"
dc = Dalli::Client.new('localhost:11211')
get '/' do
"Value is: " + dc.get('abc')
end
get '/set' do
jonas@titan:~/src$ git clone git://github.com/rails/rails.git
[..]
jonas@titan:~/src$ cd rails/activeresource
jonas@titan:~/src/rails/activeresource$ rake test
(in /home/jonas/src/rails/activeresource)
/home/jonas/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/pathname.rb:263: warning: `*' interpreted as argument prefix
/home/jonas/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/specification.rb:508:in `load': (eval):1:in `read': No such file or directory - /home/jonas/src/rails/activeresource/RAILS_VERSION (Errno::ENOENT)
from (eval):1:in `load'
from /home/jonas/.rvm/gems/ruby-1.8.7-p249/gems/bundler-1.0.0/lib/bundler/dsl.rb:32:in `eval'
from /home/jonas/.rvm/rubies/ruby-1.8.7-p249/lib/ruby/site_ruby/1.8/rubygems/specification.rb:508:in `load'
@jonasschneider
jonasschneider / yoke.js
Created September 1, 2011 16:35 — forked from StanAngeloff/yoke.js
A drop-in, quick and dirty alternative to Sprockets
#!/usr/bin/env node
var fs = require('fs'),
path = require('path'),
stdio = process.binding('stdio'),
options = {
verbose: false,
directories: ['.']
};
<?php
$message = "asdf";
$key = "hallo";
$hash = hash_hmac("sha1", $message, $key);
var_dump($hash);
?>
- def enquote(raw_text)
- text = raw_text.strip
- return "<span class=quotesym>„</span>#{text}<span class=quotesym>“</span>"
.memoir{ :class => defined?(on_show_page) ? 'show' : '' }
%span.number= memoir.number
- if memoir.is_quote?
%p.quote= enquote memoir.quoted_text
%p.quotesource= memoir.person
- elsif memoir.is_dialogue?
>> Momentum running on 0.0.0.0:5555
I, [22:30:30.230279] Connection from: 192.168.1.100
D, [22:30:30.231116] >> "\x80\x02\x00\x01\x01\x00\x01\xDD\x00\x00\x00\x01\x00\x00\x00\x00\x00\x008\xEA\xDF\xA2Q\xB2b\xE0g`\x83\x A4\x17\x06{\xB8\vu0,\xD6\xAE@\x17\xCD\xCD\xB1.\xB45\xD0\xB3\xD4\xD1\xD2\xD7\x02\xB3,\x18\xF8Ps,\x83\x9Cg\xB0?\xD4=:`\a\x81\xD5\x 99\xEB@\xD4\e3\xF0\xA3\xE5i\x06A\x90\x8Bu\xA0N\xD6)NI\xCE\x80\xAB\x81%\x03\x06\xE5\x94T]\x17W\xA0\"\x88\xA5:\xA9y\xBA\xA1\xC1`\x B6\x19\x90\rf\x980\xF0\xA2dQ\x061\xA7\xC4\xE2\xCCd\x85\xC4\\\xCB\xD2\xC8\b_\xB3\xA8\xDC\xA0\xAA\xC8@[[\x06^\x94\x84\xCA\xC0\t\rN [\x03\x066H\x82`\xF0\x01\x16G\xD9z\xC5\xA9\xC5\xA0\xF0\xB2u\x02\xC81\xC3\xDC)+\xDF;2<\xA8$1\xDC$\xD3+$*\xD3/7,\xCB7+\xB0\xD2/+\x DD\xD07\xDC\xB3\xCA7\xD7-\xC3\xD7\xDD/+2+\xD4\xC47$'\xD37+\xD9\xD8\xDF%\xBDJ\xD5\xC0\x91\x81\x05T\x1E1p\x95d\x96$\xE6Y\x99\x02\x
>> Momentum running on 0.0.0.0:5555
I, [22:36:56.066615] Connection from: 192.168.1.100
D, [22:36:56.067240] >> "\x80\x02\x00\x01\x01\x00\x01\xDD\x00\x00\x00\x01\x00\x00\x00\x00\x00\x008\xEA\xDF\xA2Q\xB2b\xE0g`\x83\xA4\x17\x06{\xB8\vu0,\xD6\xAE@\x17\xCD\xCD\xB1.\xB45\xD0\xB3\xD4\xD1\xD2\xD7\x02\xB3,\x18\xF8Ps,\x83\x9Cg\xB0?\xD4=:`\a\x81\xD5\x99\xEB@\xD4\e3\xF0\xA3\xE5i\x06A\x90\x8Bu\xA0N\xD6)NI\xCE\x80\xAB\x81%\x03\x06\xE5\x94T]\x17W\xA0\"\x88\xA5:\xA9y\xBA\xA1\xC1`\xB6\x19\x90\rf\x980\xF0\xA2dQ\x061\xA7\xC4\xE2\xCCd\x85\xC4\\\xCB\xD2\xC8\b_\xB3\xA8\xDC\xA0\xAA\xC8@[[\x06^\x94\x84\xCA\xC0\t\rN[\x03\x066H\x82`\xF0\x01\x16G\xD9z\xC5\xA9\xC5\xA0\xF0\xB2u\x02\xC81\xC3\xDC)+\xDF;2<\xA8$1\xDC$\xD3+$*\xD3/7,\xCB7+\xB0\xD2/+\xDD\xD07\xDC\xB3\xCA7\xD7-\xC3\xD7\xDD/+2+\xD4\xC47$'\xD37+\xD9\xD8\xDF%\xBDJ\xD5\xC0\x91\x81\x05T\x1E1p\x95d\x96$\xE6Y\x99\x02\x01\x03\a\xAC\xDCaPR2KIM\x04f\xFE\xC4T\xE3T`\xC9\x00\xE4\x01s\xBAQ\xAA\x91a\x92e\x8A\xA5\xB9\x85\xA9\xA9\x12\x03[.\xB0\xC4\xCCOa`vw\ra`\x85\xE8\x13L\xAA,I-\xB6\x05\xC8\x
>> Momentum running on 0.0.0.0:5555
I, [22:49:33.632827] Connection from: 192.168.1.100
D, [22:49:33.633485] >> "\x80\x02\x00\x01\x01\x00\x01\xDE\x00\x00\x00\x01\x00\x00\x00\x00\x00\x008\xEA\xDF\xA2Q\xB2b\xE0g`\x83\xA4\x17\x06{\xB8\vu0,\xD6\xAE@\x17\xCD\xCD\xB1.\xB45\xD0\xB3\xD4\xD1\xD2\xD7\x02\xB3,\x18\xF8Ps,\x83\x9Cg\xB0?\xD4=:`\a\x81\xD5\x99\xEB@\xD4\e3\xF0\xA3\xE5i\x06A\x90\x8Bu\xA0N\xD6)NI\xCE\x80\xAB\x81%\x03\x06\xE5\x94T]\x17W\xA0\"\x88\xA5:\xA9y\xBA\xA1\xC1`\xB6\x19\x90\rf\x980\xF0\xA2dQ\x061\xA7\xC4\xE2\xCC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