Skip to content

Instantly share code, notes, and snippets.

View warmwaffles's full-sized avatar
🛠️
Code Wrestling

Matthew Johnston warmwaffles

🛠️
Code Wrestling
View GitHub Profile
#!/bin/sh
# title : yaourt-install
# description: This script install yaourt downloading and compiling package-query and yaourt
# author : Christopher Fernández
# usage : yaourt-install
echo "================================================"
echo "Remember that you need to be in the sudoers file"
echo "to install Yaourt successfully."
echo "================================================"
@warmwaffles
warmwaffles / Vagrantfile
Last active August 29, 2015 13:56
Failed salt-bootstrap arch
Vagrant.configure('2') do |config|
config.vm.box = 'arch64' # http://vagrant.srijn.net/archlinux-x64-2014-01-07.box
config.vm.synced_folder('srv/', '/srv/')
inline = [
'pacman -Syu --noconfirm'
].join(';')
config.vm.provision(:shell, inline: inline)
config.vm.provision(:salt) do |salt|
#!/bin/bash
PORT=$1
${PORT:=8000}
python -m SimpleHTTPServer $PORT
require 'benchmark'
max = (ARGV.shift || 10_000_000).to_i
puts "# of iterations = #{max}"
Benchmark::bm(20) do |x|
x.report("each") do
(0..max).each do
end
end
@warmwaffles
warmwaffles / example.rb
Last active August 29, 2015 13:57
Hash Presenter demonstration
class SomePresenter < HashPresenter
present 'author', :author
present 'something', :something
present 'foo', :foo
def baz
"#{self.author} is #{self.something}"
end
end
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,
#!/bin/bash
echo "REMOVING MERGED BRANCHES..."
git branch --merged | grep -v "\*" | grep -v "master" | xargs -n 1 git branch -d
echo "PRUNING REMOTE BRANCHES..."
git remote | xargs -n 1 git remote prune
echo "CLEANING...AGGRESSIVE LIKE..."
git gc --aggressive
#!/bin/bash
#
# Useful for switching between java 1.6, 1.7, 1.8 etc...
#
export JAVA_HOME=$(/usr/libexec/java_home -v 1.7)
setjdk() {
export JAVA_HOME=$(/usr/libexec/java_home -v $1)
}

Keybase proof

I hereby claim:

  • I am warmwaffles on github.
  • I am warmwaffles (https://keybase.io/warmwaffles) on keybase.
  • I have a public key whose fingerprint is CD94 A497 63BF BACD 96D7 8004 FD9B BCAD 4196 AEB7

To claim this, I am signing this object:

# Use this when you need to figure out what is being required and where
def require(*args)
puts "\e[1;31m[required]\e[0m %s => \e[0;36m%s\e[0m" % [caller.first, args.first]
super
end
def load(*args)
puts "\e[1;31m[loaded]\e[0m %s => \e[0;36m%s\e[0m" % [caller.first, args.first]
super