Skip to content

Instantly share code, notes, and snippets.

View gaving's full-sized avatar
🎯
Focusing

Gavin Gilmour gaving

🎯
Focusing
View GitHub Profile
let g:loaded_gist_vim = 1
function! ToggleXHTML()
if &ft != 'xhtml'
let s:oldFileType = &ft
set ft=xhtml
else
if exists('s:oldFileType')
let &ft=s:oldFileType
From 37fe86fdbf48aae5e7fdb9bdba9f38e781b84617 Mon Sep 17 00:00:00 2001
From: Gavin Gilmour <gavin.gilmour@removed>
Date: Fri, 13 Aug 2010 10:07:21 +0100
Subject: [PATCH 5/5] changes
Signed-off-by: Gavin Gilmour <gavin.gilmour@removed>
---
.vimrc | 9 ++-------
Rakefile | 2 +-
int *_memset32(int *p, int value, size_t count) {
asm {
mov EAX,value ;
mov ECX,count ;
mov EDX,EDI ;
mov EDI,p ;
rep ;
stosd ;
mov EAX,EDX ;
}
defaults write com.apple.finder FXEnableSlowAnimation -bool true
defaults write com.apple.finder DisableAllAnimations -bool true
@gaving
gaving / ql.sh
Created October 24, 2010 11:55
quick look
# Display files in Quick Look
function ql () {
(qlmanage -p "$@" > /dev/null 2>&1 &
local ql_pid=$!
read -sn 1
kill ${ql_pid}) > /dev/null 2>&1
}
function qlt () {
(qlmanage -p -c public.plain-text "$@" > /dev/null 2>&1 &
function! HandleURI()
let s:uri = matchstr(getline("."), '[a-z]*:\/\/[^ >,;:]*')
echo s:uri
if s:uri != ""
exec "!open \"" . s:uri . "\""
else
echo "No URI found in line."
endif
endfunction
map <Leader>w :call HandleURI()<CR>
@gaving
gaving / script.js
Created October 31, 2010 16:04
script.js
$(document).ready(function() {
$(".entry-title a").lettering();
$.fn.stripTags = function() { return this.replaceWith( this.html().replace(/<\/?[^>]+>/gi, '') ); };
$("span").each(function(i, el) {
var html = $(el).html().replace(/\s+/, "");
if ($(el).is(":empty") || html.length == 0)
$(el).stripTags();
});
@gaving
gaving / random_class.js
Created October 31, 2010 16:05
random_class.js
/*
* RandomClass - A jQuery plugin to add a random class from a selection
* of classes to an element.
*
* Copyright (c) 2010 Fredi Bach
* www.fredibach.ch
*
* Usage:
$("p span").randomClass( [ 'color1','color2','color3' ] );
if which pbpaste > /dev/null; then
CLIPBOARD=pbpaste
elif which getclip > /dev/null; then
CLIPBOARD=getclip
fi
if [ -n "${CLIPBOARD+x}" ]; then
# insert wget with clipbaord content
paste-clipboard() {
ulimit -c 0