most of these require logout/restart to take effect
# Enable character repeat on keydown
defaults write -g ApplePressAndHoldEnabled -bool false
# Set a shorter Delay until key repeat
-- 1、为查询结果自动编号: | |
select | |
(@rowNO := @rowNo+1) AS rowno, | |
user_name | |
from ( | |
select | |
wu.screen_name as user_name | |
from base_wb_ids_pr_hobbies mt | |
left join base_wb_user wu | |
on mt.uid = wu.id |
# Let us consider the following typical mysql backup script: | |
mysqldump --routines --no-data -h $mysqlHost -P $mysqlPort -u $mysqlUser -p$mysqlPassword $database | |
# It succeeds but stderr will get: | |
# Warning: Using a password on the command line interface can be insecure. | |
# You can fix this with the below hack: | |
credentialsFile=/mysql-credentials.cnf | |
echo "[client]" > $credentialsFile | |
echo "user=$mysqlUser" >> $credentialsFile | |
echo "password=$mysqlPassword" >> $credentialsFile |
<?php | |
/** | |
* Get browser language, given an array of avalaible languages. | |
* | |
* @param [array] $availableLanguages Avalaible languages for the site | |
* @param [string] $default Default language for the site | |
* @return [string] Language code/prefix | |
*/ | |
function get_browser_language( $available = [], $default = 'en' ) { | |
if ( isset( $_SERVER[ 'HTTP_ACCEPT_LANGUAGE' ] ) ) { |
Hierarchical data metrics that allows fast read operations on tree like structures.
Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.
#!/bin/bash | |
# Credentials | |
## inspired by: https://github.com/guttertec/lftp-sync/blob/master/sync.sh | |
## inspired by: http://www.torrent-invites.com/showthread.php?t=132965&s=a5f6146c4e37fbcce4529ecd93c1989e | |
## inspired by: http://sourceserver.info/wiki/tutorial/root/abgleich_ftp | |
## lftp manpage: http://lftp.yar.ru/lftp-man.html | |
# Check if sync.cfg can be found and no parameters are missing | |
if [ ! sync.cfg ]; then echo "sync.cfg could not be found."; exit; fi |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
# -*- coding: utf-8 -*- | |
# Make by x:@BoxMrChen and windsurf ai | |
import asyncio | |
import base64 | |
import json | |
import io | |
import os | |
import sys | |
import pyaudio |