Skip to content

Instantly share code, notes, and snippets.

🦄
about to pupate

Daniel Reynaud dreynaud

🦄
about to pupate
View GitHub Profile
@dreynaud
dreynaud / error-handling.md
Last active Jun 23, 2020
Error Handling in Practice
View error-handling.md

Error Handling in Practice

My experience is mostly with Java backend services in the cloud, so the advice in this post will almost certainly be biased towards this kind of error handling. But hopefully, some of it will be generally applicable and help you maintain and debug your programs in the long run.

I don't claim that these are universal best practices, but I have found these to be useful as general guidelines. As always, use your best judgment and do things that make sense in your context.

Log the whole thing

In Java, a full exception is:

@dreynaud
dreynaud / less-cheatsheet.md
Last active Jun 6, 2020 — forked from glnds/less-cheatsheet.md
Less Cheatsheet
View less-cheatsheet.md

Using less to navigate log files

Navigation
F follow output
ctrl+c stop following output
z forward one window
w backward one window
G go to the end of file
g go to the start of file
View keybase.md

Keybase proof

I hereby claim:

  • I am dreynaud on github.
  • I am dreynaud (https://keybase.io/dreynaud) on keybase.
  • I have a public key ASDVeZfLi6A_AMwta1CW_smZxiVukINjTGMTZwvzN5wsFQo

To claim this, I am signing this object:

@dreynaud
dreynaud / simulate.py
Last active Aug 29, 2015
Hearthstone deck drawing sampler
View simulate.py
import random
num_samples = 10 ** 6
def make_deck(special_cards):
assert(isinstance(special_cards, list))
assert(len(special_cards) <= 30)
thelist = special_cards
You can’t perform that action at this time.