php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"\nphp -r "if (hash_file('sha384', 'composer-setup.php') === '48e3236262b34d30969dca3c37281b3b4bbe3221bda826ac6a9a62d6444cdb0dcd0615698a5cbe587c3f0fe57a54d8f5') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php --install-dir=/usr/local/bin --filename=composer
vim .zshrc
# https://laravel.com/docs/5.7
composer global require laravel/installer
vim .zshrc
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
location ~ ^/(phpfpm_status|phpfpm_ping)$ { | |
access_log off; | |
allow 127.0.0.1; | |
deny all; | |
fastcgi_pass php:9000; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
} | |
location /nginx_status { |
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
#!/bin/sh | |
if ( pmset -g batt | head -n 1 | grep 'AC Power' ); then | |
exit 0 | |
fi | |
battery_percent=$(pmset -g batt|grep InternalBattery | awk '{print $3}' | sed -e 's/%.*//') | |
battery_low=60 | |
if [ $battery_percent -lt $battery_low ]; then |
查阅了四个地方对 ujis/eucjp-ms 的描述,得到如下不同说法的比较:
byte range | mysql ctype-ujis.cc#L33162 comment |
mysql ctype-eucjpms.cc#L36410 comment |
EUCJP(来自wikipedia) | EUCJP亚种 - eucJP-ms (来自wikipedia) |
---|---|---|---|---|
[00..7F] |
ASCII [U+0000..U+007F] | ASCII/JIS-Roman(one-byte/character) | ASCII | ASCII |
[8E][A1..DF] |
JIS-X-0201 Katakana [U+FF61..U+FF9F] | half-width katakana(two bytes/char) | 半角片假名 (JIS X 0201) | 半角片假名 (JIS X 0201) |
[A1..FE][A1..FE] |
JIS-X-0208 | JIS X 0208:1997(two bytes/char) | JIS X 0208 | JIS X 0208字符集合之外还有: * [AD][A1..FE] NEC特殊文字 1面13区 * [F5..FE][A1..FE] 用户自定义文字(前半) 1面85区 - 94区 |
[8F][A1-FE][A1-FE] |
JIS-X-0212 | JIS X 0212-1990(three bytes/char) | JIS(JIS辅助汉字集合) (JIS X 0212) | JIS辅助汉字集合 (JIS X 0212)之外还有:* |
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
create table products ( | |
id bigint(20) NOT NULL AUTO_RANDOM, | |
name varchar(20), | |
price int(10), | |
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | |
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, | |
PRIMARY KEY (id)); | |
create table users ( | |
id bigint(20) NOT NULL AUTO_RANDOM, |
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
apiVersion: 1.0.0 | |
metadata: | |
generateName: php-tidb- | |
projects: | |
- name: crud-php | |
source: | |
type: git | |
location: 'https://github.com/che-samples/php-mysql' | |
components: | |
- type: chePlugin |
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
nl = document.querySelectorAll('textarea'); | |
for (var text of nl) { | |
if (text.disabled) continue; | |
var pre = document.createElement('PRE'); | |
pre.innerHTML = text.innerHTML; | |
pre.style.border = "solid 1px"; | |
pre.style.whiteSpace = "pre-wrap"; | |
text.parentElement.replaceChild(pre, text); | |
} |
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
mysqldump -h 127.0.0.1 -P3307 -uroot -p -B databasename --no-create-db --no-create-info --complete-insert --extended-insert=FALSE --skip-lock-tables > /tmp/insert.sql | |
gsed -i -e 's/^--.*//' -e 's/^\/\*.*//' -e 's/UNLOCK.*//' -e 's/LOCK TABLES.*//' /tmp/insert.sql | |
# map file for Convert underscore to PascalCase | |
egrep '`.*?`' /tmp/insert.sql -o | sort | uniq | gsed -e 's/`//g' > /tmp/mysql-words | |
cp /tmp/mysql-words /tmp/spanner-words | |
gsed -i -r 's/(^|_)([a-z])/\U\2/g' /tmp/spanner-words | |
paste /tmp/mysql-words /tmp/spanner-words > /tmp/map.txt |