This file contains hidden or 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
$ Jumbotron, style: styles.welcome.base, [ | |
$h2 'this is a catchy tagline' | |
$p 'here is a short mission statement, expanding on the tagline' | |
$hr() | |
$a href: '/demo', [ | |
$ Button, | |
bsStyle: 'primary' | |
bsSize: 'large' | |
'Try the demo' | |
] |
This file contains hidden or 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
window.$ = function(element, propsOrChildren, childrenIfProps){ | |
var props, children; | |
if ((propsOrChildren != null && propsOrChildren instanceof Array) || !(propsOrChildren instanceof Object)) { | |
props = null; | |
children = propsOrChildren; | |
} else { | |
props = propsOrChildren; | |
children = childrenIfProps; | |
} | |
return React.createElement(element, props, children); |
This file contains hidden or 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
# Since React has made jQuery obsolete for me, I use $ to replace JSX. | |
window.$ = React.create-element | |
for key, value of React.DOM | |
window."$#key" = value | |
# And here's an example of a render function using this syntax. | |
render: -> | |
$ Jumbotron, style: styles.welcome.base, [ | |
$h2 key: \tagline, 'this is a catchy tagline' | |
$p key: \mission, 'here is a short mission statement, expanding on the tagline' |
This file contains hidden or 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> | |
<title>This is the title of the webpage!</title> | |
</head> | |
<body> | |
<p>This is an example paragraph. Anything in the <strong>body</strong> tag will appear on the page, just like this <strong>p</strong> tag and its contents.</p> | |
</body> | |
</html> |
This file contains hidden or 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 http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>RuntimeError at /convert</title> | |
<script type="text/javascript"> | |
//<!-- | |
function toggle(id) { | |
var pre = document.getElementById("pre-" + id); |
This file contains hidden or 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
# constant array with the 100 most common words in English | |
COMMON_WORDS = ["the","be","to","of","and","a","in","that","have","i","it","for","not","on","with","he","as","you","do","at","this","but","his","by","from","they","we","say","hew","she","or","an","will","my","one","all","would","there","their","what","so","up","out","if","about","who","get","which","go","me","when","make","can","like","time","no","just","him","know","take","people","into","year","your","good","some","could","them","see","other","than","then","now","look","only","come","its","over","think","also","back","after","use","two","how","our","work","first","well","way","even","new","want","because","any","these","give","day","most","us"] | |
# these numbers are totally made up, so you'll probably want to tweak them | |
MINIMUM_FREQUENCY_FOR_THREE_WORD_PHRASES = 10 | |
MINIMUM_FREQUENCY_FOR_TWO_WORD_PHRASES = 20 | |
MINIMUM_FREQUENCY_FOR_SINGLE_WORDS = 30 | |
three_word_phrases = Array.new | |
two_word_phrases = Array.new |
NewerOlder