Skip to content

Instantly share code, notes, and snippets.

View pxlpnk's full-sized avatar
💭
👋 hey

Andreas Tiefenthaler pxlpnk

💭
👋 hey
View GitHub Profile
I think you mean team...
I think you mean squad..
I think you mean gang...
I think you mean pals...
I think you mean buds...
I think you mean posse...
I think you mean phalanx...
I think you mean crew...
I think you mean crüe...
I think you mean nerds...
@topfunky
topfunky / gist:169876
Created August 18, 2009 18:45 — forked from wmoxam/gist:36116
Munin plugin for beanstalk queue
#!/opt/ruby-enterprise/bin/ruby
# MODIFIED: Minor fork to run smoothly under Ruby 1.8.6. Heredoc cleanup.
require 'rubygems'
require 'beanstalk-client'
if ARGV.length > 0 && ARGV[0] == 'config'
puts <<-END
graph_category App
#!/usr/bin/env ruby
require 'rubygems'
require 'beanstalk-client'
if ARGV.length > 0 && ARGV[0] == 'config'
puts "graph_title Beanstalk Queue Size"
puts "graph_vlabel watching"
puts "watching.label Watching"
puts "graph_vlabel reserved"
;original
(filter filter-fn some-collection)
;parallel filter
(map :val (filter (fn [m] (:allowed-by-filter m))
(pmap (fn [v] {:val s :allowed-by-filter (filter-fn v)}) some-collection)))
@yorickpeterse
yorickpeterse / 0001-Added-a-simple-Maybe-monad.patch
Created March 12, 2015 10:20
Simple Maybe monad in Ruby (copied straight from Git, too lazy to gemify for now)
From a31eb2863043937881e51cffb544ef9a641a62af Mon Sep 17 00:00:00 2001
From: Yorick Peterse <SNIP>
Date: Thu, 12 Mar 2015 11:08:46 +0100
Subject: [PATCH] Added a simple Maybe monad.
This is a rather simple implementation of the Maybe monad [1] / Option type [2].
It only provides the absolute bare-minimum instead of providing a fully blown
functional programming library.
Using this class allows you to turn code such as this: