Skip to content

Instantly share code, notes, and snippets.

View jhanschoo's full-sized avatar
👋

Johannes Choo jhanschoo

👋
View GitHub Profile
def f(): # returns "bar"
try:
a = "foo"
return a
finally:
a = "bar"
return a
# order of evaluation:
# 3:a = "foo"
# 4:return a -eval-> return "foo"
#!/bin/bash
for FILENAME in "$@"
do
export FILENAME
NEWNAME="$(exiv2 $FILENAME | grep "Image timestamp" | cut -d ' ' -f 4,5 | sed 's/\(.*\) \(.*\)/\1T\2.jpg/')"
# don't forget to quote
if [ "$NEWNAME" != "" ] # equivalent to [ -n "$NEWNAME" ]
then

Keybase proof

I hereby claim:

  • I am jhanschoo on github.
  • I am jhanschoo (https://keybase.io/jhanschoo) on keybase.
  • I have a public key whose fingerprint is 6217 6952 2B39 0F3E 233A 83B5 368D D385 ADA2 A8E4

To claim this, I am signing this object:

This file has been truncated, but you can view the full file.
阿爸 a1'ba4 18137
阿昌族 a1'chang1'zu2 50849
阿斗 a1'dou3 42632
阿飞 a1'fei1 48603
阿富汗 a1'fu4'han4 3461
阿訇 a1'hong1 34432
阿拉伯数字 a1'la1'bo2'shu4'zi4 35937
阿拉伯语 a1'la1'bo2'yu3 30476
阿妈 a1'ma1 16220
阿门 a1'men2 47913
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
;;; emacs.d-personal-init.el --- jhanschoo's customizations for Emacs Prelude
;;; Commentary:
;; Copyright (C) 2015-2016 Johannes Choo <jhanschoo@gmail.com>
;; This file is *NOT* part of GNU Emacs.
;;; Code:
;;define adding multiple elements to a list
(defun add-list-to-list (list-var elements &optional append compare-fn)
"Add each element in ELEMENTS to the value of LIST-VAR if it isn't there yet."
(dolist (item elements)
aurelia -- AureliaEffect
C/C++ -- Microsoft
Debugger for Chrome -- Microsoft
EditorConfig... -- EditorConfig
ESLint -- Dirk Baeumer
Git History -- Don ...
GitLens... -- Eric...
Gruvbox -- Tom Philbin
Path Intellisense -- Christian...
Prettier Now -- Remi...
@jhanschoo
jhanschoo / Contract Killer 3.md
Created January 10, 2019 02:30 — forked from malarkey/Contract Killer 3.md
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

#!/usr/bin/env python3
# this script calculates how likely you are to get at least a new
# 5* adventurer
# assumption: you do not own the rate-up adventurer
# assumption: all pulls in a 10-summon have the same 5* rate
# assumption: when pity breaks occur, they occur on the last draw
# in a 10-fold.
# assumption: we expect that a single summon is performed once
# it is a guaranteed 5*; we do not factor in the cost of that
# single summon