Skip to content

Instantly share code, notes, and snippets.

The basic layout of my typical Gruntfile.coffee is as follows

module.exports = (grunt) ->
  grunt.initConfig
    pkg:
      grunt.file.readJSON 'package.json'
    
    coffee:
      compile:

files:

Set up a Git that authenticates over SSH

git init
# Set up the initial Git structure

git remote add origin ssh://git@github.com/<username>/<repo>.git
# Have Git connect to Github over SSH

Next, add your SSH key in the Github settings

Setting up a star rating system is easy. First set up a html form as follows.

  <form>
    ...
    <div>
      <i class='icon-star-empty input-rating' data-value='1'></i>
      <i class='icon-star-empty input-rating' data-value='2'></i>
      <i class='icon-star-empty input-rating' data-value='3'></i>
      <i class='icon-star-empty input-rating' data-value='4'></i>

In this world, people are knowingly committing offenses all the time. Often they have a rather clear indication of the penalty involved in case they would be caught in action. For them, the decision to commit the offense is based on a two-sided economic assessment. On the one hand people consider the expected gains that are obtained by committing the offense; on the other hand they assess cost of punishment. Naturally, the cost of punishment is for the most part determined by the probability of getting caught, and the penalty in case of getting caught. The penalty of getting caught does not just refer to a financial penalty, but also to factors such as loss of face.

##Prospect theory In 1979, Daniel Kahneman and Amos Tversky launched a model called prospect theory in their paper [Prospect Theory: an Analysis of Decision Under Risk](http://www.google.nl/url?sa=t&amp;rct=j&amp;q=prospect%20theory%3A%20an%20analysis%20of%20decision%20under%20risk&amp;source=web&amp;cd=3&amp;ved=0CEQQFjAC&amp;url=http%3A%2F%2Fwww.princeton.edu%2F~kah

@teisman
teisman / Cloaked performance metrics.md
Created January 13, 2013 13:16
Discussion about bonuses and incentives

Executive compensation generally consists of a base salary, bonuses and other benefits. This article digs into the problems with existing executive bonuses, and suggests a general solution to these problems. In this discussion I will ignore the type of compensation; whether it is cash or stock options or anything else, the basic concepts in the discussion still hold.

##Executive bonus Performance bonuses are intended to motivate executives to reach organizational objectives. In general, organizational objectives are thoroughly formulated, such that great clarity is provided on the expectations of executives. Executives then receive a bonus based on the extent to which they achieve the formulated objectives. The measurement of executives' effectiveness in achieving these goals may be done in a number of ways, ranging from the use of predefined metrics to judgements by the board of directors.

##Performance metrics In case the bonus is appointed according to metrics, it is often clear to the executive what me

In many cases, ISPs block port 25 because of spam related issues. In case you want to connect to your server over SMTP - which uses port 25 - you might want to have your iptables firewall forward a port of your choice to port 25.

iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 587 -j REDIRECT --to-port 25

This preroutes port 587 to 25. Now, you can connect to your SMTP server over port 587.

@teisman
teisman / TOR API.md
Last active December 11, 2015 02:58
Using XML-RPC to interact with the TOR bookings API.

Using XML-RPC to interact with the TOR bookings API.

#!/usr/bin/env python
import xmlrpclib
from datetime import date

url = 'http://www.texel.net/xmlrpc/'
username = '<username>'
password = '<password>'
today = date.today().isoformat()

Capital taxation is great. In the Netherlands, there is a strange capital tax scheme though. In 2001, lawmakers revised the Dutch laws on income taxation. In the new law, it was agreed upon to set a capital income tax of 30%. Lawmakers made the assumption that annual return on capital would be around 4%, and thus came up with the idea to set a tax of 1.2% (at which they arrived by taking 30% of 4%) on a citizen's average capital.

There are two reasons why I oppose such a scheme. First, a fixed tax on capital works pro-cyclic. Second, such a tax scheme favors the very wealthy.

##Pro-cyclic tendencies It is pretty obvious that having capital tax costs that are quite steady over time, means that the tax burden relative to income increases in times of economic downturn, and falls in times of economic growth. Let's focus on what happens during economic decline. As the relative tax burden increases, consumers have less money to spend. The reduced spending in turn further depresses economic activity. These effec

@teisman
teisman / vimrc.md
Created January 20, 2013 18:24
Some VIM configuration settings

Some VIM configuration settings

##HTML

" Highlight matching brackets
set matchpairs+=<:>

" Pressing space upon typing '</' will autocomplete the closing tag
filetype plugin on

:iabbrev

##Common identifiers

  • M = # words
  • V = # unique words
  • C = # characters
  1. Number of blank lines/total number of lines
  2. Average sentence length
  3. Average word length
  4. Vocabulary richness V/M
  5. Total number of function words/M