Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Bin Zhang gembin

🎯
Focusing
Block or report user

Report or block gembin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@gembin
gembin / git-reset-author.md
Last active May 31, 2020
Git reset author for all commits
View git-reset-author.md

How to change the author of all your commits

Credits: http://stackoverflow.com/a/750191

git filter-branch -f --env-filter "
    GIT_AUTHOR_NAME='new_name'
    GIT_AUTHOR_EMAIL='new_name@email'
    GIT_COMMITTER_NAME='new_name'
@gembin
gembin / rust_email_with_lettre.md
Last active Apr 21, 2020
Send email with lettre
View rust_email_with_lettre.md

Introduction

https://github.com/lettre/lettre is a library to send emails over SMTP from our Rust applications.

Cargo.toml

lettre = "0.9.2"
lettre_email = "0.9.2"
native-tls = "0.2"
@gembin
gembin / install_mysql_on_mac.md
Last active Apr 16, 2020
Install MySQL on MacOS
View install_mysql_on_mac.md

Install

brew install mysql
brew tap homebrew/services
brew services start mysql

Configuration

If you run into this error using GUI tools, e.g. Sequel Pro:

Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(/usr/local/mysql/lib/plugin/caching_sha2_password.so, 2): image not found
@gembin
gembin / install_tensorflow_pycharm_mac.md
Last active Mar 17, 2020
Installing Tensorflow on Pycharm (Mac)
View install_tensorflow_pycharm_mac.md
  • In Pycharm, Preferences -> Project Interpreter -> Create VirtualEnv -> <your_virtualenv_name_and_location>, and select "inherit global site-packages" option -> OK.
  • In command line, install tensorflow in the virtualenv location you created in previous step. For the above case, let's assume the location is ~/tensorflow_pycharm, therefore, run command virtualenv --system-site-packages -p python3 ~/tensorflow_pycharm or python3 -m venv ~/tensorflow_pycharm(changed in version 3.5: the use of venv is now recommended for creating virtual environments).
  • Install tensorflow with one of the following approaches:
    • From command line
      • Activate the virtualenv environment by issuing one of the following commands: source ~/tensorflow_pycharm/bin/activate
      • Issue the following command to install TensorFlow and all the packages that TensorFlow requires into the active Virtualenv environment: pip3 install --upgrade tensorflow.
      • In PyCharm, select the configured Project Interpreter at `~/t
View postgres-export-data-to-csv.md
export PGPASSWORD=xxxx
psql -h xxx_host -U xxx_user -p xxx_port -d xxx_db -q -A -F ',' -f xxx_query.sql > xxx_output.csv
@gembin
gembin / mac_os_open_files_limit.md
Created Jan 25, 2018
Mac OS Open Files Limit
View mac_os_open_files_limit.md

Open Files Limit

Changing Limit For Current Session

Most operating systems can change the open-files limit for the current shell session using the ulimit -n command:

ulimit -n 200000

Mac OS X El Capitan

@gembin
gembin / git-merge-commits.md
Last active Mar 7, 2019
Git merge commits into one
View git-merge-commits.md

Interactively

git rebase --interactive HEAD~2
pick bf7416a commit-2
pick fbc0ef9 commit-3
@gembin
gembin / Tensorflow_Build_GPU.md
Created Nov 28, 2018 — forked from smitshilu/Tensorflow_Build_GPU.md
Tensorflow 1.4 Mac OS High Sierra 10.13 GPU Support
View Tensorflow_Build_GPU.md

Tensorflow

System information

  • OS - High Sierra 10.13
  • Tensorflow - 1.4
  • Xcode command line tools - 8.2 (Download from here: Xcode - Support - Apple Developer & Switch to different clang version: sudo xcode-select --switch/Library/Developer/CommandLineTools & check version: clang -v)
  • Cmake - 3.7
  • Bazel - 0.7.0
@gembin
gembin / 词性标记.md
Created Nov 25, 2018 — forked from luw2007/词性标记.md
词性标记: 包含 ICTPOS3.0词性标记集、ICTCLAS 汉语词性标注集、jieba 字典中出现的词性、simhash 中可以忽略的部分词性
View 词性标记.md

词的分类

  • 实词:名词、动词、形容词、状态词、区别词、数词、量词、代词
  • 虚词:副词、介词、连词、助词、拟声词、叹词。

ICTPOS3.0词性标记集

n 名词
	nr 人名
You can’t perform that action at this time.