Skip to content

Instantly share code, notes, and snippets.

View naxoc's full-sized avatar

Camilla Krag Jensen naxoc

View GitHub Profile

Keybase proof

I hereby claim:

  • I am naxoc on github.
  • I am naxoc (https://keybase.io/naxoc) on keybase.
  • I have a public key whose fingerprint is 389E 797D DA66 7806 51FD C5AD BE2D 9138 37E2 5687

To claim this, I am signing this object:

@naxoc
naxoc / unused-images.sh
Created October 28, 2013 20:14
Script that looks at all images in a given location and checks if there are any references to each image. Useful for checking if images are being used by CSS for instance.
#!/bin/bash
DIR=.
if [ -n "$1" ]
then
DIR=$1
fi
# Find image files in.
FILES=`find $DIR -type f | grep ".*\.\(jpg\|gif\|png\|jpeg\)"`
@naxoc
naxoc / gist:5016407
Created February 22, 2013 20:43
Relative line numbers in vim
" Relative numbers in normal mode - absolute in insert mode.
autocmd InsertEnter * :set number
autocmd InsertLeave * :set relativenumber
@naxoc
naxoc / pre-commit
Created November 26, 2012 21:05
Drupal git commit hook
#!/usr/bin/php
<?php
/**
* @file
* This is a Git pre-commit hook that informs you when you are
* about to commit whitespace or a debug function.
*/
$red = "\033[1;31m";
$red_end = "\033[0m";
@naxoc
naxoc / gist:2643340
Created May 9, 2012 09:36
CtrlP config for vim
" I like it better when the filename is used for the search. Toggle this with
" <c-d>
let g:ctrlp_by_filename = 1
" Map the buffer switcher.
map <leader>b :CtrlPBuffer<cr>
" Map the recent files.
map <leader>r :CtrlPMRUFiles<cr>
" Map find-tag-in-buffer.
map <leader>t :CtrlPBufTag<cr>
" Map find-tag-in-all-buffers.