ctrl + a Goto BEGINNING of command line
ctrl + e Goto END of command line
ctrl + b move back one character
ctrl + f move forward one character
| // config/passport.js | |
| // load all the things we need | |
| var LocalStrategy = require('passport-local').Strategy; | |
| var mysql = require('mysql'); | |
| var connection = mysql.createConnection({ | |
| host : 'localhost', | |
| user : 'root', |
| 'use strict'; | |
| var mysqlBackup = require('./mysql-backup'); | |
| var schedule = require('node-schedule'); | |
| schedule.scheduleJob({ hour: 22, minute: 0 }, mysqlBackup); |
| '*** A simple MsWord->Markdown replacement macro by Kriss Rauhvargers, 2006.02.02. | |
| '*** This tool does NOT implement all the markup specified in MarkDown definition by John Gruber, only | |
| '*** the most simple things. These are: | |
| '*** 1) Replaces all non-list paragraphs to ^p paragraph so MarkDown knows it is a stand-alone paragraph | |
| '*** 2) Converts tables to text. In fact, tables get lost. | |
| '*** 3) Adds a single indent to all indented paragraphs | |
| '*** 4) Replaces all the text in italics to _text_ | |
| '*** 5) Replaces all the text in bold to **text** | |
| '*** 6) Replaces Heading1-6 to #..#Heading (Heading numbering gets lost) | |
| '*** 7) Replaces bulleted lists with ^p * listitem ^p* listitem2... |
| var http = require('http'); | |
| var fs = require('fs'); | |
| http.createServer(function(request, response){ | |
| response.writeHead(200); | |
| fs.readFile('index.html', function(err, contents){ | |
| response.write(contents); | |
| response.end(); | |
| }); | |
| }).listen(8080); |
| $ sudo ntpdate pool.ntp.org | |
| $ sudo service ntp stop | |
| $ sudo ntpdate pool.ntp.org | |
| $ sudo service ntp start | |
| $ sudo ntpdate -u pool.ntp.org |
| # xcode-select --print-path => https://developer.apple.com/downloads | |
| ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
| brew install caskroom/cask/brew-cask | |
| brew install node | |
| npm install npm -g |
| 'use strict'; | |
| // simple express server | |
| var express = require('express'); | |
| var app = express(); | |
| var router = express.Router(); | |
| app.use(express.static('public')); | |
| app.get('/', function(req, res) { | |
| res.sendfile('./public/index.html'); |