Skip to content

Instantly share code, notes, and snippets.

View yaourt-install.sh
#!/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 Aug 29, 2015
Failed salt-bootstrap arch
View Vagrantfile
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|
View server.sh
#!/bin/bash
PORT=$1
${PORT:=8000}
python -m SimpleHTTPServer $PORT
View loop_benchmark.rb
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 Aug 29, 2015
Hash Presenter demonstration
View example.rb
class SomePresenter < HashPresenter
present 'author', :author
present 'something', :something
present 'foo', :foo
def baz
"#{self.author} is #{self.something}"
end
end
View lisp.c
#include <assert.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
enum type {
NIL,
View git-cleanup.sh
#!/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
View setjdk.sh
#!/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)
}
View keybase.md

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:

View load_order.rb
# 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
You can’t perform that action at this time.