Skip to content

Instantly share code, notes, and snippets.


Evan Kaufman EvanK

  • Washington, USA
View GitHub Profile
EvanK /
Last active February 29, 2020 20:05
Generating static docs for caps-api - like pushing a boulder uphill

Available tooling

Unfortunately, most useful tools for generating static documentation from a swagger spec are no longer maintained or only support swagger's 2.0 format -- we are using the 3.0 format.

The only tool I could find was swagger-codegen, which is built in and requires dependencies in (gag) Java.

Static html

Codegen allows us to generate a single-page static document:

View auth_openidc_vhost.apacheconf
# configuring our local server for auth via Google
OIDCRedirectURI /example/redirect_uri
OIDCCryptoPassphrase some-big-fancy-secret-passphrase
# ensure the provider (Google in this case) gives us the user email
OIDCScope "openid email"
# credentials from the Google API console
EvanK / gist:6d43cb9fa7b9d704d767
Created September 18, 2014 02:56
View gist:6d43cb9fa7b9d704d767
### Keybase proof
I hereby claim:
* I am evank on github.
* I am evanskaufman ( on keybase.
* I have a public key whose fingerprint is A841 C275 E509 6657 3814 0689 6508 E211 586F 8E5A
To claim this, I am signing this object:
EvanK /
Created May 27, 2014 19:56
Deploying specific branch/committish in Capistrano 2 vs 3
# -S key=value
cap staging deploy -S branch=42-super-awesome-feature-branch
EvanK / nope.xml
Created November 19, 2013 22:45
Pro tip: PHPUnit's test suite "exclude" nodes don't do wildcard expansion. Took me longer than I'd like to admit figuring this out.
View nope.xml
<testsuite name="Unit">
EvanK / .gitconfig
Created October 23, 2013 15:57
If you don't have a `.gitconfig` file in your home directory, create it: touch ~/.gitconfig
View .gitconfig
email =
name = The name you want showing up in commits
editor = vi
default = current
EvanK /
Created April 22, 2011 11:22
Perl `basename` and `dirname` module-free implementations
# WHY would we need this? For a situation where loading File::Basename isn't possible
# For example, in a BEGIN block, to tinker with @INC.
sub basename {
my $file = shift;
$file =~ s!^(?:.*/)?(.+?)(?:\.[^.]*)?$!$1!;
return $file;
sub dirname {
EvanK / gist:908834
Created April 7, 2011 21:56
Remove a deleted branch from a remote
View gist:908834
# remove the branch "branch-name" from the remote "origin"
git push origin :branch-name
EvanK /
Created February 2, 2011 21:21
dirname(realpath($SOMEPATH)) in bash
# 1. takes $0 (the currently running script)
# 2. puts it through `readlink -f` to resolve any symlinks
# 3. puts it through `dirname` to remove the filename
working_dir=$(dirname $(readlink -f $0))
# so if i symlink a script from /home/ekaufman/ to /etc/init.d/mything then even if I
# execute /etc/init.d/mything, ${working_dir} will be "/home/ekaufman"
EvanK / gist:793440
Created January 24, 2011 16:12
Remove pre-installed Facebook & Twitter apps from Android
View gist:793440
$ adb shell
# su
# busybox mount -o rw,remount /system
# rm /system/app/Facebook.apk
# pm uninstall com.facebook.katana
# rm /system/app/Twitter.apk
# pm uninstall
# exit