Month: February 2019

git 报错:See “git help gc” for manual housekeeping, Git error: Unable to append to .git/logs/refs/remotes/origin/master: Permission denied

  See “git help gc” for manual housekeeping——解决办法   最近执行git命令的时候,发现下面错误 错误信息如下 Auto packing the repository in background for optimum performance. See "git help gc" for manual housekeeping.   解决办法,输入下面两条命令即可, git fsck 然后 git gc --prune=now   Git error: Unable to append to .git/logs/refs/remotes/origin/master: P… Read More

使用pushState()改变url而不刷新, ajax与HTML5 history pushState/replaceState实例, 详解history.pushState和history.replaceState以及page ajax的实现

  我们使用location.hash来模拟ajax的前进后退功能。使用location.hash存在下面几个问题: 1.使用location.hash会导致地址栏的url发生变化,用户体验不够友好。 2.location.hash产生的历史记录无法修改,每次hash改变都会导致产生一个新的历史记录。 3.location.hash只是1个字符串,不能存储很多状态相关的信息。 为了解决这些问题,HTML5中引入了history.pushState()、history.replaceState()、popstate事件来处理浏览器历史记录的问题。下面的代码可以达到跟location.hash相同… Read More

命令行添加mysql用户, 命令行添加新phpmyadmin登录, Access denied for user ‘test’@’localhost’ (using password: YES) except root user, Your password does not satisfy the current policy requirements

  进入 mysql sudo mysql   创建用户: mysql> CREATE USER 'ikeepstudying'@'localhost' IDENTIFIED BY 'password';   如果有报错: ERROR 1819 (HY000): Your password does not satisfy the current policy requirements   那么就查看 mysql 密码默认的要求: mysql> SHOW VARIABLES LIKE 'validate_password%';   根据要求来创建用户密码。 如果你想修改用户密码的要求,可以用: SET GLOBA… Read More

linux 配置php环境变量, php getenv 获取环境变量, 自定义 php 环境变量, ubuntu配置环境变量

标准做法是把 环境变量文件 放在 /etc/profile.d/ 目录下 例如,我生成了一个google adwords的配置文件,文件名是  google-adwords-php.sh export developerToken="my-google-token" export clientCustomerId="my-google-userid" export clientId="my-google-clientid" export clientSecret="my-google-clientsecret" export refreshToken="my-google-refresh-token"   把 google… Read More