Skip to content

Instantly share code, notes, and snippets.

View michaelbartnett's full-sized avatar

Michael Bartnett michaelbartnett

View GitHub Profile
@michaelbartnett
michaelbartnett / gist:5523083
Created May 6, 2013 02:36
output of HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install python3 --with-gcc 2>&1
LambdaBook-Pro% HOMEBREW_MAKE_JOBS=1 VERBOSE=1 brew install python3 --with-gcc 2>&1
==> Downloading http://python.org/ftp/python/3.3.1/Python-3.3.1.tar.bz2
Already downloaded: /Users/michaelbartnett/Library/Caches/Homebrew/python3-3.3.1.tar.bz2
tar xf /Users/michaelbartnett/Library/Caches/Homebrew/python3-3.3.1.tar.bz2
==> ./configure --prefix=/usr/local/Cellar/python3/3.3.1 --enable-ipv6 --datarootdir=/usr/local/Cellar/python3/3.3.1/share --datadir=/usr/local/Cellar/python3/3.3.1/share --enable-framework=/usr/local/Cellar/python3/3.3.1/Frameworks
./configure --prefix=/usr/local/Cellar/python3/3.3.1 --enable-ipv6 --datarootdir=/usr/local/Cellar/python3/3.3.1/share --datadir=/usr/local/Cellar/python3/3.3.1/share --enable-framework=/usr/local/Cellar/python3/3.3.1/Frameworks
checking build system type... x86_64-apple-darwin10.8.0
checking host system type... x86_64-apple-darwin10.8.0
checking for --enable-universalsdk... no
checking for --with-universal-archs... 32-bit
@michaelbartnett
michaelbartnett / breakvoluptuous.py
Last active December 17, 2015 07:09
Breaking Voluptuous
from voluptuous import Schema, Required, Range
schema = Schema({
Required('a'): 1,
Required('b'): {
Range(min=1,max=20): [
0,
{
Required('foo'): 42
},
@michaelbartnett
michaelbartnett / LICENSE.txt
Last active October 17, 2022 10:29
Tuple implementation for use with Unity3d
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@michaelbartnett
michaelbartnett / brew_config
Created September 23, 2013 02:35
homebrew: valgrind 3.8.1 failed to build on MacOS 10.6.8
$ brew --config
HOMEBREW_VERSION: 0.9.4
ORIGIN: https://github.com/mxcl/homebrew.git
HEAD: 9e80d57525783f0f9031455dce811601d01b9367
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: dual-core 64-bit penryn
OS X: 10.6.8-i386
Xcode: 4.2
GCC-4.0: build 5494
@michaelbartnett
michaelbartnett / ipod_meta_rename.py
Created October 26, 2013 22:03
Script to rename music files recovered from old ipod using hsaudiotag module, which is a pretty cool module. It handles m4as and doesn't afraid of anything.
from __future__ import unicode_literals
import sys
import collections
import glob
import shutil
import argparse
from os import path
from hsaudiotag import auto as hsauto
@michaelbartnett
michaelbartnett / SampleLooper.cs
Last active December 27, 2015 02:49
Sample accurate looping in Unity v3.5
using UnityEngine;
public class SampleLooper : MonoBehaviour
{
/*///////////////////////////// /*\
/////////////////////////////// | /
// Begin Inspector Variables // ||
/////////////////////////////// ||_
/*///////////////////////////// \_|
// By convention, variables that are not given an intializer are required to be set in the inspector
@michaelbartnett
michaelbartnett / DefaultToLegacyAnimationPostprocessor.cs
Created January 7, 2014 22:51
Make Mecanim not break our game
using UnityEngine;
using UnityEditor;
public class DefaultToLegacyAnimationPostprocessor : AssetPostprocessor
{
private void OnPostprocessModel(GameObject gameObject)
{
// We set the animation type to Legacy, which forces Unity to add
// Animation components by default instead of Animator/AnimationController (Mecanim) components
var modelImporter = this.assetImporter as ModelImporter;
@michaelbartnett
michaelbartnett / ListPrefabChanges.cs
Created April 18, 2014 02:49
helper class for showing changes properties in a prefab instance, needs a StringListWindow helper that just prints a bunch of strings to an editor window
using System;
using System.Linq;
using UnityEngine;
using UnityEditor;
public class ListPrefabChanges : EditorWindow
{
[MenuItem("Tools/List Prefab Changes")]
private static void Command()
{
@michaelbartnett
michaelbartnett / HashableWeakRefOfT.cs
Last active August 29, 2015 14:00
A rough HashableWeakRef<T> implementation. Missing many details and cases.
using System;
class HashableWeakRef<T> : IEquatable<HashableWeakRef<T>> where T : class
{
private WeakReference weakRef;
public T Target { get { return (T) weakRef.Target; } }
public HashableWeakRef(T target)
{
@michaelbartnett
michaelbartnett / Program.cs
Last active August 29, 2015 14:00
HashableWeakRef<T> examle
using System;
using System.Collections.Generic;
namespace TestHashableWeakRef
{
class MainClass
{
public static void Main (string[] args)
{