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
<p> | |
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec fermentum | |
nec ante eget suscipit. Nullam gravida viverra quam a maximus. Proin nunc | |
massa, auctor id arcu a, imperdiet placerat tortor. Maecenas eget tristique | |
odio. Nullam fermentum orci erat, sed ultrices nunc volutpat sit amet. Duis | |
id nunc nisi. Morbi placerat eros in pretium dignissim. Mauris lacinia, | |
diam vitae euismod cursus, ligula ex vehicula nulla, vitae convallis nibh | |
sem ac velit. Nulla facilisi. Ut consectetur id mauris nec fermentum. Cras | |
nec cursus justo. Donec tempus quam nunc, sed faucibus lacus vulputate vel. | |
Integer egestas ex ut neque tristique dictum. Phasellus ut nulla mauris. |
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(root, factory) { | |
if (typeof define === 'function' && define.amd) { | |
define(zt); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.zt = factory(); | |
} | |
})(this, function() { | |
var zt = function(tag) { |
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(root, factory) { | |
if (typeof define === 'function') { | |
define(factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.Zync = root.$ = factory(); | |
} | |
})(this, function() { | |
function fromMarkup(markup) { |
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
-- How I should be able to define a model | |
tasks :: [a] -> Either a a -> [a] | |
tasks ts = either (:ts) (`delete` ts) | |
-- How I should be able to define an event stream | |
eventStream = scanl tasks . map (Left . getValue . getTarget) . filter ((== 13) . getWhich) | |
main = someWayToSelectElementAndMakeEventStreams "#input-box" "keydown" | |
>>= eventStream | |
>>= mapM renderMyList |
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 LambdaCase #-} | |
{-# LANGUAGE TupleSections #-} | |
import System.Environment (getArgs) | |
import System.Exit (ExitCode(..), exitWith) | |
import Data.Maybe (listToMaybe, fromMaybe) | |
import Data.Fixed (mod', div') | |
showDouble :: Double -> String | |
showDouble n = if n `mod'` 1 == 0 then show (n `div'` 1) else show n |
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(root, factory) { | |
if (typeof define === 'function') { | |
define(factory); | |
} else if (typeof exports === 'object') { | |
module.exports = factory(); | |
} else { | |
root.RL = factory(); | |
} | |
})(this, function() { | |
var run = function(code, stack, dict) { |
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 Data = function(first, second, third, fourth, fifth, sixth, seventh) { | |
return function(iterator) { | |
return iterator(first, second, third, fourth, fifth, sixth, seventh); | |
}; | |
}; | |
// or more elegantly | |
var Data = function(a, b, c, d, e, f, g) { | |
return function(fn) { | |
return fn(a, b, c, e, f, g); |
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 Tuple(a, b, c, d, e, f, g) { | |
function tuplable(transformer) { | |
return transformer(a, b, c, d, e, f, g); | |
}; | |
tuplable.toString = function() { | |
return 'Tuple (' + [a, b, c, d, e, f, g].filter(function(item) { | |
return item != null; | |
}).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
var parser = require('body-parser') | |
, config = require('./config') | |
, express = require('express') | |
, morgan = require('morgan') | |
, _ = require('lodash') | |
, path = require('path') | |
; | |
var app = module.exports = express(); |
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 Game = React.createClass({ | |
render: function() { | |
var x = this.props.x, | |
y = this.props.y; | |
return ( | |
<svg width={Math.max(x + 10, 200)} height={height: Math.max(y + 10, 200)}> | |
<circle cx={50} cy={50} r={2} fill="#000" /> | |
<circle cx={x} cy={y} r={2} fill="#000" /> | |
<line x1={50} y1={50} x2={x} y2={y} stroke="#000" /> |