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
begin | |
response = call_api # this might throw X | |
response.save_to_db # this might throw Y | |
rescue X | |
# handle the error with calling the api | |
rescue Y | |
# handle the error with saving to the database | |
rescue Exception => e | |
# handles *any* exception; maybe you got the exception type wrong? | |
end |

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
diff --git a/lib/lex.go b/lib/lex.go | |
index 885ec08..8242d5a 100644 | |
--- a/lib/lex.go | |
+++ b/lib/lex.go | |
@@ -404,7 +404,8 @@ func lexNumber(l *lexer) stateFn { | |
imaginary := l.accept("i") | |
r := l.next() | |
if isAlphaNumeric(r) { | |
- return lexErrorf("unexpected alphanum in lexNumber: %c", r) | |
+ l.keep(r) |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"net/http/httputil" | |
"os" | |
"strings" | |
"unicode" |
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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
"net/http/httputil" | |
"os" | |
"strings" | |
"unicode" |
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
jorelli@ETSYNY-L645[0] /projects/moon: cat ex.moon | |
# ------------------------------------------------------------------------------ | |
# example config format | |
# | |
# this is a working draft of things that are valid in a new config language to | |
# replace json as a config language for Go projects. | |
# | |
# comments are a thing now! | |
# ------------------------------------------------------------------------------ |
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
[ | |
{ | |
"create_date": 1429079065, | |
"dataset_name": "ShopHome_RecentFavorites", | |
"hostname": "datasets01.ny5.etsy.com", | |
"load_id": 23278596676, | |
"replicant": 0, | |
"shard": 0, | |
"status": "ready-to-load", | |
"update_date": 1429079065, |
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
#!/usr/bin/env ruby | |
# workaround-upstart-snafu | |
# | |
# When lied to about the behavior of a job’s main process wrt. forking with the | |
# “expect” stanza, Upstart can get into a confused state where it’s tracking a | |
# nonexistent pid. | |
# | |
# This hack creates new short-lived processes until one gets the pid in | |
# question, then has its parent die so that it’s going to get reaped by pid 1 |
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
# ------------------------------------------------------------------------------ | |
# Cluster config | |
# ------------------------------------------------------------------------------ | |
default_network: { | |
name: "default" | |
servers: ["localhost:9991"] | |
ssl_ca: "/etc/pki/logstash/lumberjack_development.crt" | |
timeout: 180 | |
} |
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
# Server | |
redis_version:2.6.14 | |
redis_git_sha1:00000000 | |
redis_git_dirty:0 | |
redis_mode:standalone | |
os:Linux 2.6.32-431.11.2.el6.x86_64 x86_64 | |
arch_bits:64 | |
multiplexing_api:epoll | |
gcc_version:4.4.6 | |
process_id:31144 |