Skip to content

Instantly share code, notes, and snippets.

View yrashk's full-sized avatar
🎯
Being productive

Yurii Rashkovskii yrashk

🎯
Being productive
View GitHub Profile
id-2:youhelp(master) $ rake spec
(in /Users/yrashk/Projects/SecondLife/youhelp)
Loading init file from /Users/yrashk/Projects/SecondLife/youhelp/config/init.rb
Loading /Users/yrashk/Projects/SecondLife/youhelp/config/environments/development.rb
~ Loaded DEVELOPMENT Environment...
~ loading gem 'merb_helpers' ...
~ loading gem 'uuidtools' ...
~ loading gem 'merb_activerecord' ...
~ loading gem 'activerecord' ...
id-2:youhelp(master) $
~ Connecting to database...
~ Loaded slice 'MerbAuthSlicePassword' ...
~ Parent pid: 14091
~ Compiling routes...
~ Activating slice 'MerbAuthSlicePassword' ...
#! /usr/bin/env ruby
def print_help
puts %{
Generates database migration
Usage:
./script/generate_db_migration add_some_columns
<?
abstract class AbstractParent {
function __construct($param) { print_r($param); }
public static function test() { return new self(1234); }
}
diff --git a/lib/compiler/src/sys_expand_pmod.erl b/lib/compiler/src/sys_expand_pmod.erl
index 24650a5..f7c22ec 100644
--- a/lib/compiler/src/sys_expand_pmod.erl
+++ b/lib/compiler/src/sys_expand_pmod.erl
@@ -87,8 +87,22 @@ function(Name, Arity, Clauses0, St) ->
clauses([C|Cs],St) ->
{clause,L,H,G,B} = clause(C,St),
+ NoBaseParameters = case basep(St#pmod.parameters) of true -> tl(St#pmod.parameters); false -> St#pmod.parameters end,
T = {tuple,L,[{var,L,V} || V <- ['_'|St#pmod.parameters]]},
> Product = #product{name = "My product"}.
> Product:create(DB).
insert(Key, Value, {trie, L}) when is_list(Key), is_list(L) ->
insert_1(Key, Value, L,trie).
insert_1([H|T], Value, [], Val) ->
{Val, [{H, insert_1(T, Value, [], undefined)}]};
insert_1(_Key, Value, [], _) ->
{Value, []};
insert_1([H|T], Value, L, Val) when is_list(L) ->
1> DB = tokyocabinet:tcadbnew().
4298116592
2>
2> tokyocabinet:tcadbopen(DB, "test.tcb#mode=wc").
ok
3> tokyocabinet:tcadbput(DB, <<"hello">>, <<"world">>).
ok
4> tokyocabinet:tcadbget(DB, <<"hello">>).
<<"world">>
5> tokyocabinet:tcadbget(DB, <<"world">>).
@yrashk
yrashk / _.js
Created December 18, 2010 20:39
var msg = require('messaging');
var mbox = new msg.Mailbox();
var mbox2 = new msg.Mailbox();
var namedmbox = new msg.Mailbox("myname");
mbox2.on("info",function(msg) { console.log("mbox2: info: " + msg) });
namedmbox.on("info",function(msg) { console.log("namedmbox: info: " + msg) });
mbox.send(mbox2, "Hello, dude!");