Skip to content

Instantly share code, notes, and snippets.

@wmhilton
wmhilton / mergelog.py
Created Dec 9, 2015 — forked from seanh/mergelog.py
A custom merge driver for git, for automatically merging my 'log.txt' file in a simplistic way.
View mergelog.py
#!/bin/env python
"""mergelog
This is a custom merge driver for git. It should be called from git
with a stanza in .git.config like this:
[merge "mergelog"]
name = A custom merge driver for my log.txt file.
driver = ~/scripts/mergelog %O %A %B %L
recursive = binary
View comma-first-var.js
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
View example.tex
\documentclass{jhwhw}
\author{Christopher S. Corley}
\title{Class homework solutions}
\date{October 19, 2011}
\begin{document}
\problem{Some problem name}
blahblah
\solution
@wmhilton
wmhilton / upsert.sql
Created Nov 9, 2015 — forked from KyleGobel/upsert.sql
Insert/Update Upsert Trigger in Postgres
View upsert.sql
CREATE OR REPLACE FUNCTION upsert_user()
RETURNS trigger AS
$upsert_user$
declare
existing record;
begin
if (select EXISTS(select 1 from users where user_id = NEW.user_id)) then
select user_name, user_class, user_age into strict existing from users where user_id = new.user_id;
@wmhilton
wmhilton / index.html
Last active Aug 29, 2015 — forked from NPashaP/.block
UI for editing tree graph structures
View index.html
<!DOCTYPE html>
<!-- Written by William Hilton -->
<!-- Derived from the "Graceful Tree Conjecture" by NPashaP @ https://gist.github.com/NPashaP/7683252 -->
<head>
<meta charset="utf-8" />
<!-- This is for the trash bin icon. -->
<link href="http://netdna.bootstrapcdn.com/font-awesome/4.1.0/css/font-awesome.min.css" rel="stylesheet" />
<style>
.oval-box {
background: white;