##Git mergetool.
$ git config --global merge.tool=vimdiff
##vimdiff key mappings.
| type MyStruct struct { | |
| N int | |
| } | |
| n := MyStruct{ 1 } | |
| // get | |
| immutable := reflect.ValueOf(n) | |
| val := immutable.FieldByName("N").Int() | |
| fmt.Printf("N=%d\n", val) // prints 1 |
| import groovy.sql.Sql | |
| def dbUrl = "jdbc:postgresql://localhost/test-db" | |
| def dbUser = "test" | |
| def dbPassword = "test" | |
| def dbDriver = "org.postgresql.Driver" | |
| def sql = Sql.newInstance(dbUrl, dbUser, dbPassword, dbDriver) |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| #Code from http://fmota.eu/, great! | |
| class Monoid: | |
| def __init__(self, null, lift, op): | |
| self.null = null | |
| self.lift = lift | |
| self.op = op | |
| def fold(self, xs): | |
| if hasattr(xs, "__fold__"): | |
| return xs.__fold__(self) |
| # 0 is too far from ` ;) | |
| set -g base-index 1 | |
| # Automatically set window title | |
| set-window-option -g automatic-rename on | |
| set-option -g set-titles on | |
| #set -g default-terminal screen-256color | |
| set -g status-keys vi | |
| set -g history-limit 10000 |
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| """Simple async crawler/callback queue based on gevent.""" | |
| import traceback | |
| import logging | |
| import httplib2 | |
| import gevent |
| [submodule "iostream_callback"] | |
| path = iostream_callback | |
| url = git://gist.github.com/753987.git |