Skip to content

Instantly share code, notes, and snippets.

View AdamHepner's full-sized avatar

Adam Hepner AdamHepner

View GitHub Profile
package main
import (
"log"
"net/http"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/chi"
"github.com/go-chi/render"
@AdamHepner
AdamHepner / powershell-poc.org
Created August 19, 2016 14:18
I had some small problems with interfacing org-babel with powershell directly under Linux, so I decided to work around it a bit.

Powershell on Linux in Org-Mode Proof of Concept

cat <<EOF | powershell -command -
Write-Host "Hello World from PowerShell on Linux"
EOF
@AdamHepner
AdamHepner / ankify.py
Created March 17, 2015 20:01
Ankify - convert text file containing {{placeholders}} (one card per line), into csv with {{c1::cloze placeholders}} that the Anki can import relatively safely
from __future__ import with_statement
import re
import sys
import random
if __name__=="__main__":
ctr = 1
print sys.argv[1]
outfile = sys.argv[1]+".csv"
with open(sys.argv[1],'r') as the_input:
with open(outfile,'w') as the_output:

Git vs. CVS Advantages

Flexible Workflow

In Git your working copy is a clone of the entire repository. This includes branches and tags. This decreases the overhead (speed and manual work) involved when switching contexts and the need to be connected to a network. Some examples are:

  • When switching branches there is no need to connect to a remote server or close your IDE/project and open a checkout in another directory. Running git checkout [branch name] is all you need to do.
  • When merging you do not need a connection to the remote server, you have all branches locally. Since branches are so cheap in Git you could create a new branch to perform the merge in so that if you had a large amount of conflicts you could incrementally work on and commit without affecting the main branch then merge or create a patch after everything has been fixed.
  • Because Git is a distributed system in addition to connecting to a central repository developers can connect to another developers repository. This allows team
@AdamHepner
AdamHepner / keybase.md
Created February 25, 2015 22:57
keybase.md

Keybase proof

I hereby claim:

  • I am adamhepner on github.
  • I am adamhepner (https://keybase.io/adamhepner) on keybase.
  • I have a public key whose fingerprint is 1709 73DD AFB6 8974 4596 0EA4 1A5F D9CD F9EF 8FC9

To claim this, I am signing this object:

# -*- mode: ruby -*-
# vi: set ft=ruby :
# Quick start:
# - vagrant plugin install vagrant-digitalocean
# - Set-up ~/.digital_ocean.rb like this:
# module DigitalOceanKeys
# CLIENT_ID = 'foooooooo'
# API_KEY = 'fabada'
# end