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
var Crypto = require('crypto'); | |
function generateUUID() { | |
var current_date = (new Date()).valueOf().toString(); | |
var random = Math.random().toString(); | |
var num = Crypto.createHash('sha1').update(current_date + random).digest('hex'); | |
return num; | |
} | |
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
There are many ways to open a new buffer with no name, the simplest of which is :new. | |
:new will create a split window with an unnamed buffer. | |
:enew will open one in the current window. | |
:vnew will open one in a vertically split window. | |
:tabnew will open one in a new tab. |
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> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
</style> | |
</head> |
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
//开根号 | |
var sqrt = Math.pow(value, 1/2); |
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
var viewportwidth; | |
var viewportheight; | |
// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight | |
if (typeof window.innerWidth != 'undefined') { | |
viewportwidth = window.innerWidth, | |
viewportheight = window.innerHeight | |
} |
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 ForDight(Dight,How){ | |
Dight = Math.round(Dight*Math.pow(10,How))/Math.pow(10,How); | |
return Dight; | |
} |
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
1.npm install connect --save | |
2.touch server.js | |
var connect = require('connect'); | |
connect().use(connect.static(__dirname)).listen(8080); | |
3.node server.js | |
4.visit localhost:8080 |
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
git checkout --orphan gh-pages | |
add files of your project pages | |
git commit -a -m "First pages commit" | |
git push origin gh-pages | |
username.github.io/projectname |
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
# First install tmux | |
brew install tmux | |
# For mouse support (for switching panes and windows) | |
# Only needed if you are using Terminal.app (iTerm has mouse support) | |
Install https://github.com/norio-nomura/EasySIMBL/ | |
Then install https://bitheap.org/mouseterm/ | |
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/ |
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
JSON.parse(JSON.stringify(obj_json)); |
OlderNewer