Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/ruby
#
# This file is generated code. DO NOT send patches for it.
#
# Original source files with comments are at:
# https://github.com/defunkt/hub
#
module Hub
Version = VERSION = '1.10.5'
port "6600"
music_directory "~/Music/music"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
state_file "~/.mpd/mpd.state"
volume_normalization "yes"
audio_output {
type "osx"
(defn- merge-entry [mapper m e]
(let [k (key e) v (val e)]
(if (contains? m k)
(assoc m k ((safe-get mapper k) (get m k) v))
(assoc m k v))))
(defn merge-with-mapper
"Returns a map that consists of the rest of the maps conj-ed onto
the first. If a key occurs in more that one map, the mapping(s)
from the latter (left-to-right) will be combined with the mapping in
(defn sorted-set-on [mapper & elems]
(sorted-set-by #(compare (mapper %1) (mapper %2)) elems))
set nocompatible
filetype off
silent! call pathogen#runtime_append_all_bundles()
silent! call pathogen#helptags()
filetype plugin indent on
runtime macros/matchit.vim
set hidden
set autoread
set nobackup
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
#!/usr/bin/env ruby -wKU
# encoding: UTF-8
# prints out the last 15 git branches you used
reflog = IO.popen('git reflog')
$branches = []
def add_branch(b)
$branches << b unless $branches.include? b
richard-p-fine-man-4:~(master!+) $ ruby -e "p gets"
^[[A
"\e[A\n"
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
richard-p-fine-man-4:~(master!+) $
irb(main):001:0> foo = RuntimeError
=> RuntimeError
irb(main):002:0> begin; raise RuntimeError.new; rescue foo; puts 'lol'; end
lol
=> nil
import com.aphyr.riemann.client.EventDSL;
import com.aphyr.riemann.client.RiemannClient;
import com.yammer.metrics.Metrics;
import com.yammer.metrics.core.*;
import com.yammer.metrics.stats.Snapshot;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.net.InetSocketAddress;