This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2266714/hack.sh | sh | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* A class to parse color values | |
* @author Stoyan Stefanov <sstoo@gmail.com> | |
* @link http://www.phpied.com/rgb-color-parser-in-javascript/ | |
* @license Use it if you like it | |
* MODIFICATIONS by Peter Cottle :D | |
*/ | |
function Color(color_string) | |
{ | |
// if it's an object, just clone and return |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set incsearch | |
set wildmenu | |
set ruler | |
set ignorecase | |
set smartcase | |
set noerrorbells | |
set modeline | |
set ls=2 | |
set cursorline | |
imap ii <Esc> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export EDITOR=vim | |
source ~/git-completion.bash | |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local BLUE="\[\033[0;34m\]" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import multiAgents | |
class TrivialProblem(object): | |
""" make a tree that looks like this: | |
root (4) | |
/ \ | |
min left (4) min right (2) | |
/ \ / \ | |
4 3 2 deeper (1000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Peter Cottle | |
email = petermcottle@gmail.com | |
[core] | |
editor = /usr/bin/vim -f | |
excludesfile = /Users/pcottle/.gitignore_global | |
[alias] | |
unstage = reset HEAD -- | |
[help] | |
autocorrect = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('underscore'); | |
var fs = require('fs'); | |
// Haha, this is so tricky. so we have a template for index.html to stick | |
// in the hashed JS and style files -- that template also contains | |
// templates used in the app. in order to avoid evaluating those | |
// templates, we change the regexes so we can effectively nest templates | |
_.templateSettings.interpolate = /\{\{(.+?)\}\}/g; | |
_.templateSettings.escape = /\{\{\{(.*?)\}\}\}/g; | |
_.templateSettings.evaluate = /\{\{-(.*?)\}\}/g; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentWillMount() { | |
this._panResponder = PanResponder.create({ | |
onStartShouldSetPanResponder: () => true, | |
onMoveShouldSetResponderCapture: () => true, | |
onMoveShouldSetPanResponderCapture: () => true, | |
onPanResponderGrant: (e, {dx, dy}) => { | |
this.state.pan.setOffset({x: dx, y: dy}); | |
this.state.pan.setValue({x: 0, y: 0}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
componentWillMount() { | |
this._responder = PanOrTapResponder.create({ | |
onPressIn: () => { | |
// Called after the ~30ms delay to make sure | |
// this gesture is not a pan but rather a tap. | |
this.setState({highlightUnderlay: true}); | |
}, | |
onPress: () => { |
OlderNewer