Skip to content

Instantly share code, notes, and snippets.

View akbiggs's full-sized avatar
👋

Alexander Biggs akbiggs

👋
  • Mountain View, California
View GitHub Profile
@akbiggs
akbiggs / XNA .gitignore
Created December 14, 2012 18:47
.gitignore for XNA game development.
# Build Folders (you can keep bin if you'd like, to store dlls and pdbs)
[Bb]in/
[Oo]bj/
# mstest test results
TestResults
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
; VARIABLES
program_files := "C:\Program^ Files"
cmd := "C:\Windows\System32\cmd.exe /k " . program_files . "\nodejs\nodejsvars.bat"
home := "C:\Users\Bill"
code := home . "\Code"
; FUNCTIONS
CD(path) {
SendInput cd %path% {enter}
return
@akbiggs
akbiggs / lists.js
Created April 6, 2013 07:40
Following through Steve Losh's post on representing lists as lambdas.
/* LISTS */
var empty_list = function(selector) {
return selector(undefined, undefined, true);
};
var prepend = function(el, list) {
return function(selector) {
return selector(el, list, false);
};
@akbiggs
akbiggs / generateTestScript.py
Created July 18, 2013 18:40
Simple HDL test script generator
import sys
import math
class InvalidTestFileException(Exception):
pass
ERRORS = {
"novars": "Test file is missing either input or output variables"
}
# This script backs up your settings from a Xamarin Studio CSharp solution file.
# This is useful for when your settings randomly disappear after doing some git
# operations, but it is really just a workaround for not having figured out why
# the setings are disappearing in the first place.
#
# USAGE:
# to backup: python backup_settings.py <solution_filename>
# to restore: python backup_settings.py -r (OR --restore) <solution_filename>
import sys
// TinyTween.cs
//
// Copyright (c) 2013 Nick Gravelyn
//
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software
// and associated documentation files (the "Software"), to deal in the Software without restriction,
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
// sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
@akbiggs
akbiggs / experiments.clj
Created February 17, 2014 17:43
Random Experiments with Overtone/Quil
(ns groovyclojure.core
(:use [overtone.live]
[overtone.inst.piano]
[overtone.inst.drum])
(:require [quil.core :as q]))
(defn play-chord [instrument chord]
(doseq [note chord] (instrument note)))
(defn play-piano-chord [chord]
@akbiggs
akbiggs / .vimrc
Last active August 29, 2015 14:01
set tabstop=2
set autoindent
set expandtab
set shiftwidth=2
set clipboard+=unnamed
set tw=80
set cursorline
set nostartofline
set background=dark
set shell=/bin/bash
# NAVIGATION
function gop
cd ~/code/personal
if test (count $argv) != 0
cd $argv
end
end
@akbiggs
akbiggs / default_args.clj
Last active February 25, 2016 02:09
A convenient macro for creating a function with default values for arguments.
(defmacro defn-defaults [name args body]
"Create a function that can provide default values for arguments.
Arguments that are optional should be placed in a hash as the
last argument with their names mapped to their default values.
When invoking the function, :<optional-argument-name> <value>
specifies the value the argument should take on."
(if (map? (last args))