Print the Fibonacci series (the first 10 values) separated by spaces. If you've ever taken a Computer Science class, you should be all over this one.
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
/** | |
* Gruntfile | |
* | |
* If you created your Sails app with `sails new foo --linker`, | |
* the following files will be automatically injected (in order) | |
* into the EJS and HTML files in your `views` and `assets` folders. | |
* | |
* At the top part of this file, you'll find a few of the most commonly | |
* configured options, but Sails' integration with Grunt is also fully | |
* customizable. If you'd like to work with your assets differently |
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
-----> Node.js app detected | |
-----> Resolving engine versions | |
Using Node.js version: 0.10.0 | |
Using npm version: 1.2.12 | |
-----> Fetching Node.js binaries | |
-----> Vendoring node into slug | |
-----> Installing dependencies with npm | |
npm info it worked if it ends with ok | |
npm verb cli [ '/tmp/node-node-wI96/bin/node', |
Provide methods to store
and retrieve
a JSON object in a cookie named "data". The store
method should stringify the JSON, and the retrieve
should parse back to an object. Cookie properties include: path
, domain
, and expires
. Properties should be somehow configurable (eg. params, a config
method). All properties should have default values: path
= "/", domain
= ".ae.com", expires
at the end of session.
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
# Replace any brackets with real values | |
# Try to ssh in to DREAMHOST (ensure it no longer asks for a PW); you may want to restart Terminal | |
ssh [user]@[host] | |
cd ~ | |
mkdir [mydomain_com].git | |
cd [mydomain_com].git | |
git init --bare | |
vi hooks/post-receive | |
# Enter the code from the "post-receive" file (in this gist); save + quit |
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 fs = require("fs") | |
, andOne = require(process.env.AEO_BIN + "/lib/andOne.js") | |
; | |
// ============== | |
// Define Actions | |
// ============== | |
module.exports = { | |
// Set the build infomation as the SVN CWD |
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> | |
<body> | |
<p>These should output "last", "ok", then "all" for 10 promises and then another 10.</p> | |
<div id="out"></div> | |
<script type="text/javascript" src="https://raw.github.com/briancavalier/when.js/dev/when.js"></script> | |
<script type="text/javascript" src="main.js"></script> | |
</body> | |
</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
// This should do a pretty good job of iterating through the following array | |
// and logging any values that == each other. Beware, this is scary stuff! | |
// http://benalman.com/news/2010/11/schrecklichwissen-terrible-kno/ | |
var arr = [true, 123, {}, {a:1}, [], [0], [123], "hi", function foo(){}, | |
/re/, false, 0, "", null, undefined, NaN]; | |
function pretty(v) { | |
var s = JSON.stringify(v); | |
return v == null ? v + "" : s === undefined ? v : s == "null" ? "NaN" : s; |