燕雀笔记博
ww111 · 共 164 篇文章
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(var i = 0; i < strs.length; i ++) { theRequest[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]); } } return theR…
2017-11-15 10:05 · 前端 js · 评论(0)
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 user 'gogs'@'127.0.0.1' identified b…
2017-09-25 19:55 · linux php · 评论(0)
复制数据库
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
2017-05-16 10:50 · linux mysql · 评论(0)
重写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 = '<div id="selfAlert" class="modal fade">';…
2017-03-16 14:27 · 前端 js · 评论(0)
修改 最大执行时间
//修改最大执行时间 ini_set("max_execution_time", 120); // s 秒 //修改此次的最大运行内存 ini_set("memory_limit", 524288000); // Byte 512M
2016-12-26 11:05 · linux php · 评论(0)
laravel 自定义 检查 session 数据是否存在
// 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(); $this->id = $id; if($this->hasSession()){ $this->loadSe…
nginx根据url指定root目录
if ($request_uri ~* "/(v\d+)/.*" ) { set $version $1; } root /home/code/php/potato/$version/food/public;
2016-03-02 13:58 · linux nginx · 评论(0)
简单易懂 composer是干嘛的
用composer ,不需要再自己Google开源扩展(not find...),自己下载(slow...),自己整合到项目框架里了。代替 pear。 有官方的服务器http://www.phpcomposer.com(中国镜像),整合了php常用的开源扩展 怎么用? 1.下载一个安装文件叫composer, 2.在你的项目文件下,简单配置一个json格式的文件,定义你项目需要的包名(包名还是要自己去看的),执行composer命令 就自动把开源代码下载到了你的本地。 3.在你项目的框架入口写一行 “autoload” 的代码就能用了。 看这个入门http://my.oschina.net/…
新服务器初始化
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 PermitRootLogin yes 改为…
mysql 备份表的一个方法
#--- 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 where id > (select…
2016-01-19 11:51 · linux mysql · 评论(0)
15年双11手淘前端技术巡演 - H5性能最佳实践
https://github.com/amfe/article/issues/21?hmsr=toutiao.io&utm_medium=toutiao.io&utm_source=toutiao.io