Tag: dev
On my Linux, just after upgrading Go to version 1.9, I lost autompletion functionality in VS Code.
Read more →
I tried to resync a slave MySQL after it disconnected from the master. But the binary log was already deleted on master, so the only solution was to restore from the last backup. To avoid lock tables on the master and remember the binary log name and position to put them on the slave configuration, there is a tip to take care of all that : the “–master-data” option in mysqldump. Read more →
To import a local CSV file into MySQL, use the syntax below :
LOAD DATA LOW_PRIORITY LOCAL INFILE '/path/tofile.csv'
INTO TABLE database.table
FIELDS TERMINATED BY ';' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '"' LINES TERMINATED BY '\n' IGNORE 1 LINES
(`field1`,`field2`,...)
To export a mysql results in CSV format, use the syntax below :
SELECT field1, field2, ...
FROM table
WHERE condition
INTO OUTFILE '/tmp/toto.csv'
FIELDS TERMINATED BY ';'
ENCLOSED BY '"'
LINES TERMINATED BY '\n' ;
Just in case you absolutely have to insert a date in MySQL that does’nt exist, eg 2014-02-30, you can run MySQL server in a special mode that authorizes such dates :
mysqld --sql-mode="ALLOW_INVALID_DATES"
MySQL will only check that the month is in the range from 1 to 12 and the day is in the range from 1 to 31.
see Mysql DOC
As of Git v1.7.0, you can delete a remote branch using
git push origin --delete <branchName>
src = stackoverflow.com
If you have some files that you need to have in your repo but don’t need to have updates, git allows it :
git update-index --skip-worktree <FILES>
Then a “git status” won’t show those files until you do :
git update-index --no-skip-worktree <FILES>
To show the skipped files :
git ls-files -v . | grep ^S
–skip-worktree is a better solution than –assume-unchanged because status will not get lost once an upstream change is pulled.
source : http://stackoverflow.com/a/39776107/3181414