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
def select_links(links_array) | |
select_tag :links_select, options_for_select( | |
links_array.map do |name,link| | |
[name, url_for(link)] | |
end, url_for {} | |
), :onchange => "document.location= this.value;" | |
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
# = rfc2047.rb | |
# | |
# An implementation of RFC 2047 decoding and encoding. | |
# | |
# This module depends on the iconv library by Nobuyoshi Nakada, which | |
# I've heard may be distributed as a standard part of Ruby 1.8. Many | |
# thanks to him for helping with building and using iconv. | |
# | |
# Thanks to "Josef 'Jupp' Schugt" <[email protected]> for pointing out an error | |
# with stateful character sets. |
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
namespace :open_flash_chart_lazy do | |
PLUGIN_ROOT = File.dirname(__FILE__) + '/../' | |
# avoid warning in newer version of rails, and stay compatible with older ones | |
rails_root = (Object.const_defined?('Rails') && Rails.respond_to?(:root)) ? | |
Rails.root : RAILS_ROOT | |
desc 'Installs required swf in public/ and javascript files to the public/javascripts directory.' | |
task :install do |
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
irb(main):004:0> Mol::TimeLog.auto_upgrade! | |
DataObjects::SyntaxError: ERROR: syntax error at or near "PRIMARY" | |
LINE 1: CREATE TABLE "time_logs" ( SERIAL PRIMARY KEY, "ttype" VARCH... | |
^ | |
(code: 16801924, sql state: 42601, query: CREATE TABLE "time_logs" ( SERIAL PRIMARY KEY, "ttype" VARCHAR(255), "log" TEXT, "created_at" TIMESTAMP, PRIMARY KEY("id")), uri: postgres://mol:justatest@bzibm/mol?port=&adapter=postgres&fragment=&scheme=postgres&path=/mol&host=bzibm&user=mol&password=justatest&query=) | |
from /comboy/projects/mol/.bunndle/ruby/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `execute_non_query' | |
from /comboy/projects/mol/.bunndle/ruby/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:100:in `create_model_storage' | |
from /comboy/projects/mol/.bunndle/ruby/1.8/gems/dm-migrations-1.1.0/lib/dm-migrations/adapters/dm-do-adapter.rb:98:in `each' | |
from /comboy/projects/mol/.bunndle/ruby/1 |
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
# A/Gemfile | |
gem 'thor' |
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 'json' | |
# put this file in the same dir as namecoind executable | |
JSON.load(`./namecoind name_list`).each do |domain| | |
if domain['expires_in'] < 5000 | |
command = "./namecoind name_update '#{domain['name']}' '#{domain['value']}'" | |
puts command | |
puts `#{command}` | |
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 A | |
class B < A | |
end | |
def foo | |
puts "AMA #{self.class}" | |
end | |
end | |
puts A::B::B::B::B::B::B::B.new.foo # "AMA A::B" |
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
!: | |
|_ [hid=hide ~] | |
++ poke-mars-args | |
|= [ost=bone you=ship *] | |
:_ +>.$ | |
:- [ost %pass / %g %cide %$] | |
:- [ost %give %nice ~] | |
%+ turn (~(tap by sup.hid)) | |
|= [ost=bone *] | |
=- [ost %give %rush %tang -] |
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
/- term-line | |
!: | |
|% | |
++ axle | |
$% [%0 prog=@tas] | |
== | |
++ clay-gift | |
$% [%ergo p=@p q=@tas r=@ud] | |
[%note p=@tD q=tank] | |
[%writ p=riot] |
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
local band = bit.band | |
local bor = bit.bor | |
local rshift = bit.rshift | |
local char = string.char | |
local payload = _G.do_input.payload | |
local opcode = _G.do_input.opcode | |
opcode = opcode or 2 | |
assert(type(opcode) == "number", "opcode must be number") |
OlderNewer