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
<script type='text/javascript'> | |
function rM() {}; | |
rC = ''; | |
rM.prototype = { | |
g: function() { | |
var o = function() {}; | |
var i = 31535; | |
this.c = "c"; | |
this.v = 65257; | |
this.k = 3271; |
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
it: | |
errors: | |
messages: | |
not_found: "non trovato" | |
already_confirmed: "è stato già confermato" | |
not_locked: "non era bloccato" | |
devise: | |
failure: | |
unauthenticated: "Devi accedere o registrarti per continuare." |
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
<?php | |
$id=1; | |
$shared1 = shm_attach(1); | |
$sem = sem_get(1,1); | |
shm_put_var($shared1,1,$id); | |
shm_put_var($shared1,2,$sem); | |
$pid = pcntl_fork(); | |
if ($pid == -1) { | |
die('could not fork'); |
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 Poker | |
def evaluate_cards | |
primitive_operation1 | |
primitive_operation2 | |
end | |
def primitive_operation1 | |
raise "template method called!" | |
end |
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 Poker | |
def initialize(game) | |
@game = game | |
end | |
def evaluate_cards | |
#... | |
@game.primitive_operation | |
#... | |
end |
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
function ss { | |
if [ -e script/rails ]; then | |
script/rails server $@ | |
else | |
script/server $@ | |
fi | |
} | |
function sc { | |
if [ -e script/rails ]; then | |
script/rails console $@ |
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 Logger | |
include Singleton | |
def warning( msg ) | |
#... | |
end | |
end | |
a = Logger.instance |
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
#test | |
class Logger | |
def warning( msg ) | |
#... | |
end | |
end | |
#production | |
class SingletonLogger < Logger | |
include Singleton |
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 "observer" | |
class Currency | |
include Observable | |
def initialize(symbol,rate) | |
@rate = rate | |
@symbol = symbol | |
end |
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 Currency < ActiveRecord::Base | |
end | |
class CurrencyObserver < ActiveRecord::Observer | |
observe :currency | |
def after_update(currency) | |
puts "new rate for #{currency.symbol} : #{currency.rate}" | |
end | |
end |
OlderNewer