Skip to content

Instantly share code, notes, and snippets.

@scan
scan / gist:1029445
Created June 16, 2011 15:06 — forked from philcali/gist:1029230
Nicol project definition
// sbt 0.10 parent project definition
import sbt._
imoprt Keys._
object General {
val settings = Defaults.defaultSettings ++ Nicol.engineSettings ++ Seq (
organization := "com.github.scan",
version := "0.1.0.1",
@scan
scan / htaccess
Created December 14, 2011 14:16 — forked from dave1010/htaccess
HTTP Status Cats Apache (htaccess) config
# HTTP Status Cats
# Apache (htaccess) config created by @dave1010
# Licensed CC BY 2.0
# Images CC BY 2.0, from GirlieMac's photostream:
# http://www.flickr.com/photos/girliemac/sets/72157628409467125/with/6508023065/
# Usage: copy save this file as .htaccess or add it to your httpd.conf
ErrorDocument 404 '<a href="http://www.flickr.com/photos/girliemac/6508022985/" title="404 - Not Found by GirlieMac, on Flickr"><img src="http://farm8.staticflickr.com/7172/6508022985_b22200ced0.jpg" width="500" height="400" alt="404 - Not Found"></a>'
@scan
scan / build.sbt
Created December 18, 2011 10:19 — forked from aolshevskiy/build.sbt
xsbt-lift-basic
seq(WebPlugin.webSettings :_*)
scalaVersion := "2.8.1"
libraryDependencies ++= Seq(
"net.liftweb" %% "lift-webkit" % "2.3" % "compile",
"net.liftweb" %% "lift-mapper" % "2.3" % "compile",
"org.mortbay.jetty" % "jetty" % "6.1.22" % "jetty,test",
"ch.qos.logback" % "logback-classic" % "0.9.26",
"junit" % "junit" % "4.5" % "test",
@scan
scan / MultiChat.scala
Created January 4, 2012 23:08 — forked from tjweir/MultiChat.scala
Multi-room Chat server / client with Lift
package myproject.comet
import net.liftweb._
import actor.LiftActor
import common.{Full, Empty, Box}
import http._
import js.JE._
import js.JE.JsArray._
import js.JE.JsRaw._
import js.JsCmds._
@scan
scan / Main.hs
Created January 10, 2012 07:30 — forked from biilmann/Main.hs
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Monad.Trans
import Network.Wai.Handler.Warp (run)
import Network.Wai
import Network.HTTP.Types (statusOK)
import Data.Enumerator ((>>==), ($$))
import qualified Data.Enumerator as E
@scan
scan / coffeemaker
Created March 11, 2012 09:04 — forked from gsklee/coffeemaker
Carefree CoffeeScript Auto-compiler
#!/bin/bash
#
# --------------------------------------------------------------------------------------
# http://blog.gantrithor.com/post/12535461464/carefree-coffeescript-auto-compiler-part-3
# --------------------------------------------------------------------------------------
DIR_ROOT="$(cd "$(dirname "$0")" && pwd)"
function compile_tree() {
find "$1" -name "*.coffee" -type f | while read PATH_COFFEE; do
module Main where
import Data.List
main = interact epicWin
epicWin :: String -> String
epicWin s = let x :: Integer
x = read (head (lines s))
in (show $ div (getTotal (tail (lines s))) x) ++ "\n"
@scan
scan / MongoDB.hs
Created April 9, 2012 22:25 — forked from mightybyte/MongoDB.hs
Snap.Snaplet.Auth.Backends.MongoDB
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
module Snap.Snaplet.Auth.Backends.MongoDB
( initMongoAuth
) where
------------------------------------------------------------------------------
import Control.Arrow
require 'redis'
# SADD key, member
# Adds the specified <i>member</i> to the set stored at <i>key</i>.
redis = Redis.new
redis.sadd 'my_set', 'foo' # => true
redis.sadd 'my_set', 'bar' # => true
redis.sadd 'my_set', 'bar' # => false
redis.smembers 'my_set' # => ["foo", "bar"]
@scan
scan / mapgen.hs
Created June 5, 2012 13:21 — forked from splinterofchaos/mapgen.hs
A simple roguelike map generator. Uses naiive splatter pattern to create rooms.
import System.Random
import System.Console.GetOpt
import System.Environment(getArgs, getProgName)
type Coord = (Int,Int)
type Range = (Int,Int)
type Area = (Coord,Coord) -- Upper-left and lower-right bounds.