I hereby claim:
- I am sikachu on github.
- I am sikachu (https://keybase.io/sikachu) on keybase.
- I have a public key whose fingerprint is 7270 8199 79B1 6AD7 0571 6B7B 889C 472F 2DA2 8377
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
using terms from application "Colloquy" | |
on process outgoing chat message m | |
set messageBody to body of m as string | |
if messageBody starts with ">" then | |
set HTML of m to "<font color=\"green\">" & messageBody & "</font>" | |
end if | |
end process outgoing chat message | |
end using terms from |
require "benchmark/ips" | |
hash = Hash.new | |
Benchmark.ips do |x| | |
x.report("fetch") { x = hash.fetch(:foo, "bar") } | |
x.report("fetch block") { x = hash.fetch(:foo) { "bar" } } | |
x.report("[]") { x = hash[:foo] || "bar" } | |
end |
puts "Hello world :)" |
#!/bin/sh -e | |
### BEGIN INIT INFO | |
# Provides: starling | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Start/stop starling server | |
### END INIT INFO | |
# | |
# starling This init.d script is used to start starling. | |
# It basically just calls starling. |
require 'rubygems' | |
require 'hpricot' | |
require 'iconv' | |
require 'time' | |
require 'builder' | |
require 'active_support/ordered_hash' | |
include ActiveSupport | |
THAI_MONTHS = [nil] + %w(มกราคม กุมภาพันธ์ มีนาคม เมษายน พฤษภาคม มิถุนายน กรกฎาคม สิงหาคม กันยายน ตุลาคม พฤษจิกายน ธันวาคม) |
# string_format_with_strftime_extension.rb | |
# | |
# Provide extension for String's % method to call Time%strftime when given argument | |
# is a Time object. So we can do <tt>"%d/%m/%Y" % Time.now</tt> and get the same | |
# result as <tt>Time.now.strftime "%d/%m/%Y"</tt> | |
# | |
# Put this file in #{RAILS_ROOT}/config/initializers so it will be automatically loaded. | |
class String | |
alias_method :format_without_strftime_extension, :% |
e() { | |
TMPROJ=`ls -1 *.tmproj 2>/dev/null` | |
if [ ! $TMPROJ = "" ]; then | |
osascript -e "tell application \"TextMate\" | |
open \"${PWD}/${TMPROJ}\" | |
activate | |
end tell" | |
else if [ "$1" = "" ]; then | |
mate "." | |
else |
require 'rubygems' | |
require 'active_support' | |
numbers = "%04d" % rand(9999) | |
available_colors = %w(#FF0080 #0080FF #408000 #FF8000 #FF6666 #6666FF #FF6FCF #800080 #FFCC66 #0000FF #FF0000) | |
colors = available_colors.shuffle[0,5] | |
y_points = [rand(10) + 20, rand(20), rand(20) + 30, rand(10) + 25, rand(20) + 15, rand(20) + 20] | |
`convert -size 135x50 xc:white \ | |
-fill "#{colors[0]}" -stroke "#{colors[0]}" -strokewidth 1 -family TimesNewRoman -pointsize #{rand(25) + 25} \ |
def set_cookie(request, options) | |
if request.cookie_jar[@key] != options[:value] || !options[:expires].nil? | |
request.cookie_jar[@key] = options | |
end | |
end |