#Yoeman, bower, grunt.js cli tool usage
Installation, node.js
and npm
are required.
npm install -g yo grunt-cli bower
compass is a sass compoments of ruby, and you can install compass
by rubygem
gem install compass
module.exports = function (app, r) { | |
r.addRoute('/', 'get', [ | |
function (req, res) { | |
res.send({status: 'ok', msg: 'you did it.'}); | |
} | |
]); | |
r.addRoute('/test', 'get', [ | |
function (req, res) { | |
res.send({status: 'ok', msg: 'route: /test you did it.'}); |
var fs = require('fs'); | |
var file = __dirname + '/test.json'; | |
fs.readFile(file, 'utf8', function (err, data) { | |
if (err) { | |
console.log('Error: ' + err); | |
return; | |
} |
window.onerror = function(message, file, line) { | |
var sFormattedMessage = '[' + file + ' (' + line + ')] ' + message; | |
_gaq.push(['_trackEvent', 'Exceptions', 'Application', sFormattedMessage, null, true]); | |
} |
var socket = io.connect(); | |
socket.on('news', function (data) { | |
console.log(data); | |
socket.emit('my other event', { my: 'data' }); | |
}); |
// remove a room key | |
client.on('disconnect', function (data) { | |
var key = room.indexOf(client.id);; | |
room.splice(key, 1); | |
io.sockets.socket(adminId).emit('query-room-list', room); | |
}); |
var http = require('http') | |
http.createServer(function (req, res) { | |
(function () { | |
res.write('hello world \n'); | |
setTimeout(arguments.callee, 500); | |
})(); | |
}).listen(3000, '127.0.0.1'); |
var express = require('express'), | |
routes = require('./routes'), | |
http = require('http'), | |
server; | |
var app = express(); | |
app.configure(function(){ | |
app.set('port', process.env.PORT || 3000); | |
app.set('views', __dirname + '/views'); |
#Yoeman, bower, grunt.js cli tool usage
Installation, node.js
and npm
are required.
npm install -g yo grunt-cli bower
compass is a sass compoments of ruby, and you can install compass
by rubygem
gem install compass
var Speakers = [ | |
{ | |
"name": "Kuro Hsu", | |
"job": "", | |
"topic": "Optimizing Your Mobile Web Apps." | |
}, | |
{ | |
"name": "Paul Li", | |
"job": "", | |
"topic": "樸實與浮華 (Plain and Vanity)" |
$lolcommits --disable | |
dyld: Library not loaded: /usr/local/lib/libjpeg.8.dylib | |
Referenced from: /usr/local/bin/mogrify | |
Reason: image not found | |
/Library/Ruby/Gems/1.8/gems/mini_magick-3.5.0/lib/mini_magick.rb:26:in `image_magick_version': private method `split' called for nil:NilClass (NoMethodError) | |
from /Library/Ruby/Gems/1.8/gems/mini_magick-3.5.0/lib/mini_magick.rb:34:in `valid_version_installed?' | |
from /Library/Ruby/Gems/1.8/gems/lolcommits-0.4.3/lib/lolcommits/configuration.rb:137:in `valid_imagemagick_installed?' | |
from /Library/Ruby/Gems/1.8/gems/lolcommits-0.4.3/bin/lolcommits:43:in `die_on_fatal_conditions!' |