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 vim /etc/redis/redis.conf | |
$ requirepass <password> | |
$ sudo service redis restart | |
$ redis-cli -h 127.0.0.1 -p 6379 -a <password> |
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
vagrant@homestead:~$ sudo apt-get update | |
vagrant@homestead:~$ git clone -b php7 https://github.com/phpredis/phpredis.git | |
vagrant@homestead:~$ sudo mv phpredis/ /etc/ | |
vagrant@homestead:~$ cd /etc/phpredis | |
vagrant@homestead:/etc/phpredis$ phpize | |
vagrant@homestead:/etc/phpredis$ ./configure | |
vagrant@homestead:/etc/phpredis$ make && make install | |
# Note This is an Extension You Need to Enable to Make it Work in Php 7 | |
# This First Command Will Allow You To Call PHPREDIS Facade in Browser |
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') |
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
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
// 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
/* 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
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
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
// 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 ''; | |
} |