Skip to content

Instantly share code, notes, and snippets.

@kevinlawler
kevinlawler / .gitconfig
Created June 19, 2012 02:26 — forked from mbbx6spp/.gitconfig
Susan Potter's .gitconfig file from November 2007 blog post. Updated since November 2007 with new aliases or options.
# Migrating my old .gitconfig blog post from 2007 to here so I can update it easier.
# Original URL:
# http://geek.susanpotter.net/2007/11/my-gitconfig.html
[user]
name = Susan Potter # make sure you change this
email = [email protected] # make sure you change this
[color]
diff = auto
status = auto
branch = auto
@kevinlawler
kevinlawler / hack.sh
Created March 31, 2012 17:49 — forked from erikh/hack.sh
OSX For Hackers
#!/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/2108403/hack.sh | sh
#
@kevinlawler
kevinlawler / gist:1167117
Created August 24, 2011 01:48 — forked from todd1251/gist:1161262
Working with Core Plot trunk as at 22/08/2011
// Modified from: http://www.switchonthecode.com/tutorials/using-core-plot-in-an-iphone-application
// NOTE: needs -load_all linker flag; might not be quite right - red/blue data line styles are not working
- (void)viewDidLoad
{
[super viewDidLoad];
graph = [[CPTXYGraph alloc] initWithFrame: self.view.bounds];
CPTGraphHostingView *hostingView = (CPTGraphHostingView *)self.view;
@kevinlawler
kevinlawler / bcrypt.php
Created August 10, 2011 22:07 — forked from BaylorRae/bcrypt.php
How to use bcrypt in PHP to safely store passwords (PHP 5.3+ only)
<?php
// secure hashing of passwords using bcrypt, needs PHP 5.3+
// see http://codahale.com/how-to-safely-store-a-password/
// salt for bcrypt needs to be 22 base64 characters (but just [./0-9A-Za-z]), see http://php.net/crypt
// just an example; please use something more secure/random than sha1(microtime) :)
$salt = substr(str_replace('+', '.', base64_encode(sha1(microtime(true), true))), 0, 22);
// 2a is the bcrypt algorithm selector, see http://php.net/crypt