Skip to content

Instantly share code, notes, and snippets.

@tzengerink
tzengerink / javascript.js
Last active September 1, 2020 09:42
Komoot Questions
/**
* Comments on https://gist.github.com/danielgard/3ee8afe0fc2d6905f7ec82331930ec8f
*
* 1. Arrow functions do not have their own this or arguments object.
* 2. Curly brackets are not needed when there is only a `return` statement
*
* const doubleNumbers = () => { this.arguments.map(a => a * 2) }
*
* 3. A closing `)` bracket is missing
* 4. A newline character is missing at the end of the file
@tzengerink
tzengerink / DeZwaaiendeFietser.md
Last active May 25, 2018 13:57
De Zwaaiende Fietser door F. Starik
@tzengerink
tzengerink / tslint-pre-commit
Created October 10, 2016 07:44
TSLint pre-commit hook
#!/bin/bash
for file in $(git diff --cached --name-only | grep -E '\.ts$')
do
git show ":$file" | tslint "$file"
if [ $? -ne 0 ]; then
exit 1
fi
done

Keybase proof

I hereby claim:

  • I am tzengerink on github.
  • I am tzengerink (https://keybase.io/tzengerink) on keybase.
  • I have a public key whose fingerprint is 6287 D070 5F27 944D 62E3 B3F6 D459 51B1 3602 B995

To claim this, I am signing this object:

@tzengerink
tzengerink / staticbuilder.py
Last active December 3, 2015 10:48
Build static websites using Jinja2 templates and YAML data descriptions
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
STATICBUILDER
=============
Build static websites using Jinja2 templates and YAML data descriptions.
The default directory structure that is needed to build a static site looks
like follows:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Light Tunnel</title>
</head>
<body>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<script type="text/javascript" src="light-tunnel.js"></script>
</body>
@tzengerink
tzengerink / reorganize.py
Last active August 29, 2015 14:16
Store each extension in a directory, in a seperate folder within that directory
#!/usr/bin/env python
'''
REORGANIZE
----------
When your directory looks something like this:
/path/to/dir/photo-1.jpg
/path/to/dir/photo-2.JPG
/path/to/dir/video-1.mp4
@tzengerink
tzengerink / README.md
Last active August 29, 2015 14:10
Serve files in a public S3 bucket downloadable through a different domain

PUBLIC

Make files in a public S3 bucket downloadable through a different domain.

@tzengerink
tzengerink / README.md
Last active August 29, 2015 14:10
Go web application returning the visitors IP address

IP

Go web application returning visitors IP address.

@tzengerink
tzengerink / application.py
Last active August 29, 2015 14:08
Minimal Flask Application
from flask import Flask, request
app = Flask(__name__)
@app.route('/')
def ip():
return request.environ['REMOTE_ADDR'] + '\n'
if __name__ == '__main__':
app.run()