Skip to content

Instantly share code, notes, and snippets.

# A* Shortest Path Algorithm
# http://en.wikipedia.org/wiki/A*
# FB - 201012256
from heapq import heappush, heappop # for priority queue
import math
import time
import random
class node:
xPos = 0 # x position
@max-giro
max-giro / graph.py
Created January 6, 2013 14:32 — forked from n0phx/graph.py
# 6.00 Problem Set 10
# Graph optimization
#
# A set of data structures to represent graphs
#
class Node(object):
def __init__(self, name):
@max-giro
max-giro / goodfilms_angular_app.html
Created August 21, 2012 01:01 — forked from geelen/goodfilms_angular_app.html
Goodfilms Angular App example
<html ng-app="goodfilms">
<!-- ... -->
<body ng-controller="FrameController">
<header> <!-- Logo and menu buttons --> </header>
<div id="stage" ng-controller="FeedController">
<ul class="events">
<li class="event" ng-repeat="film in films">
@max-giro
max-giro / directives.js
Created August 14, 2012 14:02 — forked from abourget/directives.js
Hammer.js integration with AngularJS
/**
* Inspired by AngularJS' implementation of "click dblclick mousedown..."
*
* This ties in the Hammer events to attributes like:
*
* hm-tap="add_something()"
* hm-swipe="remove_something()"
*
* and also has support for Hammer options with:
*
@max-giro
max-giro / new_bashrc.sh
Created August 11, 2012 19:31 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Now a repo with faster code- please refer to https://github.com/josephwecker/bashrc_dispatch - thanks gioele
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
@max-giro
max-giro / new_bashrc.sh
Created August 11, 2012 19:31 — forked from josephwecker/new_bashrc.sh
Replace .bashrc, .bash_profile, .profile, etc. with something much more clean, consistent, and meaningful. Now a repo: https://github.com/josephwecker/bashrc_dispatch
#!/bin/bash
# License: Public Domain.
# Author: Joseph Wecker, 2012
#
# Now a repo with faster code- please refer to https://github.com/josephwecker/bashrc_dispatch - thanks gioele
#
# Are you tired of trying to remember what .bashrc does vs .bash_profile vs .profile?
# Are you tired of trying to remember how darwin/mac-osx treat them differently from linux?
# Are you tired of not having your ~/.bash* stuff work the way you expect?
#
@max-giro
max-giro / gist:3291985
Created August 8, 2012 04:10 — forked from paulirish/gist:1551766
my zsh prompt with titlebar text setting
#
# my zsh theme with iTerm titlebar manip.
# see video to see the bug I have.. any help would be HUGELY appreciated :)
# http://youtu.be/U-h9XCCq0q4
#
# also
# https://github.com/sjl/oh-my-zsh/
# http://sage.ucsc.edu/xtal/iterm_tab_customization.html
@max-giro
max-giro / osx_lion_rail_setup.md
Created August 6, 2012 20:31 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@max-giro
max-giro / LICENSE.txt
Created June 26, 2012 15:03 — forked from sindresorhus/LICENSE.txt
Photo Booth (140byt.es)
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2012 Sindre Sorhus <http://sindresorhus.com>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@max-giro
max-giro / hideaddrbar.js
Created June 12, 2012 04:04 — forked from jayproulx/hideaddrbar.js
Normalized hide address bar for iOS & Android
/*
* Normalized hide address bar for iOS & Android
* (c) Scott Jehl, scottjehl.com
* MIT License
*/
(function( win ){
var doc = win.document;
// If there's a hash, or addEventListener is undefined, stop here
if( !location.hash && win.addEventListener ){