Skip to content

Instantly share code, notes, and snippets.

View nouse's full-sized avatar

Mike Wu nouse

View GitHub Profile
@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'
@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
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)
@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
@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
@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
@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) {\
@kachayev
kachayev / concurrency-in-go.md
Last active January 6, 2025 22:43
Channels Are Not Enough or Why Pipelining Is Not That Easy
@danackerson
danackerson / 100_base.conf
Last active September 19, 2024 15:42
using nginx + lua + redis for redirects and rewrites
# using such a setup requires `apt-get install lua-nginx-redis` under Ubuntu Trusty
# more info @ http://wiki.nginx.org/HttpLuaModule#access_by_lua
http {
lua_package_path "/etc/nginx/include.d/?.lua;;";
lua_socket_pool_size 100;
lua_socket_connect_timeout 10ms;
lua_socket_read_timeout 10ms;
server {
@paf31
paf31 / 24days.md
Last active August 8, 2023 05:53
24 Days of PureScript

This blog post series has moved here.

You might also be interested in the 2016 version.