Skip to content

Instantly share code, notes, and snippets.

View avescodes's full-sized avatar

Avery Quinn avescodes

View GitHub Profile
@avescodes
avescodes / sexp-cheat-sheet
Created September 13, 2017 19:21 — forked from dylanmcdiarmid/sexp-cheat-sheet
vim sexp mappings for normal people cheat sheet
.vimrc
" Map leader to comma
let maplocalleader=","
" Toggle this for vim-sexp to not go into insert mode after wrapping something
let g:sexp_insert_after_wrap = 0
" Toggle this to disable automatically creating closing brackets and quotes
let g:sexp_enable_insert_mode_mappings = 1
Vocab
@avescodes
avescodes / upsearch.sh
Created January 4, 2013 16:48 — forked from anonymous/upsearch.sh
Recursively search upwards for a directory or file.
upsearch () {
if test -e "$1"; then
echo "$PWD"
else
if [ "$PWD" = "/" ]; then
return 1;
else
pushd .. > /dev/null
upsearch "$1"
exit_status=$?
@avescodes
avescodes / resources.md
Created June 28, 2012 19:26 — forked from alandipert/resources.md
Clojure training additional resources
<script type="text/javascript">
var queueBytesLoaded = 0;
var queueBytesTotal = 0;
var myQueue = null;
var queueChangeHandler = function(queue){
// alert('Uploading Started');
myQueue = queue;
// console.log("COLLECTION CHANGE!");
var list = document.getElementById('file_todo_list');
@posts = (params[:title] ? Post.where("UPPER(posts.title) LIKE UPPER(%?%)", parmas[:title]) : Post).paginate(:page => 1, :order => "created_at DESC", :per_page => 20)
require 'digest/sha1'
def suffix(seqnum)
o = ""
5.times do
o << (33 + (seqnum % 93)).chr
seqnum /= 93
end
return o
end
# helpfull for performing actions that require temp directories
# 1. handles temp file creation
# 2. lets you do your business in da 'block'
# 3. cleans up after itself
# usage
require 'fileutils'
include FileUtils
temp do