This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-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), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'net/http' | |
require 'nokogiri' | |
TUMBLR_USER = '[email protected]' | |
TUMBLR_PASS = 'yourpassword' | |
url = URI.parse('http://www.tumblr.com/api/write') | |
# Read the WP export file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
. $HOME/.rvm/scripts/rvm | |
rvm rvmrc load | |
exec $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -z "${2}" ]; then | |
ssh $1 | |
else | |
ssh $2@$1 | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" 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' |