Skip to content

Instantly share code, notes, and snippets.

View Franceshe's full-sized avatar

Frances He Franceshe

View GitHub Profile
@Franceshe
Franceshe / README.md
Created March 14, 2018 22:33 — forked from hofmannsven/README.md
My simply Git Cheatsheet
@Franceshe
Franceshe / tmux-cheatsheet.markdown
Created January 19, 2021 12:12 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@Franceshe
Franceshe / Install NVIDIA Driver and CUDA.md
Created January 19, 2021 12:13 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@Franceshe
Franceshe / Install NVIDIA Driver and CUDA.md
Created January 19, 2021 12:13 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
@Franceshe
Franceshe / latency.txt
Created April 13, 2021 09:42 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@Franceshe
Franceshe / .gitignore
Created April 22, 2021 16:41 — forked from octocat/.gitignore
Some common .gitignore configurations
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@Franceshe
Franceshe / howto-put-git-repo-into-another-repo.md
Created April 22, 2021 16:43 — forked from Restuta/howto-put-git-repo-into-another-repo.md
How to make git repo to be another's repo subfolder preserving history

Hacky way (let me know if you know better one)

Let's say you have repo Main and repo Proto, you want to put your Proto under Main, so folder structure will be the following:

|-SRC
   |---proto

and you also want to preserve commit history, so everybody can see what you were doing while developing proto, sounds like pretty easy task. The easiest way is to create folder structure similar to Main repo SRC\proto and start working using is as a root, but if you like me, you didn't think about this beforehand, so you path would be harder:

@Franceshe
Franceshe / emacs27.sh
Created May 17, 2021 12:11 — forked from atgmello/emacs27.sh
Install Emacs 27 from source in Ubuntu 20.04 LTS
cd
git clone --depth=1 --single-branch \
--branch emacs-27 https://github.com/emacs-mirror/emacs.git
cd emacs/
sudo apt install -y autoconf make gcc texinfo libgtk-3-dev libxpm-dev \
libjpeg-dev libgif-dev libtiff5-dev libgnutls28-dev libncurses5-dev \
libjansson-dev libharfbuzz-dev libharfbuzz-bin imagemagick \
@Franceshe
Franceshe / littlechecker.py
Created June 8, 2021 09:01 — forked from rajarsheem/littlechecker.py
A little code checker tool in python for Java,C,Cpp. Handles compile error, runtime error, accepted, wrong, TLE.
import os, filecmp
codes = {200:'success',404:'file not found',400:'error',408:'timeout'}
def compile(file,lang):
if lang == 'java':
class_file = file[:-4]+"class"
elif lang == 'c':
class_file = file[:-2]
elif lang=='cpp':
@Franceshe
Franceshe / gist:be85a56130a097e4339ff652cc975894
Created June 18, 2021 10:35 — forked from joho/gist:3735740
PostgreSQL 9.2 upgrade steps
Steps to install and run PostgreSQL 9.2 using Homebrew (Mac OS X)
(if you aren't using version 9.1.5, change line 6 with the correct version)
1. launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
2. mv /usr/local/var/postgres /usr/local/var/postgres91
3. brew update
4. brew upgrade postgresql
5. initdb /usr/local/var/postgres -E utf8
6. pg_upgrade -b /usr/local/Cellar/postgresql/9.1.5/bin -B /usr/local/Cellar/postgresql/9.2.0/bin -d /usr/local/var/postgres91 -D /usr/local/var/postgres
7. cp /usr/local/Cellar/postgresql/9.2.0/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/