Skip to content

Instantly share code, notes, and snippets.

View robdaemon's full-sized avatar

Robert Roland robdaemon

View GitHub Profile
@robdaemon
robdaemon / 50-synaptics.conf
Created June 12, 2014 23:50
My Synaptics config for a ThinkPad W540 on Xubuntu 14.04. This goes into /etc/X11/xorg.conf.d - you should create the folder if it doesn't exist.
Section "InputClass"
Identifier "nathan touchpad catchall"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Driver "synaptics"
# three fingers for the middle button
Option "TapButton3" "2"
# drag lock
Option "LockedDrags" "1"
@robdaemon
robdaemon / asciidoctor-diagram
Last active August 29, 2015 14:05
mixing asciidoctor-diagram and images into a single document
asciidoctor-diagram allows you to mix a diagram into your doc, but GitHub doesn't render it inline. Instead, you can do this:
----
ifdef::env-github[]
image::diagram.png[]
endif::[]
ifndef::env-github[]
["plantuml", "diagram", "png"]
-----------------------------------------------
title My Diagram
@robdaemon
robdaemon / gist:7132765ca20586f92b2e
Created September 24, 2014 04:19
Strangeloop talks
Our shared joy of programming: https://www.youtube.com/watch?v=3_zW63dcZB0
The mess we're in: https://www.youtube.com/watch?v=lKXe3HUG2l4
Programming should eat itself: https://www.youtube.com/watch?v=SrKj4hYic5A
Inside the Wolfram Language: https://www.youtube.com/watch?v=EjCWdsrVcBM
Transducers: https://www.youtube.com/watch?v=6mTbuzafcII
db.StartTransaction
err := db.Execute
if err != nil {
db.Rollback
return
}
err := db.Execute
if err != nil {
@robdaemon
robdaemon / init.el
Created December 10, 2015 05:20
Fix the path on emacs on Mac
;; fix the PATH variable
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell (shell-command-to-string "$SHELL -i -c 'echo -n $PATH'")))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(defun set-env-from-shell (envvar)
(let ((path-from-shell (shell-command-to-string (format "$SHELL -i -c 'echo -n $%s'" envvar))))
(setenv envvar path-from-shell)))
@robdaemon
robdaemon / updated-ui.yml
Created July 1, 2016 19:44
Updated Kubernetes UI definition that creates a load balancer
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@robdaemon
robdaemon / gemstash.conf
Created September 8, 2016 04:20
Upstart script for Gemstash
# Upstart script for Gemstash
respawn
respawn limit 15 5
start on runlevel [2345]
stop on runlevel [06]
script
su - gemstash -c "/usr/local/bin/gemstash start --no-daemonize"
@robdaemon
robdaemon / gen.sh
Created June 27, 2017 21:42
script to generate a CA and server key
#!/bin/bash
set -e
usage() {
echo "the following environment variables are required:"
echo "COUNTRY - Country code"
echo "STATE - State / Province"
echo "CITY - City"
echo "ORG - Organization"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#define NUM_CARDS 52
int deck[NUM_CARDS];
/*
@robdaemon
robdaemon / nils.go
Created September 5, 2018 22:32
nil handling may surprise you
package main
import (
"fmt"
"reflect"
)
func main() {
var myint interface{}