有时候不小心在git中rm了文件。怎么恢复呢?别急,咱们一步步来。
首先git status一把,看看此时工作区的状态
git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: system......
#
如果我们想要恢复,怎么办呢?
git checkout -- system
这样一般就可以了,如果发现有报错:
error: pathspec 'system' did not match any file(s) known to git.
那怎么办呢?可以用下面的方法:
git reset HEA… Read More
作为一名开发人员,在日常的工作中会难以避免地接触到数据库,无论是基于文件的 sqlite 还是工程上使用非常广泛的 MySQL、PostgreSQL,但是一直以来也没有对数据库有一个非常清晰并且成体系的认知,所以最近两个月的时间看了几本数据库相关的书籍并且阅读了 MySQL 的官方文档,希望对各位了解数据库的、不了解数据库的有所帮助。
本文中对于数据库的介绍以及研究都是在 MySQL 上进行的,如果涉及到了其他数据库的内容或者实现会在文中单独指出。
数据库的定义
很多开发者在最开始时其实都对数据库有一个比较模糊的认识,觉得数据库就是一堆数据的集合,但是实际却比这复杂的多,数据库领域中有两个词非常容易混淆,也就是数… Read More
第一步:添加下面的代码到 /etc/apache2/sites-available/000-default.conf 或者 /etc/httpd/conf/httpd.conf
Add these lines to the Apache configuration file (/etc/apache2/sites-available/000-default.conf or /etc/httpd/conf/httpd.conf):
/etc/apache2/sites-available/000-default.conf – On Ubuntu
<Directory /usr/share/phpmyadmi… Read More
PHP extensions in JavaScript
项目地址:https://github.com/kvz/locutus
直接下载:php.js
npm 安装
npm install locutus
Use
vim index.js
var sprintf = require('locutus/php/strings/sprintf')
var echo = require('locutus/php/strings/echo')
var effectiveness = 'futile'
echo(sprintf('Resistance is %s', effectiveness))
var strings = require(… Read More
如何查看当前上传文件大小的限制 How to Check Your Maximum File Upload Size Limit in WordPress?
直接看下图:WordPress will automatically show the maximum file upload size limit when you are uploading images or media. To check it you can simply go to Media » Add New page and you will see the maximum file uplaod size limit for your WordPress site.
默认其实是 2MB的上传量,修改的方法如下:
方法1: 修改主…
错误描述:
Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'support_desk.mod_users_groups.group_id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
解决方法,即使取消(disable) only_full_group_by
方法1: 在mysql命令行:
mysql> set g… Read More
项目地址:https://github.com/scottbedard/shipping
USPS Shipping Calculator
安装 Instructions
注册web tools ID:The first step to requesting a shipping quote is injecting your USPS Web Tools ID.
use Bedard\Shipping\Usps;
$shipment = new Usps('YOUR-WEB-ID');
If you would like to run the calculator on the USPS testing server, call useTesting… Read More