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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>CodePen · Pen</title> | |
<!-- | |
Copyright (c) 2012 Mahroof Ali, http://codepen.io/anon | |
Permission is hereby granted, free of charge, to any person obtaining |
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
/* | |
* Normalize.css converted to Stylus | |
* http://github.com/necolas/normalize.css | |
*/ | |
article, aside, details, figcaption, figure, footer, header, hgroup, nav, section | |
display: block | |
audio, canvas, video | |
display: inline-block |
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
while true; do | |
change=$(inotifywait -e close_write,moved_to,create .); | |
change=${change#./ * }; | |
if [ "$change" = "style.styl" ]; then | |
echo $(date); stylus style.styl -o ../..; | |
fi; | |
done |
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
'use strict'; | |
/** | |
* Indicates an error where an invalid argument or input to a method. | |
* @param {string} message The error message. | |
* @param {string} stack The stack trace. | |
*/ | |
function InvalidArgumentException(message, stack) { | |
this.name = 'InvalidArgumentException'; | |
this.message = message || 'Invalid Argument'; |
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 parseUrl = function(url) { | |
var parser, urlInfo; | |
parser = document.createElement('a'); | |
parser.href = url; | |
urlInfo = { | |
protocol: parser.protocol, | |
hostname: parser.hostname, | |
port: parser.port, |
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
// Have to use an object so that count can function as a reference | |
var loadQueue = { | |
count:0 | |
} | |
/** | |
* Preloads videos | |
* | |
* If limit has been reached video is not preloaded but an |
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 ContentEditable = React.createClass({ | |
shouldComponentUpdate: function(nextProps){ | |
return nextProps.html !== this.getDOMNode().innerHTML; | |
}, | |
componentDidUpdate: function() { | |
if ( this.props.html !== this.getDOMNode().innerHTML ) { | |
this.getDOMNode().innerHTML = this.props.html; | |
} |
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 e = new Error('dummy'); | |
var stack = e.stack.replace(/^[^\(]+?[\n$]/gm, '') | |
.replace(/^\s+at\s+/gm, '') | |
.replace(/^Object.<anonymous>\s*\(/gm, '{anonymous}()@') | |
.split('\n'); | |
console.log(stack); |
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 to wrap long strings | |
# Source: http://stackoverflow.com/a/7367534/496488 | |
wrap_strings <- function(vector_of_strings,width) { | |
as.character( | |
sapply(vector_of_strings, FUN=function(x) { | |
paste(strwrap(x, width=width), collapse="\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
;; Datomic example code | |
;; demonstrates various update scenarios, using a news database | |
;; that contains stories, users, and upvotes | |
;; grab an in memory database | |
(use '[datomic.api :only (q db) :as d]) | |
(def uri "datomic:mem://foo") | |
(d/create-database uri) | |
(def conn (d/connect uri)) |
OlderNewer