| ⌘T | go to file |
| ⌘⌃P | go to project |
| ⌘R | go to methods |
| ⌃G | go to line |
| ⌘KB | toggle side bar |
| ⌘⇧P | command prompt |
This file contains hidden or 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
| ps -ef|grep node|grep -v grep|awk {'print $2'}|xargs kill -9 |
This file contains hidden or 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 onRequest(request, response) { | |
| var pathName = url.parse(request.url).pathname; | |
| handler[pathName]; | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.write("Hello World"); | |
| response.end(); | |
| } |
This file contains hidden or 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 onRequest(request, response) { | |
| var pathName = url.parse(request.url).pathname; | |
| handler[pathName]; | |
| response.writeHead(200, {"Content-Type": "text/plain"}); | |
| response.write("Hello World"); | |
| response.end(); | |
| } |
This file contains hidden or 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 JSONOnly(req, res, next) { | |
| console.log(req.header('accept')); | |
| console.log(req.is('json')); | |
| if (!req.is('json')) { | |
| res.send(406); | |
| } | |
| else { | |
| next(); | |
| } |
This file contains hidden or 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 lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Document</title> | |
| <style> | |
| body { | |
| background-color: #f1f4f9; | |
| padding: 50px; |
This file contains hidden or 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
| find . -type f -name *.flac -exec rm {} \; |
This file contains hidden or 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 tunkfiedSettimeOut(delay,index) { | |
| return function(cb) { | |
| console.log('index: ',index); | |
| setTimeout(function(){ | |
| cb(undefined,delay); | |
| },delay); | |
| } | |
| } | |
| tunkfiedSettimeOut(3000,1)(function(err,data){console.log("delay is", data)}); |
This file contains hidden or 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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
OlderNewer