Skip to content

Instantly share code, notes, and snippets.

@fsword
fsword / gist:2885903
Created June 7, 2012 01:16 — forked from feng92f/gist:2849163
google收录的敏感词
def foo
111
rescue
222
ensure
333
end
puts foo # got 111
@fsword
fsword / gist:4161295
Created November 28, 2012 13:29 — forked from acwright/gist:1944639
Sinatra / ActionMailer / Sendgrid / Heroku
require 'sinatra'
require 'action_mailer'
class Mailer < ActionMailer::Base
def contact
mail(
:to => "[email protected]",
:from => "[email protected]",
:subject => "Test") do |format|
format.text
@fsword
fsword / multi_try.erl
Last active December 10, 2015 02:28 — forked from anonymous/multi_try.erl
-module(multi_try).
-export([dothese/1]).
dothese(FuncArray) ->
Me = self(),
lists:foreach(fun(F) -> spawn(fun() -> F(Me) end) end, FuncArray),
spawn(fun() -> timer:sleep(200), Me ! timeout end),
Result = get_result("",length(FuncArray)),
io:format("result: ~p~n", [Result]).