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
#todo1: fs.readdirで取ったメンバがファイル/ディレクトリかチェックし、ディレクトリなら再帰 | |
#todo2: errorをキャッチする | |
{exec} = require 'child_process' | |
{readdir} = require 'fs' | |
# | |
Sourcefile = [] | |
# | |
task "coffee", "compile and minify #{Sourcefile}.coffee", (options) -> | |
readdir process.cwd(), (err,files)-> | |
Sourcefile = files |
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
# | |
# Module Dependencies | |
# | |
{exec} = require 'child_process' | |
fs = require 'fs' | |
path = require 'path' | |
jade = require 'jade' | |
stylus = require 'stylus' | |
nib = require 'nib' |
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 ContactCtrl($scope, $http) { | |
$scope.success = false; | |
$scope.httpError = false; | |
$scope.send = function() { | |
var job = { job: { klass: 'msg', args: [$scope.msg]}}; | |
$http.post('/contact',job). | |
success(function(data){ | |
$scope.success = true; | |
$scope.msg = {}; |
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
window.stoppingPropagation = (callback) -> (e) -> | |
e.stopPropagation() | |
callback(e) | |
angular.module('myApp',[]).directive 'ngTap', -> | |
(scope, element, attrs) -> | |
tapping = false | |
element.bind 'touchstart', stoppingPropagation (e) -> tapping = true | |
element.bind 'touchmove', stoppingPropagation (e) -> tapping = false | |
element.bind 'touchend', stoppingPropagation (e) -> scope.$apply(attrs['ngTap']) if tapping |
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
/* 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 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
express = require('express') | |
app = module.exports = express.createServer() | |
app.configure -> | |
app.set 'views', __dirname + '/views' | |
app.set 'view engine', 'jade' | |
app.use express.bodyParser() | |
app.use express.methodOverride() | |
app.use app.router |
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
// database.js | |
sys = require('sys'); | |
var mongo = require('./lib/node-mongodb-native/lib/mongodb'), | |
Connection = mongo.Connection, | |
Server = mongo.Server, | |
BSON = mongo.BSONNative; | |
var host = process.env['MONGO_NODE_DRIVER_HOST'] != null ? process.env['MONGO_NODE_DRIVER_HOST'] : 'localhost'; | |
var port = process.env['MONGO_NODE_DRIVER_PORT'] != null ? process.env['MONGO_NODE_DRIVER_PORT'] : Connection.DEFAULT_PORT; |