Skip to content

Instantly share code, notes, and snippets.

View mnem's full-sized avatar

Dave Clayton-Wagner mnem

View GitHub Profile
@mnem
mnem / ebook_tidy_to_subfolders.rb
Created December 26, 2011 15:41
Script to move and group all ebook files in the current folder into a pretty named subfolder.
#!/usr/bin/env ruby
require "fileutils"
folder_map = {}
def make_folder_name name
return name.gsub /_/, " "
end
# Gather all the files in this directory
@mnem
mnem / ebook_select_ipad_versions.rb
Created December 26, 2011 15:43
Script to look in each subfolder containing ebook files and select the 'best' candidates for chucking on an iPad
#!/usr/bin/env ruby
require "fileutils"
output_folder_name = "_ipad_selection"
output = File.expand_path File.join(Dir.pwd, output_folder_name)
selected = []
# Gather folders to look at
folders = Dir.glob(%w{*/*.epub */*.pdf}).map {|file| File.dirname file}
folders.delete_if { | item | item.match(/^#{output_folder_name}/)}
@mnem
mnem / pwgen_a.sh
Created January 5, 2012 20:07
Quick 'n' dirty password generation commands for *nix/mac
# Will generate passwords up to 76 characters long.
#
# Change the 20 at the end to change the length.
dd if=/dev/urandom count=1 2> /dev/null | base64 | sed -ne 2p | cut -c-20
@mnem
mnem / pester.sh
Created January 7, 2012 18:22
Spammer takes over friends account, utilise scripting for minor lulz
# One `brew install watch` later...
watch -n 5 ./pester.sh
@mnem
mnem / nah_vpn_add_user.sh
Created January 17, 2012 13:32
Simple script to add VPN users to your chap-secrets file. For details on setting up a VPN on EC2, see http://noiseandheat.com/blog/2012/01/vpn-with-amazon-ec2-or-saving-your-iphone-from-promiscuity/
#!/bin/bash
#######################################
# Simple script to add VPN users to your chap-secrets file. For details
# on setting up a VPN on EC2, see:
#
# http://noiseandheat.com/blog/2012/01/vpn-with-amazon-ec2-or-saving-your-phone-from-promiscuity/
#
#
# (c) Copyright 2011 David Wagner.
#
@mnem
mnem / nah_xcode_uncrustify.rb
Last active February 1, 2020 20:12
Script file to be run as an Xcode 4 behaviour which uncrustifies the project source using reasonable Objective-C formatting defaults. Alternatively, you can run it and pass a path to uncrustify.
#!/usr/bin/env ruby
###########################################################################
# Script to be called as an Xcode 4 behaviour which will attempt to
# uncrustify all source files in the open project.
#
# (c) Copyright 2012 David Wagner.
#
# Complain/commend: http://noiseandheat.com/
#
#*************************************************************************#
@mnem
mnem / .nah_xcode_uncrustify.cfg
Created January 20, 2012 09:38
My uncrustify script which has an eye towards making Objective-C code sane. See also https://gist.github.com/1641451
# Uncrustify 0.59
###########################################################################
# nah_xcode_uncrustify.rb default
# configuration
#
# config_version: 1.1.0
#
# Default uncrustify config to use for
# the nah_xcode_uncrustify.rb script
@mnem
mnem / gist:2136505
Created March 20, 2012 14:55
Installing pysvn on an Amazon Linux AMI.
@mnem
mnem / README.md
Created April 9, 2012 22:03
Simple entity framework in lua for Love2D (or LÖVE if you want to be fancy). Still very much a work in progress.
@mnem
mnem / tools_osx_edition.md
Last active October 5, 2015 17:17
Tools and setup for doing stuff, for my future reference when I accidentally destroy my computer. Again.

OS X Edition

Stuff I install to make creating magic rubbish easier.

General tools

  • OSX Terminal: Good enough when combined with tmux.
  • tmux: Terminals done proper; tmuxinator: handy tmux session templates.
  • Homebrew: The only package manager that matters.
  • git: Source control that works.
  • The Silver Searcher: A faster, better ack.