Skip to content

Instantly share code, notes, and snippets.

View rkrzr's full-sized avatar

Robert Kreuzer rkrzr

View GitHub Profile
anonymous
anonymous / gist:929217
Created April 19, 2011 18:43
| While lhs.exec = \env -> let f = \env' -> case @e.eval env' of
VFalse -> env'
VTrue -> f (@s1.exec env')
in f e
@scvalex
scvalex / README
Created April 30, 2011 02:27
Simple Python script to upload a file to Rackspace CloudFiles
CONFIGURATION
-------------
To setup, simply set your username and API access key in the
cloudfiles.get_conenction call. If you're not using the UK
version of Rackspace, remove the third parameter from the above
call.
EXAMPLE USAGE
-------------
@specialunderwear
specialunderwear / babel.sh
Created September 15, 2011 08:58
Install all utf8 locales on ubuntu
#! /bin/sh
cd /usr/share/locales
./install-language-pack eo
./install-language-pack ia
./install-language-pack ie
./install-language-pack io
./install-language-pack vo
./install-language-pack ca
@orclev
orclev / trie.hs
Created February 28, 2012 04:23
Haskell trie implementation
import Data.Maybe
import Control.Monad (liftM)
import Data.List (isPrefixOf)
import qualified Data.Map as M
import qualified Data.Foldable as F
-- | Trie container data type
data Trie a = Trie { value :: Maybe a
, children :: M.Map Char (Trie a) }
deriving (Show)
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
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 = git@github.com:joyent/node.git

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:

@quiver
quiver / README.md
Last active April 3, 2024 15:47
Who says PostgreSQL can't Pub/Sub like Redis?

Pub/Sub pattern with PostgreSQL's LISTEN/NOTIFY command

This is a simple chat-like program using pub-sub pattern, backed by PostgreSQL's LISTEN/NOTIFY command.

Publish

publish message to foo channel from user nickname.

$ python pub.py foo nickname
PUBLISH to channel #foo
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that

@mthurman
mthurman / README
Created April 3, 2014 21:59
requests + urllib3 + pyopenssl ZeroReturnError
pip install ndg-httpsclient==0.3.2 pyasn1==0.1.7 pyOpenSSL==0.13.1 requests==2.2.1
# with a cert.pem file in the same directory as ssl_server.py
python ssl_server.py
# in another terminal with same virtualenv
python ssl_client.py
@vrillusions
vrillusions / _README.mkd
Last active January 24, 2023 16:18
Kickstart for Ubuntu 14.04
@kosmikus
kosmikus / TinyServant.hs
Created November 1, 2015 20:30
Implementation of a small Servant-like DSL
{-# LANGUAGE DataKinds, PolyKinds, TypeOperators #-}
{-# LANGUAGE TypeFamilies, FlexibleInstances, ScopedTypeVariables #-}
{-# LANGUAGE InstanceSigs #-}
module TinyServant where
import Control.Applicative
import GHC.TypeLits
import Text.Read
import Data.Time