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
Capitalized, short (50 chars or less) summary | |
More detailed explanatory text, if necessary. Wrap it to about 72 | |
characters or so. In some contexts, the first line is treated as the | |
subject of an email and the rest of the text as the body. The blank | |
line separating the summary from the body is critical (unless you omit | |
the body entirely); tools like rebase can get confused if you run the | |
two together. | |
Write your commit message in the imperative: "Fix bug" and not "Fixed bug" |
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
#export | |
mongoexport -d <database> -c <collection> --type=json -f <field1>,<field2> -o </path/to/collection.json> | |
#import | |
mongoimport -d <database> -c <collection> --type=json -u <username> -p <password> --headerline --file </path/to/collection.json> |
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
// http://taobaofed.org/blog/2015/10/28/jstracker-how-to-collect-data/ | |
var is360 = function(){ | |
try { | |
if(/UBrowser/i.test(navigator.userAgent)){ | |
return ''; | |
} | |
if (typeof window.scrollMaxX !== 'undefined') { | |
return ''; | |
} |
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
weixin://dl/stickers | |
weixin://dl/games | |
weixin://dl/moments | |
weixin://dl/add | |
weixin://dl/shopping | |
weixin://dl/groupchat | |
weixin://dl/scan | |
weixin://dl/profile | |
weixin://dl/settings | |
weixin://dl/general |
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
app/ | |
----- shared/ // acts as reusable components or partials of our site | |
---------- sidebar/ | |
--------------- sidebarDirective.js | |
--------------- sidebarView.html | |
---------- article/ | |
--------------- articleDirective.js | |
--------------- articleView.html | |
----- components/ // each component is treated as a mini Angular app | |
---------- home/ |
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
/* Simple JavaScript Inheritance | |
* By John Resig http://ejohn.org/ | |
* MIT Licensed. | |
*/ | |
// Inspired by base2 and Prototype | |
(function(){ | |
var initializing = false, fnTest = /xyz/.test(function(){xyz;}) ? /\b_super\b/ : /.*/; | |
// The base Class implementation (does nothing) | |
this.Class = function(){}; |
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
// http://oldj.net/article/one-thing-to-notice-about-new-image/ | |
var img = new Image(); | |
var rnd_id = "_img_" + Math.random(); | |
window[rnd_id] = img; // 全局变量引用 | |
img.onload = img.onerror = function () { | |
window[rnd_id] = null; // 删除全局变量引用 | |
} | |
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 parseURL(url) { | |
var parser = document.createElement('a'), | |
searchObject = {}, | |
queries, split, i; | |
// Let the browser do the work | |
parser.href = url; | |
// Convert query string to object | |
queries = parser.search.replace(/^\?/, '').split('&'); | |
for( i = 0; i < queries.length; i++ ) { | |
split = queries[i].split('='); |
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
sudo chown -RL root:mysql /usr/local/mysql | |
sudo chown -RL mysql:mysql /usr/local/mysql/data | |
sudo /usr/local/mysql/support-files/mysql.server start |
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 admin | |
> db.createUser({user: 'root',pwd: '123456',roles: ['root']}) | |
> db.auth('root','123456') | |
> use page_factory | |
> db.createUser({user: 'user',pwd: '123456',roles: [{role: 'readWrite', db: 'dbName'}]}) | |
> db.auth('user','123456') |