Skip to content

Instantly share code, notes, and snippets.

View toland's full-sized avatar

Aeryn Toland toland

View GitHub Profile
@toland
toland / init.vim
Created October 26, 2020 20:46
Elixir dev with Vim
" Plugins {{{
call plug#begin()
Plug '/usr/local/opt/fzf' | Plug 'junegunn/fzf.vim'
Plug 'elixir-editors/vim-elixir'
Plug 'slashmili/alchemist.vim'
Plug 'amiralies/coc-elixir', {'do': 'yarn install && yarn prepack'}
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'antoinemadec/coc-fzf'
Plug 'kassio/neoterm'
@toland
toland / git-purge-branches.sh
Created October 11, 2012 22:08
Simple shell script to clean up stale feature branches
#!/bin/sh
# Modified version of script found at
# http://devblog.springest.com/a-script-to-remove-old-git-branches
# This has to be run from master
git checkout master
# Update our list of remotes
git fetch origin
git remote prune origin
@toland
toland / sshclient
Created January 1, 2012 23:37
Simple script that can be used when setting up iTerm2 as default ssh client.
#!/bin/sh
if [ -z "${2}" ]; then
ssh $1
else
ssh $2@$1
fi
@toland
toland / rvmdo
Created January 1, 2012 23:36
Simple script to load RVM, source the local rvmrc file and run a command. This was originally created to be used when creating a custom profile in iTerm2.
#!/bin/sh
. $HOME/.rvm/scripts/rvm
rvm rvmrc load
exec $*
@toland
toland / blowfish.rb
Created July 13, 2010 16:47
Simple Ruby module for encrypting text with Blowfish
require 'openssl'
module Blowfish
def self.cipher(mode, key, data)
cipher = OpenSSL::Cipher::Cipher.new('bf-cbc').send(mode)
cipher.key = Digest::SHA256.digest(key)
cipher.update(data) << cipher.final
end
def self.encrypt(key, data)
@toland
toland / tumblr-import.rb
Created March 15, 2010 03:03
Script to import Wordpress content into Tumblr
require 'rubygems'
require 'net/http'
require 'nokogiri'
TUMBLR_USER = 'your@email.com'
TUMBLR_PASS = 'yourpassword'
url = URI.parse('http://www.tumblr.com/api/write')
# Read the WP export file
@toland
toland / template.rb
Created October 23, 2009 14:49
My rails template
# Remove unnecessary Rails files
run 'rm README'
run 'rm public/index.html'
run 'rm public/favicon.ico'
run 'rm public/images/rails.png'
# Copy database.yml
run 'cp config/database.yml config/database.yml.example'
gem 'thoughtbot-factory_girl', :lib => 'factory_girl', :source => 'http://gems.github.com'
@toland
toland / gist:194530
Created September 27, 2009 00:25
Perl script to extract data from iPhone backups
#!/usr/bin/perl -w
use strict;
# This file clumsily extracts the DB's hidden in the iPhone backup files
# Usage: perl -w bkupextract.pl /Users/flip/Library/Application\ Support/MobileSync/Backup/*/*
my %seen;
foreach my $filename (@ARGV) {
# Slurp File Contents
@toland
toland / gist:146428
Created July 13, 2009 20:22
Use ErlyDTL templates with Nitrogen
-module(my_util).
-compile(export_all).
template_path(Template) ->
filename:join([code:priv_dir(my_app), templates, Template]).
render_template(Name, Variables) ->
Template = template_path(Name ++ ".html"),
Mod = list_to_atom(Name ++ "_template"),
ok = erlydtl:compile(Template, Mod),