Skip to content

Instantly share code, notes, and snippets.

View HummusSamurai's full-sized avatar

Hummus Samurai HummusSamurai

View GitHub Profile
n () {
[ ! -d $HOME/notes ] && mkdir -p $HOME/notes
${EDITOR:-vi} $HOME/notes/"$*"
}
nls() {
ls -c ~/notes/ | grep -i "$*"
@HummusSamurai
HummusSamurai / reddit-dl.sh
Last active April 1, 2017 19:12
Downloads video/audio content in a subreddit, and takes as parameters the subreddit title, date (optional), and limit (optional). Dependency: xargs, curl, youtube-dl, jq, at
#!/bin/bash
curl -A "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.112 Safari/534.30" \
https://www.reddit.com/r/$1/top/.json?sort=top\&t=${2:-all}\&limit=${3:-25} \
| jq -r '.data.children[].data.url' | xargs \
youtube-dl -o "~/youtube-dl/r_$1/r_$1 -- %(title)s.%(ext)s"
@HummusSamurai
HummusSamurai / Base64.lua
Created August 23, 2016 08:58 — forked from bortels/Base64.lua
Base64 encode/decode for Codea (Lua)
-- Lua 5.1+ base64 v3.0 (c) 2009 by Alex Kloss <alexthkloss@web.de>
-- licensed under the terms of the LGPL2
-- character table string
local b='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'
-- encoding
function enc(data)
return ((data:gsub('.', function(x)
local r,b='',x:byte()
@HummusSamurai
HummusSamurai / .nvimrc
Created August 15, 2016 12:07 — forked from jthomas/.nvimrc
NeoVim configuration
call plug#begin('~/.vim/plugged')
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'altercation/vim-colors-solarized'
Plug 'scrooloose/syntastic'
Plug 'scrooloose/nerdtree'
Plug 'kien/ctrlp.vim'
Plug 'bling/vim-airline'
Plug 'jelera/vim-javascript-syntax'