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
[contact] | |
email.account = transfile@gmail.com | |
email.host = mail.gmail.com | |
email.login = true |
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 Email | |
attr :headers | |
attr :body | |
def initialize | |
@headers = Multimap.new | |
@body = "" | |
end | |
def parse(io) |
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 Array | |
def zip(a, &b) | |
if b | |
r = [] | |
bs = lambda{ |x| r << b.call(*x) } | |
super(a, &bs) | |
return r | |
else | |
super(a) |
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: This code was part of Ruby Facets standard library, but | |
# it has been deprecated in favor of more sophisticated | |
# implementations, such as the `instance` and `mirror` gems. | |
module ObjectSpace | |
# Reflection ensures that information about an object | |
# is actual according to Ruby's Kernel definitions, just | |
# in case such methods have been overridden. | |
# |
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
export ROOTPATH="$PATH" | |
function cd() { | |
builtin cd "$@" | |
for f in ./bin/* | |
do | |
export PATH="$f:$ROOTPATH" | |
done | |
} |
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
# Crypt3 | |
# | |
# A ruby version of crypt(3), a salted one-way hashing of a password. | |
# | |
# The Ruby version was written by Poul-Henning Kamp. | |
# | |
# Copyright (c) 2002 Poul-Henning Kamp | |
# | |
# Adapted by guillaume__dot__pierronnet_at__laposte__dot_net based on | |
# * http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/325204/index_txt |
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 SimpleCodeGenerator | |
def self.identities | |
@identities ||= [] | |
end | |
def self.identity(&block) | |
identities << block | |
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
{ "!records": [ | |
{ "!record": { | |
"game": { "!game &001": { | |
"date": {"!!date": "March 2, 1962"}, | |
"versus": "New York" | |
}}, | |
"notes": "!!! Awesome !!!", | |
"number": 100, | |
"player": { "!player &002": { | |
"name": "Wilt Chamberlain", |
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
{{! this is a specific (dummy) page with a menu in the 'portal' application}} | |
{{. portal/prototypes/menuPage.html}} | |
{{=pageId}}aboutMe{{/pageId}} | |
{{=pageTitle}} | |
{{#i18n}}aboutMe.title{{/i18n}} | |
{{/pageTitle}} | |
{{=pageContent}} | |
{{#i18n}}aboutMe.title{{/i18n}} |
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 'benchmark' | |
# Each | |
Benchmark.bmbm do |x| | |
n = 1000000 | |
a = ('a'..'z').to_a | |
x.report("each") do | |
n.times { a.each{ |e| e } } | |
end |
NewerOlder