Skip to content

Instantly share code, notes, and snippets.

satyr / gist:1080268
Created Jul 13, 2011 — forked from zakki/gist:1080130
FizzBuzz Scala 70B
View gist:1080268
for(n<-0 to 99)println(Seq(n+1,"Buzz","Fizz","FizzBuzz")(n%3&2|n%5/4))
satyr /
Created May 20, 2011 — forked from yuya-takeyama/
quick sleep sort

quick sleep sort

example usage:

$ coffee 3701 45 292 9 324 45 23 123 1343
View cowsh.js
// Coco compiler wrapper for WSH
// (must be placed in the same directory as coco.js)
// Usage: cscript cowsh.js [--watch] file
// inspired by
var fs = WScript.CreateObject("Scripting.FileSystemObject");
var scriptPath = WScript.ScriptFullName.slice(
0, -WScript.ScriptName.length);
var Coco = new new Function(
fs.OpenTextFile(scriptPath + "coco.js", 1).ReadAll()
crypto = require 'crypto'
key = (values) ->
crypto.createHash('sha1').update(values.join '-').digest 'hex'
memoize = (f, memo = {}) ->
-> memo[key [this, arguments...]] ||= f.apply this, arguments
fib = memoize (n) -> if n < 2 then n else fib(n-1) + fib(n-2)
satyr /
Created Apr 22, 2011 — forked from igstan/
State Monad in Co{co,ffeeScript}
push = (value) -> (stack) -> {value, stack: [value]concat stack}
pop = (stack) -> value: stack.0, stack: stack.slice 1
bind = (stackOperation, continuation) -> (stack) ->
result = stackOperation stack
continuation(result.value) result.stack
result = (value) -> (stack) -> {value, stack}
# Sudoku solver in Coco based on the Python solution by Peter Norvig
# 2011-04-19
# 2011-04-21 satyr
# Throughout this program we have:
# r is a row, e.g. 'A'
# c is a column, e.g. '3'
# s is a square, e.g. 'A3'
# d is a digit, e.g. '9'

"In our study of program design, we have seen that expert programmers control the complexity of their designs with the same general techniques used by designers of all complex systems. They combine primitive elements to form compound objects, they abstract compound objects to form higher-level building blocks, and they preserve modularity by adopting appropriate large-scale views of system structure. In illustrating these techniques, we have used Lisp as a language for describing processes and for constructing computational data objects and processes to model complex phenomena in the real world.

However, as we confront increasingly complex problems, we will find that Lisp, or indeed any fixed programming language, is not sufficient for our needs. *We must constantly turn

name= if previous_keys.length > 0
then "#{main_key}[#{_.implode('][', previous_keys)}][#{key}]"
else "#{main_key}[#{key}]"
View stickam.ub.js
function StickamLargeChat_old (id) {
var start = "<object width='820' height='490' codebase='http:\/\/\/pub\/shockwave\/cabs\/flash\/,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'>\n" +
"<embed src='http:\/\/\/flash\/stickam\/stickam_player.swf?app=stickam_chat_open.swf&userID=";
var end="' width='820' height='490' type='application/x-shockwave-flash' quality='high' allowscriptaccess='always' allowfullscreen='true' flashvars='webID=84634C6CDD408CA62D5DBD086DF5E196&webSeq=&userType=205&skinName=open&app=stickam_chat_open.swf&userIP='>\n" +
return (start+id+end);
function StickamLargeChat(id){
var start = "<object width='320' height='240' codebase='http:\/\/\/pub\/shockwave\/cabs\/flash\/,0,0,0' classid='clsid:D27CDB6E-AE6D-11cf-96B8-4445535
View twitter-oauth-caution.user.css
@namespace url(;
url-prefix( {
You can’t perform that action at this time.