create an empty project and add a Gemfile
cd ~/Desktop
mkdir project-name
cd project-name
touch Gemfile
/** | |
* Lodash mixins for combinatorics | |
* by: wassname & visangela | |
* url: https://gist.github.com/wassname/a882ac3981c8e18d2556/edit | |
* lodash contrib issue: https://github.com/node4good/lodash-contrib/issues/47 | |
* lic: same as lodash | |
* Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html | |
* | |
* Usage: | |
* permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]] |
AWS = require 'aws-sdk' | |
s3 = new AWS.S3() | |
bucketName = 'lambda-test' | |
region = 'us-east-1' | |
key = 'testData.json' | |
module.exports = (event, context) -> | |
console.log JSON.stringify(event, null, 2) | |
console.log 'From SNS:', event.Records[0].Sns.Message |
Create VPC | |
Create Security Group | |
Create incoming and outgoing rules for SSH, HTTP, Sinatra and Rackup, 443 | |
Create Key Pair | |
cd ~/.ssh | |
mv ~/Downloads/Turing.pem . | |
chmod 400 Turing.pem | |
ssh-add -k Turing.pem | |
Launch Instance | |
ubuntu 14.04 |
var express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/test', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
var application_root = __dirname, | |
express = require("express"), | |
path = require("path"), | |
mongoose = require('mongoose'); | |
var app = express.createServer(); | |
// database | |
mongoose.connect('mongodb://localhost/ecomm_database'); |
/* The API controller | |
Exports 3 methods: | |
* post - Creates a new thread | |
* list - Returns a list of threads | |
* show - Displays a thread and its posts | |
*/ | |
var Thread = require('../models/thread.js'); | |
var Post = require('../models/post.js'); |
This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo
bundle install
mate Guardfile
bundle exec jasmine init
mate spec/support/yasmine.ym
bundle exec guard