This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 = [email protected] | |
email.host = mail.gmail.com | |
email.login = true |
This file contains hidden or 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 hidden or 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 hidden or 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 |
This file contains hidden or 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 tiny framework simply makes nil comparable, such that | |
# all things (except itself) are greater than it. | |
# | |
# The main effect is this: | |
# | |
# nil <=> any_object #=> -1 | |
# | |
# To enable a class to compare against nil (reverse of the above), | |
# simply prepend a nil comparsion into the #<=> method of that class. | |
# For example: |
This file contains hidden or 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
if [ -z $installdir ]; then | |
installdir="/opt/ActiveTcl-8.5" | |
fi | |
if [ ! -d "$installdir" ]; then | |
echo "Installing ActiveTcl8.5.10..." | |
echo "IMPORTANT: Be sure to use the default settings in the install dialog." | |
wget http://downloads.activestate.com/ActiveTcl/releases/8.5.10.1/ActiveTcl8.5.10.1.295062-linux-x86_64-threaded.tar.gz | |
tar -xf ActiveTcl8.5.10.1.295062-linux-x86_64-threaded.tar.gz |