Skip to content

Instantly share code, notes, and snippets.

View nouse's full-sized avatar

Mike Wu nouse

View GitHub Profile
@bohde
bohde / Main.purs.hs
Created March 15, 2014 23:46
Use websockets with Control.Reactive in Purescript
module Main where
import Control.Monad.Eff
import Control.Reactive
import Debug.Trace
import Prelude
foreign import websocket
"function websocket(url) {\
\ return function(outgoing) {\
@willurd
willurd / web-servers.md
Last active April 28, 2025 14:34
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
@necaris
necaris / couchdb2cb.py
Last active December 2, 2017 09:55
Simple script to transfer data from CouchDB to Couchbase
#-*-coding: utf-8-*-
"""
Simple script to dump documents out of a CouchDB database and straight into
a Couchbase instance.
"""
import time
import sys
import argparse
@argon
argon / gl-resque.service
Created July 3, 2012 10:15
GitLab systemd files
[Unit]
Description=Gitlab Resque
[Service]
Type=forking
SyslogIdentifier=gl-resque
User=gitlab
PIDFile=/home/gitlab/gitlab/tmp/pids/resque_worker.pid
WorkingDirectory=/home/gitlab/gitlab
import qualified Control.Monad.State as S
import Control.Applicative ((<$>), (<*>))
import Data.Maybe (fromMaybe)
import qualified Data.Map as M
import Control.Monad (unless)
data BF = Token Char | Loop [BF] deriving Show
type Tape = M.Map Int Char
type Env = (Int, Tape)
@luikore
luikore / fun.rb
Last active September 24, 2015 10:57
functional synopsis
# mixing imperative and functional code
sum = 0
(1..10).map do |i|
sum += i
end
@shripadk
shripadk / gist:652819
Created October 29, 2010 03:10
Express authentication using Redis for session store and Couchdb for database (in coffeescript!)
###
Module dependencies
###
require.paths.unshift "#{__dirname}/lib/support/express-csrf/"
require.paths.unshift "#{__dirname}/lib/support/node_hash/lib/"
express = require 'express'
app = module.exports = express.createServer()
RedisStore = require 'connect-redis'