create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
if (!Array.prototype.shuffle) { | |
Array.prototype.shuffle = function() { | |
for(var j, x, i = this.length; i; j = parseInt(Math.random() * i), x = this[--i], this[i] = this[j], this[j] = x); | |
return this; | |
}; | |
} |
if(!Array.isArray) { | |
Array.isArray = function (vArg) { | |
return Object.prototype.toString.call(vArg) === "[object Array]"; | |
}; | |
} |
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function (searchElement /*, fromIndex */ ) { | |
"use strict"; | |
if (this == null) { | |
throw new TypeError(); | |
} | |
var t = Object(this); | |
var len = t.length >>> 0; | |
if (len === 0) { |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "your_email@youremail.com"
var walk = function(dir) { | |
var results = [] | |
var list = fs.readdirSync(dir) | |
list.forEach(function(file) { | |
file = dir + '/' + file | |
var stat = fs.statSync(file) | |
if (stat && stat.isDirectory()) results = results.concat(walk(file)) | |
else results.push(file) | |
}) | |
return results |
var styles = window.getComputedStyle(document.documentElement, ''); | |
var pre = (Array.prototype.slice.call(styles).join('').match(/-(moz|webkit|ms)-/) || (styles.OLink === '' && ['', 'o']) | |
)[1]; |
<?php | |
error_reporting(0); | |
//得到目录下的文件总数 | |
function get_file_count($dir_name){ | |
$files = 0; | |
if ($handle = opendir($dir_name)) { | |
while (false !== ($file = readdir($handle))) { | |
$files++; | |
} | |
closedir($handle); |
var stars = '✮✮✮✮✮✩✩✩✩✩'; | |
var score = function(len) { | |
return stars.substring(5 - len, 10 - len) | |
} | |
console.log(score(1)); | |
console.log(score(2)); | |
console.log(score(3)); | |
console.log(score(4)); |
// Open Script Editor and Export this as an Application | |
// | |
// Then drop a keynote file on it in the Finder and it will properly resize | |
// and rotate everything so the Keynote file becomes usable as a prototype | |
// in the iPhone keynote app | |
// rotateDocument exported function | |
// | |
// Accepts a Keynote document and will rotate | |
// all the slides and elements in the slide 90 degrees |
var listenerIsActive = true, | |
requestFilter = { | |
urls: [ "<all_urls>" ] | |
}, | |
extraInfoSpec = ['requestHeaders','blocking'], | |
handler = function( details ) { | |
var headers = details.requestHeaders, | |
blockingResponse = {}; | |