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 foo | |
'hi' | |
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
helpers do | |
def h(s) | |
Rack::Utils.escape_html(s) | |
end | |
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
require "rubygems" | |
require "sinatra" | |
get '/' do | |
'hi' | |
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
-module (eh). | |
-compile([export_all]). | |
server() -> | |
{ok, LSock} = gen_tcp:listen(8000, [binary, {packet, 0}, | |
{active, false}]), | |
{ok, Sock} = gen_tcp:accept(LSock), | |
{ok, Bin} = do_recv(Sock, []), | |
ok = gen_tcp:close(Sock), | |
Bin. |
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 "rubygems" | |
require 'rest_client' | |
x = $:.inject([]) do |m, x| | |
d = Dir[x + '/**/*'] | |
m + d.grep(/rest/i) | |
end.join("\n") | |
p x |
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
4> application:start(sasl). | |
ok | |
5> | |
=PROGRESS REPORT==== 12-Aug-2008::13:45:46 === | |
supervisor: {local,sasl_safe_sup} | |
started: [{pid,<0.43.0>}, | |
{name,alarm_handler}, | |
{mfa,{alarm_handler,start_link,[]}}, | |
{restart_type,permanent}, | |
{shutdown,2000}, |
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
cd erts/emulator && ERL_TOP=/root/src/otp_src_R12B-3 make generate depend | |
make[1]: Entering directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make -f i686-pc-linux-gnu/Makefile generate | |
make[2]: Entering directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make[2]: i686-pc-linux-gnu/Makefile: No such file or directory | |
make[2]: *** No rule to make target `i686-pc-linux-gnu/Makefile'. Stop. | |
make[2]: Leaving directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make[1]: *** [generate] Error 2 | |
make[1]: Leaving directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make: *** [depend] Error 2 |
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
cd erts/emulator && ERL_TOP=/root/src/otp_src_R12B-3 make generate depend | |
make[1]: Entering directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make -f i686-pc-linux-gnu/Makefile generate | |
make[2]: Entering directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make[2]: i686-pc-linux-gnu/Makefile: No such file or directory | |
make[2]: *** No rule to make target `i686-pc-linux-gnu/Makefile'. Stop. | |
make[2]: Leaving directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make[1]: *** [generate] Error 2 | |
make[1]: Leaving directory `/root/src/otp_src_R12B-3/erts/emulator' | |
make: *** [depend] Error 2 |
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 Doc | |
def method_missing(m, *args, &block) | |
args.empty? ? options[m] : options[m] = args[0] | |
end | |
def options | |
@options ||= {} | |
end | |
def initialize(&block) | |
self.instance_eval(&block) if 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
helpers do | |
def rest | |
@rest ||= RestClient.new('http://foo.org') | |
end | |
end | |
get '/' do | |
rest.put '/foo' | |
'hey' |
OlderNewer