$> mysql_config_editor set --login-path=client
--host=localhost --user=localuser --password
Enter password: enter password "localpass" here
$> mysql_config_editor set --login-path=remote
--host=remote.example.com --user=remoteuser --password
Enter password: enter password "remotepass" here
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
name: Go | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: |
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
if [ "$(whoami)" != "root" ]; then | |
echo "root required!" | |
exit | |
fi | |
apt-get update | |
apt-get upgrade | |
apt-get dist-upgrade |
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
vi /etc/environment | |
add these lines... | |
LANG=en_US.utf-8 | |
LC_ALL=en_US.utf-8 |
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
Add the following style to the div: | |
-webkit-user-select: 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
For Mac OS, the application is located in the following folder | |
~/Library/Application Support/Google/Chrome/Default | |
The chrome app is in Extensions folder, the folder name for the application is the application id. |
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/bash | |
if [ -z "$1" ]; then | |
echo Please pass the service name | |
exit | |
else | |
SERVICE_NAME=$1 | |
fi | |
if [ ! $2 ]; then |
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
// Use moment to parse date to handle different browser | |
var startDate = moment('2015-07-06 08:00', 'YYYY-MM-DD HH:mm').toDate(); | |
var timestamp = startDate.getTime(); | |
console.log(timestamp); | |
// Output | |
// 1436140800000 | |
// Get Unix timestamp |
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
var number = 3; | |
var formattedNumber = number.toFixed(2) | |
console.log(formattedNumber) | |
// Output | |
// 3.00 |
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
func logRequest(r *http.Request) { | |
ip := r.Header.Get("X-Real-IP") | |
if ip == "" { | |
ip, _, _ = net.SplitHostPort(r.RemoteAddr) | |
} | |
logs.Debugf("%s %v from ip: %s", r.Method, r.URL, ip) | |
} |