Skip to content

Instantly share code, notes, and snippets.

View natlownes's full-sized avatar

Nat Lownes natlownes

View GitHub Profile
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.onload = function() {
var hrefs = jQuery('a[href*=".wav"]');
for(var i=0;i<hrefs.length;i++) {
var uri = (hrefs[i].href);
var audio = jQuery('<audio autoplay loop src="' + uri + '">')
jQuery('body').append(audio);
};
}
@natlownes
natlownes / gist:6554889
Created September 13, 2013 19:20
rebuild CtrlP cache and ctags
augroup RebuildCaches
autocmd!
autocmd BufWritePost * call RebuildTags()
autocmd FocusGained * CtrlPClearCache
autocmd BufWritePost * CtrlPClearCache
augroup END
function! RebuildTags()
let cmd = 'ctags -R'
let output=system(cmd)
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/Users/nat/.nvm/v0.8.23/bin/npm', 'publish', '.' ]
2 info using npm@1.1.71
3 info using node@v0.8.23
4 verbose publish [ '.' ]
5 verbose read json /Users/nat/src/headrest/package.json
6 verbose cache add [ '.', null ]
7 silly cache add name=undefined spec="." args=[".",null]
8 verbose parsed url { pathname: '.', path: '.', href: '.' }
9 silly lockFile 3a52ce78- .
sudo killall -9 xbmc.bin
sudo killall -9 xbmc-standalone
sudo killall -9 Xorg
sudo /etc/init.d/gdm3 stop
sudo /etc/init.d/gdm3 start
_ = require 'lodash'
mixinEvents = (obj) ->
obj_destroy = obj.destroy
_.extend obj,
_listeners: {}
_listeningTo: []
" tagbar
let g:tagbar_usearrows = 1
nnoremap <leader>T :TagbarToggle<CR>
let g:tagbar_type_coffee = {
\ 'ctagstype' : 'coffee',
\ 'kinds' : [
\ 'c:classes',
\ 'f:functions',
\ 'v:variables'
\ ],
-R
--exclude=.git
--exclude=node_modules
--exclude=Session*.vim
--langdef=coffee
--langmap=coffee:.coffee
--regex-coffee=/^[ \t]*class ([a-zA-Z_$][0-9a-zA-Z_$]*).*$/\1/c,class/
--regex-coffee=/^[ \t]*([a-zA-Z_$@][0-9a-zA-Z_$\.]*)[ \t]*[:=].*[=-]>.*$/\1/f,function/
--regex-coffee=/^[ \t]*([a-zA-Z_$@][0-9a-zA-Z_$\.]*)[ \t]*=[^->\n]*$/\1/v,variable/
#!/usr/bin/env bash
command_exists () {
type "$1" &> /dev/null ;
}
system_name="`uname -s`"
if [ "$system_name" == "Darwin" ]
then
@natlownes
natlownes / chef.rake
Created January 30, 2013 15:54
rake task for dumping roles defined in the ruby DSL to json. expects dir .chef/chef_server_backup to exist in your chef-repo
namespace :roles do
desc 'dump roles defined in the Ruby DSL to json'
task :dump do
destination_dir = File.join(TOPDIR, '.chef', 'chef_server_backup')
files_paths = Dir["#{TOPDIR}/roles/*.rb"]
files_paths.each do |filename|
role_name = File.basename(filename, '.rb')
role = Chef::Role.new
<domain type='kvm' id='22'>
<name>freebsd</name>
<uuid>edfc5177-de28-3f69-7da8-a18f90b10a9c</uuid>
<memory unit='KiB'>2097152</memory>
<currentMemory unit='KiB'>2097152</currentMemory>
<vcpu placement='static'>2</vcpu>
<os>
<type arch='x86_64' machine='pc-1.1'>hvm</type>
<boot dev='hd'/>
</os>