Skip to content

Instantly share code, notes, and snippets.

@samuelleach
samuelleach / .bashrc
Last active December 11, 2015 19:49 — forked from henrik/.bashrc
# http://henrik.nyh.se/2008/12/git-dirty-prompt
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/
# username@Machine ~/dev/dir[master]$ # clean working directory
# username@Machine ~/dev/dir[master*]$ # dirty working directory
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
@samuelleach
samuelleach / newRepo.sh
Created January 29, 2013 21:55
Create a new GitHub repository and demonstrate basic git commands
# Set up new repo on GitHub
curl -u 'samuelleach' https://api.github.com/user/repos -d '{"name":"gitProj"}'
# Clone repo in local directory
git clone https://github.com/samuelleach/gitProj.git
# Add a README.md and .gitignore file in the repo
cd gitProj
touch README.md .gitignore
@samuelleach
samuelleach / README.md
Last active December 14, 2015 17:28 — forked from mbostock/.block
@samuelleach
samuelleach / README.md
Last active December 20, 2018 09:31
UK map
@samuelleach
samuelleach / git
Created March 26, 2013 09:15 — forked from chyld/git
# ----------------------------------------------------------------- #
REFERENCES
# ----------------------------------------------------------------- #
http://ndpsoftware.com/git-cheatsheet.html
# ----------------------------------------------------------------- #
BASIC
# ----------------------------------------------------------------- #
@samuelleach
samuelleach / index.html
Last active December 16, 2015 11:28 — forked from mbostock/.block
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.link {
stroke: #000;
}
.node {
fill: #ccc;
@samuelleach
samuelleach / README.md
Last active December 16, 2015 21:09
Force layout graph with colour-coded node neighbours.

First attempt at making a colour-coded graph, with code snippets inspired from the D3 community.

Green => Friend and follower.

Red => Follower

Blue => Friend.

Improvements needed:

Using d3.geo.tile to display raster image tiles underneath some TopoJSON vectors, and d3.behavior.zoom for pan & zoom.

@samuelleach
samuelleach / _.md
Created May 17, 2013 08:20
crossfilter test
@samuelleach
samuelleach / _.md
Created May 17, 2013 10:47
crossfilter test