Skip to content

Instantly share code, notes, and snippets.

@cbx
cbx / vim-sexp-cheatsheet.md
Last active January 5, 2021 12:24 — forked from cszentkiralyi/vim-sexp-cheatsheet.md
vim-sexp cheatsheet

Prereqs

These are for the combined vim-sexp (https://github.com/guns/vim-sexp) and vim-sexp-mappings-for-regular-people (https://github.com/tpope/vim-sexp-mappings-for-regular-people) plugins. vim-sexp is neat on its own but Tim Pope makes common stuff much easier.

Note that some vim-sexp functionality depends on <LocalLeader> mappings. This is a different leader key than the global leader, and is the variable maplocalleader (instead of mapleader). To see if you have this set, use :echo maplocalleader; if it errors out you'll need to set it, otherwise it will echo the key. This version of the cheatsheet uses , as <LocalLeader>.

TOC

  1. Movements
@cbx
cbx / country_date_formats.csv
Created February 4, 2018 19:24 — forked from mlconnor/country_date_formats.csv
Listing of countries with their preferred date formats, ISO3166 code, ISO629-2
ISO 3166 Country Code ISO639-2 Country Code Country ISO 3166 Country Code ISO639-2 Lang Language Date Format
ALB AL Albania sqi sq Albanian yyyy-MM-dd
ARE AE United Arab Emirates ara ar Arabic dd/MM/yyyy
ARG AR Argentina spa es Spanish dd/MM/yyyy
AUS AU Australia eng en English d/MM/yyyy
AUT AT Austria deu de German dd.MM.yyyy
BEL BE Belgium fra fr French d/MM/yyyy
BEL BE Belgium nld nl Dutch d/MM/yyyy
BGR BG Bulgaria bul bg Bulgarian yyyy-M-d
BHR BH Bahrain ara ar Arabic dd/MM/yyyy
@cbx
cbx / keybase.md
Created September 27, 2016 12:12

Keybase proof

I hereby claim:

  • I am cbx on github.
  • I am cbx (https://keybase.io/cbx) on keybase.
  • I have a public key ASAZyPywsT11joUyu5rFzMuRXubE2zYVTWq0Wu3Bv5d2gAo

To claim this, I am signing this object:

@cbx
cbx / gist:3dcb0be4526241b9a387
Created October 27, 2014 10:11
get total time & app-server time from response
function site_speed {
time curl -Is $1 | grep X-Runtime
}
@cbx
cbx / gist:4e6197f88a1c606bc037
Created July 24, 2014 12:51
list all git files from big to small
# inspired by http://naleid.com/blog/2012/01/17/finding-and-purging-big-files-from-git-history
function git_bigobjects {
git gc && git verify-pack -v .git/objects/pack/pack-*.idx | egrep "^\w+ blob\W+[0-9]+ [0-9]+ [0-9]+$" | sort -k 3 -n -r
}
function git_allfiles {
git rev-list --objects --all | sort -k 2
}
@cbx
cbx / delete-buried-beanstalk-jobs.rb
Last active August 29, 2015 13:57
Delete buried jobs from a beanstalk queue
#!/usr/bin/env ruby -wKU
require 'beaneater'
@beanstalk = Beaneater::Pool.new('localhost:11300')
@tube = @beanstalk.tubes.find('production')
while (job = @tube.peek(:buried))
puts job.inspect
job.delete
end
@cbx
cbx / GitHunks() vimL
Last active August 29, 2015 13:56
git command to list diff hunks with git index in vim compatible errorformat
" load all changed hunks in the Quickfix list
function! GitkHunks()
cexpr system("git hunks2")
copen
endfunction
nnoremap <Leader>hh :call GitHunks()<CR>