Skip to content

Instantly share code, notes, and snippets.

View vochicong's full-sized avatar
🐒
NLP/ML/AI

Cong vochicong

🐒
NLP/ML/AI
View GitHub Profile
@vochicong
vochicong / create-dataframe.jl
Created August 20, 2021 02:47
groupby-dataframes.jl
df = DataFrame(g=[1,2,3,1,2,1], e=[10,20,30,11,21,12])
@vochicong
vochicong / .tmux.conf
Last active July 8, 2022 23:47
code-shell, tmux settings for VSCode's terminals
set -g mouse on
set -g status on
set-window-option -g mode-keys vi
set-option -g default-command "/usr/bin/bash"
bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'"
bind-key -n WheelDownPane select-pane -t= \; send-keys -M
unbind C-b
@vochicong
vochicong / datalab-install-for-mac.sh
Created July 2, 2019 04:26
Install Datalab/gcloud SDK for Mac using brew
brew cask install google-cloud-sdk
gcloud components install datalab
gcloud init
gcloud auth login
export PATH=/usr/local/Caskroom/google-cloud-sdk/latest/google-cloud-sdk/bin:$PATH
@vochicong
vochicong / .gitignore
Last active April 8, 2019 15:17
.gitignore
# git config --global core.excludesfile ~/.gitignore
.DS_Store
# Ignore bundler config.
**/.bundle
# Ignore all logfiles and tempfiles.
**/log/*
**/tmp/*
@vochicong
vochicong / nvidia-reset-ubuntu.sh
Last active June 14, 2019 06:25
Reset/reinstall nvidia driver, CUDA, nvidia docker for Ubuntu
# Stop everything maybe using GPU
sudo systemctl stop gdm.service
microk8s.disable gpu
sudo killall nvidia-persistenced
# Remove all nvidia-*, cuda, libcudnn
sudo apt-get purge docker-ce nvidia-* libnvidia-* cuda libcudnn7
sudo apt autoremove
# Download latest NVIDIA driver from https://www.geforce.com/drivers
@vochicong
vochicong / Env.rb
Last active January 25, 2019 15:29
Rails credentials.yml.encと環境変数の併用 ref: https://qiita.com/vochicong/items/d384824f2952c46064ac
class Env
def self.method_missing(name, *default)
ENV[name.to_s] ||
default.first ||
Rails.application.credentials.send(name) ||
super
end
def self.respond_to_missing?(*)
true
@vochicong
vochicong / .Brewfile
Last active November 20, 2019 07:05
.Brewfile
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-versions"
tap "homebrew/core"
tap "homebrew/services"
brew "docker"
brew "docker-compose"
brew "gist"
brew "git"
brew "hub"
@vochicong
vochicong / file0.txt
Last active November 14, 2018 08:40
MacでAlpha ZeroライクのLeela Chess を動かし、lichessでネット対戦 ref: https://qiita.com/vochicong/items/b6a3ca57a2fd11461f46
$ git clone -b release --recurse-submodules \
https://github.com/LeelaChessZero/lc0.git
$ cd lc0
$ brew install python3 meson ninja
$ ./build.sh # ビルド
$ ./build/release/lc0 # 軽く動作確認
v0.19.0-rc4 built Nov 14 2018
Ctr^C で終了
@vochicong
vochicong / file0.txt
Last active June 18, 2018 01:51
GCP ConsoleでBitMEXマーケット・メーキングテストボットを動かす手順 ref: https://qiita.com/vochicong/items/3013b2b00fc062cdb545
mkdir -p ~/tmp; cd ~/tmp
curl -s \
https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
sh ~/tmp/Miniconda3-latest-Linux-x86_64.sh -b -p ~/miniconda3/
echo 'export PATH="~/miniconda3/bin:$PATH"' >> ~/.bashrc
export PATH="~/miniconda3/bin:$PATH"
conda create -n bitmex python=3