Skip to content

Instantly share code, notes, and snippets.

View pythonandchips's full-sized avatar

Colin Gemmell pythonandchips

View GitHub Profile
@pythonandchips
pythonandchips / gist:4987810
Created February 19, 2013 17:09
replace line in all files under target
find . -type f | xargs perl -pi -e "s/target/replacement/g"
@pythonandchips
pythonandchips / gist:5559994
Created May 11, 2013 13:36
git-presenter presentation file for grunt.js talk at scotland.js
---
slides:
- slide:
commit: eac64f9687b989001a91f4eb6c5796ed01a9751c
message: added initial project
- slide:
commit: 58cc5528ba5804380aa8104199e7b92976cab031
message: blank grunt file
- slide:
commit: f220bf1a341edcedb2856957559f2ac5c6e7dd3b
@pythonandchips
pythonandchips / gist:6882010
Created October 8, 2013 09:21
Vim function to remove trailing whitespace
" Strip trailing whitespace
function! <SID>StripTrailingWhitespaces()
" Preparation: save last search, and cursor position.
let _s=@/
let l = line(".")
let c = col(".")
" Do the business:
%s/\s\+$//e
" Clean up: restore previous search history, and cursor position
let @/=_s
@pythonandchips
pythonandchips / gist:899d3dc3afbcf9303c7b
Created May 12, 2014 15:07
git pre commit hook to stop debug statements
#!/bin/bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
against=f737485baee8b0edc5ef4d00c498305578d630fd
fi
# Redirect output to stderr.
#!/bin/bash
if git rev-parse --verify HEAD >/dev/null 2>&1
then
against=HEAD
else
against=f737485baee8b0edc5ef4d00c498305578d630fd
fi
# Redirect output to stderr.
"MY VIMRC
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g prefix C-a
unbind C-b
bind C-a send-prefix
set -sg escape-time 1
set -g base-index 1
setw -g pane-base-index 1
setw -g mode-keys vi
"MY VIMRC
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Case FRACTAL DEFINE R4 BLACK PEARL QUIET MID-TOWER CASE
Overclocked CPU Overclocked Intel® Core™i7-4770k Quad Core (3.50GHz @ max 4.40GHz)
OC Settings Show/Hide
Motherboard ASUS® Z87-K: ATX, USB2.0, USB3.0, SATA6GB/S, XFIRE
Memory (RAM) 16GB KINGSTON HYPER-X GENESIS DUAL-DDR3 1600MHz, X.M.P (2 x 8GB KIT)
Graphics Card 3GB AMD RADEON™ HD7970 - DVI,HDMI,2 mDP - DX® 11, Eyefinity 4 Capable
2nd Graphics Card NONE
3rd Graphics Card NONE
1st Hard Disk 240GB KINGSTON HYPERX 3K SSD, SATA 6 Gb/s (upto 555MB/sR | 510MB/sW)
2nd Hard Disk NONE
"MY VIMRC
set nocompatible
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'