`
文章列表

js获取url参数

function getRequest() { var url = location.search; //获取url中"?"符后的字串 var theRequest = new Object(); if (url.indexOf("?") != -1) { var str = url.substr(1); strs = str.split("&"); for(v ...

gogs

gogs 安装 1. 下载二进制安装包 2. 新建git用户 su git 切换过去 mkdir ~/.ssh chmod 700 ~/.ssh 3. 解压到 /home/git/gogs 4. 导入数据库 mysql -u root -p < scripts/mysql.sql 新建用户名 5. 本地打开ipalbes端口,同时阿里云需要去安全组打开3000端口, vim /etc/sysconfig/iptables service iptables restart 6. 新建数据库用户gogos > create us ...

复制数据库

  CREATE DATABASE `newdb` DEFAULT CHARACTER SET utf8mb4;   mysqldump --socket=--socket=/data2/mysql/mysql.sock -uroot -p123456 olddb| mysql -h192.168.1.2 -uroot -p123456 newdb    

重写alert

/** * http://www.jianshu.com/p/1fa9c8e8894c 使用了bootstrap框架,所以要引入bootstrap框架 * msg string 消息内容 * title string 对话框标题 * callback function 返回函数。在隐藏并且CSS动画结束后触发 **/ window.alert = function (msg, title, callback) { if (!title) { title = '对话框'; } var dialogHTML = '< ...
//修改最大执行时间  ini_set("max_execution_time", 120); // s 秒   //修改此次的最大运行内存  ini_set("memory_limit", 524288000); // Byte 512M
http://www.eifr.com/article.php?id=1460
http://oneinstack.com/
// vendor/laravel/framework/src/Illuminate/Session/Store.php // 添加下面方法,然后在需要的地方,Session::hasSession() public function hasSession(){ return $this->handler->read($this->getId()) ? true : false; } // public function resetId($id) { $this->flush(); ...
if ($request_uri ~* "/(v\d+)/.*" ) { set $version $1; } root /home/code/php/potato/$version/food/public;  
  用composer ,不需要再自己Google开源扩展(not find...),自己下载(slow...),自己整合到项目框架里了。代替 pear。   有官方的服务器http://www.phpcomposer.com(中国镜像),整合了php常用的开源扩展   怎么用?1.下载一个安装文件叫composer, 2.在你的项目文件下,简单配置一个json格式的文件,定义你项目需要的包名(包名还是要自己去看的),执行composer命令 就自动把开源代码下载到了你的本地。 3.在你项目的框架入口写一行 “autoload” 的代码就能用了。看这个入门http://my.o ...
  1.更改密码 ssh root@127.0.0.1 passwd //使用随机密码串 重要服务器使用 公钥/私钥,关闭密码登录   2.设置用户组 groupadd development useradd -g development develop passwd develop // 预置123456 ,然后让个人登陆后自行设置密码 chage -d 0 zhaozhonglin // 强制个人登陆后自行设置密码 usermod -U zhaozhonglin   3.生产机器禁止ROOT远程SSH登录:  vi /etc/ssh/sshd_config ...
#--- start # 新建表 create table sp2_match_comment_tmp like sp2_match_comment; # 这种方式 外键索引,触发器不会在新表中有,要自己添加 LOCK TABLES sp2_match_comment write, sp2_match_comment AS smc2 read, sp2_match_comment_tmp write; # 导出最新数据到新表 insert into sp2_match_comment_tmp select * from sp2_match_comment wh ...
find . -name "*~" -type f -print -exec rm -rf {} \;   
单一职责 高内聚,低耦合 中意于组合而不是继承 依赖于接口而不是实现  
https://github.com/amfe/article/issues/21?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io    
Global site tag (gtag.js) - Google Analytics