{
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Events API Schema",
"definitions": {
"event_collection": {
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
defmodule SafeTask do | |
def async(func) do | |
safe_func = fn -> | |
try do | |
{:ok, func.()} | |
rescue | |
e -> {:error, e} | |
catch | |
:exit, x -> {:exit, x} | |
t -> {:throw, t} |
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
[ | |
{"desc": "Abkhaz", "code": "ab"}, | |
{"desc": "Afar", "code": "aa"}, | |
{"desc": "Afrikaans", "code": "af"}, | |
{"desc": "Akan", "code": "ak"}, | |
{"desc": "Albanian", "code": "sq"}, | |
{"desc": "Amharic", "code": "am"}, | |
{"desc": "Arabic", "code": "ar"}, | |
{"desc": "Aragonese", "code": "an"}, | |
{"desc": "Armenian", "code": "hy"}, |
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
# router.ex | |
defmodule Myapp.Router do | |
use Myapp.Web, :router | |
pipeline :api do | |
plug :accepts, ["json"] | |
end | |
scope "/", Myapp do | |
pipe_through :api |
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
# test/myapp_test.exs | |
defmodule MyAppTest do | |
use ExUnit.Case | |
test "the truth" do | |
IO.inspect self | |
assert 1 + 1 == 2 | |
end | |
test "the whole truth" do |
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
### Keybase proof | |
I hereby claim: | |
* I am gamache on github. | |
* I am gamache (https://keybase.io/gamache) on keybase. | |
* I have a public key ASApD3qhoE9_IY1NmZwNBQgR9Rs1_DrrYoSw7eQkd1F3Wgo | |
To claim this, I am signing this object: |
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
### Keybase proof | |
I hereby claim: | |
* I am gamache on github. | |
* I am gamache (https://keybase.io/gamache) on keybase. | |
* I have a public key whose fingerprint is 1E3A D3A7 A62D 5CEE 5EFE C0AB 1C59 EDEE 13C6 C4F9 | |
To claim this, I am signing this object: |
This worked for me.
- Change the first line of
/usr/local/Library/brew.rb
to:#!/usr/bin/env ruby
. cd $(brew --repository)
git commit -am 'use env ruby'
.OLD_REF = $(git log | head -1 | sed 's/commit //')
git reset --hard HEAD^
git checkout $OLD_REF
brew update
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
$ ruby --version | |
ruby 2.1.0dev (2013-10-13 trunk 43273) [x86_64-darwin13.0.0] | |
$ ruby method-cache-test.rb | |
user system total real | |
defined methods, not busting cache: | |
0.310000 0.010000 0.320000 ( 0.311989) | |
method_missing dispatch, not busting cache: |
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
$ ruby --version | |
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin12.3.0] | |
$ ruby method-cache-test.rb | |
user system total real | |
defined methods, not busting cache: | |
0.270000 0.000000 0.270000 ( 0.273828) | |
method_missing dispatch, not busting cache: |
NewerOlder