Skip to content

Instantly share code, notes, and snippets.

View noghte's full-sized avatar
🏠
Working from home

Saber Soleymani noghte

🏠
Working from home
View GitHub Profile
@noghte
noghte / gitcheatsheet.md
Last active March 20, 2019 06:41
github

Branch

  • Create a branch: git checkout -b branch_name
  • Push a branch to remote: git push -u origin branch_name
  • Pull a branch from remote: git checkout --track origin/branch_name

Undo

  • Revert some files to their previous version:
    git checkout commit-hashcode~1 -- file1 file2 file3
  • Revert some files to a specific commit: git checkout commit-hashcode file1 file2 file3

Processes

  • Show output of a running process: sudo strace -p1234 -s9999 -e write
  • Store nohup result in another file: nohup python app.py &> nohup2.out&
  • Combine text files: cat df-*.csv > df-all.csv
git checkout dev
git merge master
git checkout master
git merge --no-ff dev
git checkout dev

VS-Code

Debug React / GatsBy / NextJS

WSL

Contents of launch.json in Visual Studio Code (VSCode) when debugging React / GatsBy / NextJS web applications in WSL or WSL2:

{
  "version": "0.2.0",
  "configurations": [
@noghte
noghte / bertcache.md
Created April 8, 2021 05:26
bert sbert transofrmers sentencetransofrmers cache address saved models
from transformers import file_utils
print(file_utils.default_cache_path)
@noghte
noghte / gist:b84063ffa1bc7cbd6afad59b8501263a
Created September 7, 2021 01:18
VR - HP Reverb G2 on AMD motherboard x570 gaming edge wifi
1. Downgrade PIC-e to version 3 in Bios:
1. Use and external AC-powered USB hub
1. Update BIOS