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
http://www.w3.org/TR/2013/WD-cssom-view-20131217/ | |
// Window Extensions | |
enum ScrollBehavior { "auto", "instant", "smooth" }; | |
dictionary ScrollOptions { | |
ScrollBehavior behavior = "auto"; | |
}; |
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
data Maybe a = Nothing | Just a | |
bind :: Maybe a -> (a -> Maybe b) -> Maybe b | |
bind m f = case m of | |
Just x -> f x | |
Nothing -> Nothing | |
return :: a -> Maybe a | |
return x = Just x |
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
import Control.Monad | |
transpose [] = [] | |
transpose (z:zs) = foldl beta (alpha z) zs | |
where alpha = map (\x-> [x]) | |
beta = zipWith (\x y-> x++[y]) | |
transpose' [] = [] | |
transpose' (z:zs) = map reverse $ foldl beta (alpha z) zs | |
where alpha = map (\x-> [x]) |
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
(* | |
http://groups.csail.mit.edu/mac/users/adams/BB/BB.sml | |
Copyright 1992-1996 Stephen Adams. | |
This software may be used freely provided that: | |
1. This copyright notice is attached to any copy, derived work, | |
or work including all or part of this software. | |
2. Any derived work must contain a prominent notice stating that |
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
import Control.Monad.State | |
type Interact a = StateT Int IO a | |
repl :: Interact () | |
repl = forever $ do | |
val <- liftIO readLn | |
state <- get | |
liftIO $ putStr "Total: " | |
liftIO $ print (val + state) |
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
-- Basado en | |
-- https://twitter.com/joseanpg/status/343757288089190401 | |
-- https://twitter.com/joseanpg/status/343758742455738368 | |
-- https://twitter.com/joseanpg/status/343759216424652802 | |
-- Version ultramejorable: http://t.co/da8tx1LK6r | |
-- Versión Clojure by @jneira: https://gist.github.com/jneira/5745669 | |
-- con probabilidad inversamente proporcional a las prioridades | |
import Random |
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
-- http://benedictgaster.org/wp-content/uploads/2012/08/haskwork97.pdf | |
-- Polymorphic Extensible Records for Haskell (page 3) | |
type Monoid v r = Rec { plus :: v -> v -> v , id :: v | r } | |
type Group v r = Monoid v { inv :: v -> v | r } | |
type Ring v r = Group v { mult :: v -> v -> v , one :: v | r } | |
iMonoid :: Monoid Int {} |
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 editor = null; | |
var sleeping = null; | |
var sleepingParent = null; | |
function handler(ev) { | |
var el = ev.target; | |
if (sleeping) { | |
sleeping.innerHTML = editor.value; | |
editor.value = ''; | |
editor.defaultValue = editor.value; |
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(module){ | |
var hop = Object.prototype.hasOwnProperty; | |
var urlEncode = function(flatObject) { | |
var result = []; | |
for (var p in flatObject) if (hop.call(flatObject,p)) { | |
result.push(encodeURIComponent(p)+'='+encodeURIComponent(flatObject[p])); | |
} | |
return result.join('&'); |
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
;; http://books.google.es/books?id=81mFK8pqh5EC&pg=PA177#v=onepage&q&f=false | |
;; http://pagesperso-systeme.lip6.fr/Christian.Queinnec/WWW/LiSP.html | |
;; src/chap5f.scm | |
(define (cps e) | |
(if (pair? e) | |
(case (car e) | |
((quote) (cps-quote (cadr e))) | |
((if) (cps-if (cadr e) (caddr e) (cadddr e))) | |
((begin) (cps-begin (cdr e))) |