Skip to content

Instantly share code, notes, and snippets.

View britg's full-sized avatar
🖖
Building games

Brit Gardner britg

🖖
Building games
View GitHub Profile
@britg
britg / InstallPythonGDAL.md
Created July 28, 2024 14:08 — forked from kelvinn/InstallPythonGDAL.md
Installing GDAL (Python 3.6) on Mac OS X

How-To: Install GDAL Python Bindings

I've found two ways to install the GDAL Python bindings on Mac.

Via GDAL Framework / QGIS

First, you can install the GDAL Framework via QGIS (or get it directly), and then do...

Keybase proof

I hereby claim:

  • I am britg on github.
  • I am britg (https://keybase.io/britg) on keybase.
  • I have a public key ASD3eqHnvrmgfpG5_HFfEZCq5dxHggVV2kB9FyiKvZcC1Qo

To claim this, I am signing this object:

class Triplet
# Class methods
# these generate Triplet _instances_
def self.up_to max
valid = []
(1..max).each do |x|
y = x+1
z = y+1
def possible_win_combo(board, combos)
combos.each do |combo|
multiple_x = board.select {|space,value| combo.include?(space) && value == 'X'}
if multiple_x.length == 2
return combo if (board[combo[0]] != 'O' && board[combo[1]] != 'O' && board[combo[2]] != 'O')
end
end
nil #return not necessary, implicit
end
@britg
britg / original.rb
Last active August 29, 2015 14:22
ruby warrior level
class Player
def initialize
@health = 20
@clear_behind = false
@wounded = false
end
def play_turn(warrior)
warrior_wounded?(warrior)
@britg
britg / gist:9572946
Created March 15, 2014 19:52
Screen to world point with oblique camera
Vector2 mousePos = Input.mousePosition;
if (lastMousePos.Equals(mousePos)) {
return;
}
lastMousePos = mousePos;
Ray ray = Camera.main.ScreenPointToRay(mousePos);
float dist;
Plane plane = new Plane(Vector3.up, Vector3.right, Vector3.down);
plane.Raycast(ray, out dist);
Vector3 worldPoint = Camera.main.ScreenToWorldPoint(new Vector3(mousePos.x, mousePos.y, dist));
@britg
britg / cap_deploy-quick
Created May 29, 2013 18:23
Sometimes you just want to update from git and restart
namespace :deploy
task :quick do
run "cd #{current_path}; git pull origin #{branch}"
system("cap #{stage} deploy:restart")
end
end
Apps
http://www.reflectionapp.com/
http://flexibits.com/fantastical
http://cheddarapp.com
http://appifywp.com/
http://www.mint.com
https://www.braintreepayments.com/
https://codeclimate.com/
https://cardspring.com/
http://nezumiapp.com/
@britg
britg / activate.js
Created January 15, 2012 16:47
Bonus strike CSS
$('#bar').removeClass('new').addClass('activated');
class Player < ActiveRecord::Base
# ...
def skills
@skills ||= (Skill.where(:player_id => self.id).first || \
Skill.create(:player_id => self.id))
end
end