Skip to content

Instantly share code, notes, and snippets.

View DanBrooker's full-sized avatar

Daniel Brooker DanBrooker

View GitHub Profile
@DanBrooker
DanBrooker / upgrade_postgres.txt
Last active February 16, 2018 10:36 — forked from hardbap/upgrade_postgres.txt
Upgrading postgresql from 9.5.x to 9.6.x with Hstore
# Orignal instructions here: https://kkob.us/2016/01/09/homebrew-and-postgresql-9-5/
1. Stop postgresql
$ brew services stop postgresql
2. Install postgresql 9.6
$ brew update && brew upgrade postgresql
3. Make a new 9.6 database
$ initdb /usr/local/var/postgres9.6 -E utf8

Keybase proof

I hereby claim:

  • I am danbrooker on github.
  • I am danbrooker (https://keybase.io/danbrooker) on keybase.
  • I have a public key ASDhHciyjHkd278D1o_Ir_73-1Vo9LdoYbX0L5sdbAUWrAo

To claim this, I am signing this object:

@DanBrooker
DanBrooker / RootMotion.cs
Created November 21, 2015 23:21
Unity 5 Mecanim Legacy Animation, Adds root motion using animator Forward
using UnityEngine;
using System.Collections;
[RequireComponent(typeof(Animator))]
public class RootMotion : MonoBehaviour {
public float runSpeed = 10;
void OnAnimatorMove()
using UnityEngine;
using System;
using System.Collections.Generic;
using System.Collections;
// A* needs only a WeightedGraph and a location type L, and does *not*
// have to be a grid. However, in the example code I am using a grid.
public interface WeightedGraph<L>
{
int Cost(Location a, Location b);
@DanBrooker
DanBrooker / Character.cs
Created August 20, 2015 23:30
Unity3D move to waypoints
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Character : MonoBehaviour {
public int health = 2;
public int actions = 2;
public string name = "";
protocol DataModel {
}
protocol DataModelRelationships {
var relationships : [String: Array<DataModel>] { get }
}
protocol DataStore {
func add<T : DataModel>(element: T)
@DanBrooker
DanBrooker / gist:4057310
Created November 12, 2012 03:20
NSLogger Macros
#define DWarn(...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"Warning",1,__VA_ARGS__)
#define DErr(...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"Error",0,__VA_ARGS__)
#ifdef DEBUG
#define NSLog(...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"NSLog",4,__VA_ARGS__)
#define DLog(...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@"General",2,__VA_ARGS__)
#define DLogC(tag,...) LogMessageF(__FILE__,__LINE__,__FUNCTION__,@#tag,3,__VA_ARGS__)
#define DData(nsdata) LogDataF(__FILE__,__LINE__,__FUNCTION__,@"NSData",2, nsdata)
#if TARGET_OS_IPHONE
#define DImage(nsimage) LogImageDataF(__FILE__,__LINE__,__FUNCTION__,@"NSImage",2, nsimage.size.width, nsimage.size.height, [[[NSBitmapImageRep alloc] initWithData:[nsimage TIFFRepresentation]] representationUsingType:NSPNGFileType properties:nil]);