Skip to content

Instantly share code, notes, and snippets.

Avatar

Sung-ju Kim goddoe

View GitHub Profile
@goddoe
goddoe / cmake-tutorial.md
Created Jul 23, 2020 — forked from luncliff/cmake-tutorial.md
CMake 할때 쪼오오금 도움이 되는 문서
View cmake-tutorial.md

CMake를 왜 쓰는거죠?
좋은 툴은 Visual Studio 뿐입니다. 그 이외에는 전부 사도(邪道)입니다 사도! - 작성자

주의

  • 이 문서는 CMake를 주관적으로 서술합니다
  • 이 문서를 통해 CMake를 시작하기엔 적합하지 않습니다
    https://cgold.readthedocs.io/en/latest/ 3.1 챕터까지 따라해본 이후 기본사항들을 속성으로 익히는 것을 돕기위한 보조자료로써 작성되었습니다
View update_cmake.sh
sudo apt remove cmake
https://cmake.org/files/v3.18/cmake-3.18.0.tar.gz
tar -zxvf cmake-3.18.0.tar.gz
cd cmake-3.18.0
./bootstrap
make
sudo make install
@goddoe
goddoe / fix.sh
Created Jul 6, 2020
Tmux fonts broken
View fix.sh
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
# or
tmux -u
@goddoe
goddoe / move window between sessions.txt
Created May 24, 2020
move window between sessions
View move window between sessions.txt
(Reference: https://stackoverflow.com/questions/3094946/move-window-between-tmux-clients , mb14)
Yes, you can use the move-window command:
move-window [-d] [-s src-window] [-t dst-window]
(alias: movew)
This is similar to link-window, except the window at src-window is moved to dst-window.
where src-window and dst-window have the form: session:window.pane (session and window can be either name or id).
@goddoe
goddoe / vim_tips.txt
Created May 20, 2020
Retrace your movements in file in backwards in vim
View vim_tips.txt
(reference: https://www.cyberciti.biz/faq/unix-linux-vim-go-back-to-last-cursor-position/)
[a] '. : Jump to last modification line.
[b] `. : Jump to exact spot in last modification line
[c] CTRL-O : Retrace your movements in file in backwards.
[d] CTRL-I : Retrace your movements in file in forwards.
From the vim help files:
@goddoe
goddoe / projection 3d points to sphere.py
Created May 17, 2020
projection 3d points to sphere
View projection 3d points to sphere.py
# Reference: https://github.com/cvqluu/Angular-Penalty-Softmax-Losses-Pytorch/blob/master/plotting.py#L1
import matplotlib.pyplot as plt
from matplotlib import cm, colors
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
def plot(embeds, labels, fig_path='./example.pdf'):
View sample_each_group.py
data_df = data_df.groupby('label', group_keys=False).apply(pd.DataFrame.sample, n=50, replace=True)
@goddoe
goddoe / gist:6fa13b7b62ed7ec0bb4e9d9bcfe245bc
Created May 5, 2020
fixing SSLErro when using dataset downloading in either torchtext or torchvision
View gist:6fa13b7b62ed7ec0bb4e9d9bcfe245bc
(reference: https://github.com/pytorch/text/issues/311 , jsedoc)
@Vasonv This is not a torchtext issue, this is an issue with python3.6 on OSX. Even if you patch in one place everywhere you use urllib the same issue will show up (see SNLI example below)
Here's the solution:
sudo /Applications/Python\ 3.6/Install\ Certificates.command
See https://github.com/tensorflow/tensorflow/issues/10779
train, dev, test = datasets.SNLI.splits(inputs, answers)
@goddoe
goddoe / speedup_pip.md
Created May 5, 2020
카카오 PyPI 미러 적용
@goddoe
goddoe / browser_visit_fake.py
Created Mar 23, 2020
How to use Python requests to fake a browser visit?
View browser_visit_fake.py
import requests
url = 'http://www.ichangtou.com/#company:data_000008.html'
headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.95 Safari/537.36'}
response = requests.get(url, headers=headers)
print(response.content)
You can’t perform that action at this time.