Skip to content

Instantly share code, notes, and snippets.

View minad's full-sized avatar

Daniel Mendler minad

  • Germany
View GitHub Profile
@fairchild
fairchild / dht_api_sample.rb
Created February 27, 2009 21:16
proposed API for ditributed has table
# sample skeleton for a ruby API based on the ideas from http://www.oceanstore.org/publications/papers/pdf/iptps03-api.pdf
class DistributeKeyBasedRouter
def initialize(deliver_to_class, deliver_class_method = :delivered)
@delivery_callback_class = deliver_to_class
@delivery_callback_method = deliver_class_method
end
#!/usr/bin/env ruby
# based on http://gist.github.com/29838
# logging to syslog added
# added killing orphaned procs
# added culling applications to maintain some per application limits
# Find bloating passengers and kill them gracefully. Run from cron every so often.
#
require "rubygems"
require "logging"
Rails CMS alternatives
======================
Note: project activity was checked on 11/26/09.
Active projects:
---------------
adva-cms
repo: http://github.com/svenfuchs/adva_cms/
site: http://adva-cms.org/
Last update: 11/24/09
@esperlu
esperlu / mysql2sqlite.sh
Created April 27, 2011 05:46
MySQL to Sqlite converter
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite
@jvranish
jvranish / valueLevelClasses.hs
Created May 2, 2012 17:28
An experiment with mixing value level typeclasses and implicit parameters
{-# LANGUAGE Rank2Types
, RebindableSyntax
, ImplicitParams
, NoMonomorphismRestriction #-}
import Data.Maybe
import Data.Function
import Data.String
import Prelude (undefined, error, String, (++))
anonymous
anonymous / shared.rb
Created December 20, 2012 01:51
Shared Juno store Implement your own key value server in 50 lines!
require 'drb'
module Juno
class Shared < Base
def initialize(options = {}, &block)
options[:port] ||= 9000
@uri = options[:uri] || (options[:socket] ? "drbunix://#{options[:socket]}" :
"druby
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@plentz
plentz / nginx.conf
Last active July 25, 2024 09:38
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@mgiraldo
mgiraldo / polygonfix writeup.ipynb
Last active August 29, 2015 14:04
Finding shape consensus among multiple geo polygons. See: http://nbviewer.ipython.org/gist/mgiraldo/a68b53175ce5892531bc
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@puffnfresh
puffnfresh / reornament.idr
Last active September 15, 2018 21:20
Algebraic Ornaments!
module reornament
-- Idris translation of Agda code:
-- https://gist.github.com/gallais/e507832abc6c91ac7cb9
-- Which follows Conor McBride's Ornaments paper:
-- https://personal.cis.strath.ac.uk/conor.mcbride/pub/OAAO/Ornament.pdf
ListAlg : Type -> Type -> Type
ListAlg A B = (B, A -> B -> B)