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
<h1> I am | |
<div id="rotate"> | |
<div>awesome.</div> | |
<div>invincible.</div> | |
<div>unbeatable.</div> | |
<div>indestructible.</div> | |
</div> | |
</h1> |
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
var text = "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse iaculis nunc a quam condimentum, eget vestibulum magna aliquet. Cras a quam id odio congue viverra id nec purus. Proin in pharetra arcu. Aliquam vel vulputate urna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla nec rutrum sem. Praesent a mi metus. Integer vitae facilisis nulla, a lacinia velit. Quisque tempor varius lectus nec finibus. Sed quis quam tempor justo mattis mattis. Proin vel ante risus. Sed maximus scelerisque commodo. Pellentesque ut placerat nisi."; | |
function findMostCommonWordInText(text) { | |
var wordCounter = {}, | |
max = 1, | |
mostCommonWord = ""; | |
text.split(" ").forEach(function(word) { | |
if (wordCounter[word]) { | |
wordCounter[word] += 1; |
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
/** | |
* Get an array containing the text nodes within a DOM node. | |
* | |
* From http://stackoverflow.com/a/4399718/843621 | |
* | |
* For example get all text nodes from <body> | |
* | |
* var body = document.getElementsByTagName('body')[0]; | |
* | |
* getTextNodesIn(body); |
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
// Basic XMPP bot example for HipChat using node.js | |
// To use: | |
// 1. Set config variables | |
// 2. Run `node hipchat_bot.js` | |
// 3. Send a message like "!weather 94085" in the room with the bot | |
var request = require('request'); // github.com/mikeal/request | |
var sys = require('sys'); | |
var util = require('util'); |
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
#ajaxBusy { | |
display:none; | |
position: fixed; | |
z-index:999999; | |
height:99%; | |
width:99%; | |
background: url(../img/loading-icon-trans.gif) no-repeat 50% 50%; | |
} |