Skip to content

Instantly share code, notes, and snippets.

Click! Clack!

Łukasz Jan Niemier hauleth

Click! Clack!
Block or report user

Report or block hauleth

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
thequux /
Last active May 31, 2016
Multirust-compatible racer wrapper

This wrapper automatically sets the RUST_SRC_DIRECTORY environment variable for whatever rust compiler is currently active, automatically creating a new checkout whenever necessary. This should be compatible with all of the multirust-alike tools, but it has only been tested with


Simply place this somewhere on your path before the main racer binary and set the execute bit.


paragonie-scott /
Last active Jun 30, 2019
An Open Letter to Developers Everywhere (About Cryptography)
andkerosine / raskell.rb
Created Aug 15, 2012
Haskell-like list comprehensions in Ruby
View raskell.rb
$stack, $draws = [], {}
def method_missing *args
return if args[0][/^to_/]
$stack << { |a| a or $stack.pop }
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :<
class Array
def +@
piscisaureus /
Created Aug 13, 2012
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url =

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

isa / gist:2571012
Created May 1, 2012
Convert in less than 30 lines
View gist:2571012
Question: Convert following into the latter data structure in less than 30 lines:
A, B, C
A, C, E
E, F, D
D, A, J
E, D, J
amscotti / mongo_urlshortener.rb
Created Apr 2, 2012
Example of using MongoMapper and Sinatra to make an url shortener -
View mongo_urlshortener.rb
require "rubygems"
require "sinatra"
require "haml"
require "mongo_mapper"
class Shorten
include MongoMapper::Document
key :url, String
key :shorten_id, String
View fibur.markdown


Fibur is a library that allows concurrency during Ruby I/O operations without needing to make use of callback systems. Traditionally in Ruby, to achieve concurrency during blocking I/O operations, programmers would make use of Fibers and callbacks. Fibur eliminates the need for wrapping your I/O calls with Fibers and a callback. It allows you to write your blocking I/O calls the way you normally would, and still have concurrent execution during those I/O calls.


Say you have a method that fetches data from a network resource:

NARKOZ / whitespace.rake
Created Aug 30, 2011
Whitespaaaaaaaace! WHITESPAAAAAAAACE!
View whitespace.rake
# requires BSD sed
namespace :whitespace do
desc 'Removes trailing whitespace'
task :cleanup do
sh %{for f in `find . -type f | grep -v .git | grep -v ./vendor | grep -v ./tmp | egrep ".(rb|js|haml|html|css|sass)"`;
do sed -i '' 's/ *$//g' "$f";
done}, {:verbose => false}
puts "Task cleanup done"
You can’t perform that action at this time.