Skip to content

Instantly share code, notes, and snippets.

require 'socket'
require 'minitest/autorun'
describe '0x8c' do
it 'works' do
pid = Process.fork do
C=[];require 'gserver';Class.new(GServer){def serve(i)h=p;C<<i;i.each_line{|l|C.map{|c|c<<(h||=l.strip)+'>'+l}};end}.new($$,'*').start.join #"
{"type":"MultiLineString","coordinates":[[[13.358133,52.476019],[13.364982,52.47319]],[[13.364982,52.47319],[13.367145,52.474312],[13.369873,52.474765],[13.374165,52.475386],[13.37657,52.476489],[13.37866,52.479516]],[[13.353179,52.479835],[13.352775,52.479808],[13.358133,52.476019]]]}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@til
til / .bashrc
Last active December 27, 2015 19:19
My favourite radio stations, ready to be played from the command line
alias radio.oe1="mplayer mms://apasf.apa.at/oe1_live_worldwide"
alias radio.fm4="mplayer http://mp3stream1.apasf.apa.at:8000/"
alias radio.wfmu="mplayer http://mp3stream.wfmu.org"
alias radio.o94="mplayer http://orange-01.live.sil.at:8000"
alias radio.88vier="mplayer http://ice.rosebud-media.de:8000/88vier"
alias radio.dradio="mplayer http://dradio-ogg-dlf-l.akacast.akamaistream.net/7/629/135496/v1/gnl.akacast.akamaistream.net/dradio_ogg_dlf_l"
alias radio.funkhauseuropa="mplayer http://fhe-ogg.akacast.akamaistream.net/7/933/199785/v1/gnl.akacast.akamaistream.net/fhe-ogg"
alias radio.fluxfm="mplayer http://fluxfm.hoerradar.de/fluxfm-berlin"
#!/usr/bin/env ruby
#
# Reads input given in key=value log format and outputs it as CSV.
# Specify the keys as arguments in the order that they should be
# output. Without arguments, it outputs all values.
#
# E.g.
# cat /tmp/production.log | keyvalue2csv time controller action
# 2014-01-14 13:02:04 +0100,products,index,195.87
# 2014-01-14 13:02:04 +0100,products,index,25.82
@til
til / self_returning.rb
Created February 24, 2014 12:44
Ruby server script that returns itself, with comment function
#!/usr/bin/env ruby
#
# Leave a comment if you can ...
%w[ rubygems socket syntax/convertors/html ].each { |lib| require lib }
def header(*args)
args.join("\r\n") + "\r\n" + "\r\n"
end
(custom-set-variables
'(notmuch-fcc-dirs "archive")
'(notmuch-message-headers (quote ("Subject" "To" "Cc" "Date")))
'(notmuch-poll-script "notmuch-rsync")
'(notmuch-search-oldest-first nil)
'(notmuch-show-all-multipart/alternative-parts nil)
'(notmuch-show-indent-messages-width 0)
'(notmuch-show-logo t)
'(notmuch-show-part-button-default-action (quote notmuch-show-view-part))
)
@til
til / projects.org
Created March 23, 2014 15:44
notmuch for emacs-berlin

notmuch

notmuch is a search engine and emacs frontend for locally stored email. The name implies that it is efficient:

“You have 200k emails? That’s not much!”

Features

Fast local search

(defun downcase-word-with-camelcase ()
"This works similar to downcase-word, but additionally inserts
an underscore before upper case chars within camel cased words, so that:
FooBar => foo_bar"
(interactive)
(progn
(if (looking-at-p "\\>") (search-forward-regexp "\\<"))
(let ((start (point)))
(search-forward-regexp "\\>")
(let ((end (point)))
require 'rspec'
require 'set'
class Traverser
attr_reader :elements, :satisfied
def initialize(elements, satisfied:)
@elements = elements
@satisfied = satisfied
end