This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function time_as_relative(t1,t2,fix){ | |
var diff = t1 - t2; | |
var minute = 60, hour = minute * 60, day = hour * 24, | |
week = day * 7, month = day * 30, year = month * 12; | |
return in_range( | |
[0,'just now'], | |
[5,'% seconds',1], | |
[minute,'a minute'], | |
[minute*2,'% minutes',minute], | |
[minute*30,'half an hour'], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | Generate a flow chart by scanning for annotations from a code base. | |
module Main where | |
import Development.Flo | |
import System.Environment | |
-- | Main entry point. | |
main :: IO () | |
main = getArgs >>= mapM scanAndPrint >>= putStrLn.digraph.concat where |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chris@cn-done:~/ghcjs/examples/main$ sh uglifythisdir | |
uglifying ./Data/HashTable.js | |
uglifying ./Data/Tuple.js | |
uglifying ./Data/Dynamic.js | |
uglifying ./Data/Char.js | |
uglifying ./Data/Word.js | |
uglifying ./Data/Int.js | |
uglifying ./Data/Bits.js | |
uglifying ./Data/Maybe.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GeneralizedNewtypeDeriving #-} | |
import Control.Monad | |
import Control.Monad.Identity | |
import Control.Monad.Writer | |
import Control.Monad.State | |
import Control.Arrow | |
import Data.Maybe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
testcase.js | |
/* | |
* Demo func | |
* @param {yes:function()} config | |
*/ | |
function foo(config){ | |
if(config.yes()){ | |
return true; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Unifier = (function(){ | |
function Unifier(){ | |
this.bindTable = {}; | |
} | |
/******************************************************************************* | |
* Unify two terms. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Unify two expressions. | |
*/ | |
function unify(config){ | |
var exp1 = config.exp1, exp2 = config.exp2; | |
var frame = config.frame || {}; | |
return config.returnFrame? | |
[resolve(go(exp1,exp2)),frame] : resolve(go(exp1,exp2)); | |
function go(exp1,exp2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// Simple unifier. | |
/******************************************************************************* | |
* Unifier two terms. | |
* term1: result of parse() | |
* term2: result of parse() | |
* frame: (optional) use an existing unification frame | |
*/ | |
var unify = exports.unify = function(config){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//////////////////////////////////////////////////////////////////////////////// | |
// Simple logic demo, no point in it. But just 'cuz. | |
var Unifier = require('./unifier.js'); | |
var unify = Unifier.unify; | |
var parse = Unifier.parse; | |
/***************************************************************************** | |
* A simple logic language querier. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/******************************************************************************* | |
* Main entry point. | |
*/ | |
$(document).ready(function(){ | |
setupErrors(); | |
setupDates(); | |
setupAutoHide(); | |
setupManageItems(); | |
setupConfirms(); | |
}); |