Skip to content

Instantly share code, notes, and snippets.

@mwilliammyers
mwilliammyers / eclim.rb
Created September 13, 2015 04:20
eclim Homebrew formula
class Eclim < Formula
desc "Eclim provides the ability to access Eclipse code editing features via the command line or favorite editor (eg. VIM)"
homepage "http://eclim.org/index.html"
url "http://sourceforge.net/projects/eclim/files/eclim/2.4.1/eclim_2.4.1.jar", :using => :nounzip
sha256 "289ba3643a1193edfc68bf042043f4847995733eecb23e2077f49f39c51a1527"
head "git://github.com/ervandew/eclim.git"
#keg_only "..."
@mwilliammyers
mwilliammyers / unsubderictify.rb
Last active September 27, 2015 08:06
Recursively (probably a bad idea) changes filename to the name of it's parent directory
#!/usr/bin/env ruby
require 'docopt'
require 'fileutils'
@app = File.basename(__FILE__).chomp('.rb')
@doc = <<DOCOPT
@app
Recursively (probably a bad idea) changes filename to the name of it's parent directory.
#!/bin/sh
KERNEL="ubuntu/vmlinuz"
INITRD="ubuntu/initrd.gz"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off"
MEM="-m 1G"
#SMP="-c 2"
NET="-s 2:0,virtio-net"
IMG_CD="-s 3,ahci-cd,ubuntu/ubuntu-15.04-server-amd64.iso"
#!/bin/sh
# Linux
KERNEL_VERSION="4.2.0-16"
XHYVE_ROOT="/usr/local/VM/xhyve"
KERNEL="${XHYVE_ROOT}/ubuntu/boot/vmlinuz-${KERNEL_VERSION}-generic"
INITRD="${XHYVE_ROOT}/ubuntu/boot/initrd.img-${KERNEL_VERSION}-generic"
CMDLINE="earlyprintk=serial console=ttyS0 acpi=off root=/dev/vda1 ro"
MEM="-m 3G"
@mwilliammyers
mwilliammyers / transmission.sh
Created November 26, 2015 20:37 — forked from jyunderwood/transmission.sh
Set Transmission.app preferences on OS X
#!/usr/bin/env bash
# Use `~/Downloads` to store incomplete downloads
defaults write org.m0k.transmission UseIncompleteDownloadFolder -bool true
defaults write org.m0k.transmission IncompleteDownloadFolder -string "${HOME}/Downloads"
# Do not prompt for confirmation before downloading
defaults write org.m0k.transmission DownloadAsk -bool false
# Trash original torrent files
@mwilliammyers
mwilliammyers / search_pkg.rb
Created December 21, 2015 21:16
Search OS X and most of the Linux package managers for a provided package name.
#!/usr/bin/env ruby
def search_pkg(pkg)
# open_browser "https://www.macports.org/ports.php?by=name&substr=#{pkg}"
# open_browser "http://pdb.finkproject.org/pdb/browse.php?summary=#{pkg}"
# http://caskroom.io/search
# https://www.google.com/search?q=java&domains=www.openbsd.org&sitesearch=www.openbsd.org&btnG=Search&gfe_rd=ssl&ei=vqhiVr27EuGD8QedxJCwBg
open_browser "http://braumeister.org/search/#{pkg}"
open_browser "http://packages.ubuntu.com/search?keywords=#{pkg}&searchon=names&suite=all&section=all"
open_browser "https://packages.debian.org/search?keywords=#{pkg}&searchon=names&suite=all&section=all"
@mwilliammyers
mwilliammyers / giratchive.sh
Last active December 31, 2015 08:05 — forked from markrickert/giratchive.sh
Git Archive Bash Script
#!/bin/bash
# Takes one parameter: a remote git repository URL.
#
# This is the stuff this script does:
#
# 1. Clones the repository
# 2. Fetches all remote branches
# 3. Compresses the folder
# 4. Deletes the cloned folder.
#!/usr/bin/env bash
# ~/.osx — http://mths.be/osx
now="$(date +"%r")"
fill_line() {
for (( j = 0; j < "$2"; j++ )); do
printf "$1"
done
@mwilliammyers
mwilliammyers / Makefile
Created January 20, 2016 22:53
Simple Makefile template
TARGET ?= target
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall
.PHONY: default all test clean
default: $(TARGET)
all: default test
@mwilliammyers
mwilliammyers / Gemfile
Last active June 6, 2016 07:53
filebot post processing script for use with transmission and plex
source 'https://rubygems.org'
gem 'streamio-ffmpeg'