Skip to content

Instantly share code, notes, and snippets.

View boskoop's full-sized avatar

Christian Bürgi boskoop

View GitHub Profile
@boskoop
boskoop / keybase.md
Created January 18, 2015 22:29
keybase.md

Keybase proof

I hereby claim:

  • I am boskoop on github.
  • I am buergich (https://keybase.io/buergich) on keybase.
  • I have a public key whose fingerprint is 390C 9A37 30EB 0FCA 9595 9550 3459 0E69 DFE7 89E7

To claim this, I am signing this object:

@boskoop
boskoop / gist:885854a911b83d1640d2
Last active August 29, 2015 14:07
Git config pretty cli history
git config --global alias.hist "log --graph --decorate --date=iso --abbrev-commit --all --pretty=format:'%C(red)%h%C(reset) - %C(yellow)%d%C(reset) %s - %C(white)%ad%C(reset) %C(cyan)<%an>%C(reset)'"
@boskoop
boskoop / cloudflarechallenge-proof
Last active August 29, 2015 13:59
My proof for the CloudFlare HeartBleed challenge (https://www.cloudflarechallenge.com/heartbleed)
# How I created the signature (cloudflare.pem is the private key):
$ echo "Proof I have the CloudFlare key. @buergich" | openssl sha1 -sign cloudflare.pem -sha1 | openssl enc -base64
TCUrfUggTYWPwZweiUy0B61ep7yCSH3mLO7pLqST7DLctifKaRe4cAl85qf7nC/+
qJwJ01VXfI6+LnaMAcsNNVc3tqbxj4cUSAaWschMB8iBSByWpXDaszjy7sEcreJ3
y/w3u5BHKEnHjEuaTms8tHzEGbUYNz/QZ9DTf1h1GFuK91dVl2XmT/uRWlPzm0XA
fK0kghDJxP16qDoiVaggnQeTFuGTLP4eQTetafsleJNtJX3munHrBV9CJnVLu1cR
+yqYDpFW+CRkQLl5zGekbU+QH9syOF++Cb1+eRIDjlUgVuspHHxT/HkNsGAdKkqt
dGIp2jjLNCTIS1o5DAhInQ==
# In order to verify this, follow the following procedure:
@boskoop
boskoop / gist:4665324
Last active December 11, 2015 21:49
Found some pretty ugly code today. Why on earth would you implement your own boolean implementation in Java? This just confuses and suggests that there might be some special case which needs special attention. There might be some issues with auto-boxing too (NullPointer), but let's just assume that this has been checked previously.
// ------------------------------------------------------------------
// Original version -> UGLY!
// notifier.getNotificationSent() returns a java.lang.Boolean
YesNoEnum notificationSent = notifier.getNotificationSent() ? YesNoEnum.YES : YesNoEnum.NO;
// Execute if no notification was sent
if (notificationSent == YesNoEnum.NO) {
// do some stuff
}