Skip to content

Instantly share code, notes, and snippets.

View azye's full-sized avatar
🌋

Alex Ye azye

🌋
View GitHub Profile
@azye
azye / tmux.txt
Last active February 19, 2022 09:02
TMUX
## Resize Panes
bind-key -r -T prefix M-Up resize-pane -U 5
bind-key -r -T prefix M-Down resize-pane -D 5
bind-key -r -T prefix M-Left resize-pane -L 5
bind-key -r -T prefix M-Right resize-pane -R 5
bind-key -r -T prefix C-Up resize-pane -U
@azye
azye / learn_tmux.md
Created February 27, 2020 00:08
Learn tmux

Learn tmux

Start a new tmux session

tmux

or

tmux new -s "name_of_session"
@azye
azye / gnu_screen.md
Last active May 18, 2021 06:11
Learning GNU screen

Learning GNU screen

GNU screen is a terminal multiplexer. meaning it can create multiple virtual sessions from within a single terminal session. Using a terminal multiplexer also allows you to persist sessions after a terminal window is closed, create multiple windows for building more efficient workflows, and collaborate with other people working on the same servers as you.

All shortcuts are case-sensitive. i.e. ctrl+a S != ctrl+a s (ctrl+a S == ctrl+a <shift> s).

For all shortcuts, release ctrl+a before hitting next key.

Start a new screen session

do git stash better

Stashes with a message

$ git stash save “Your stash message”.

List your stashes

$ git stash list
@azye
azye / authorized_ssh.sh
Last active June 8, 2022 06:44
Add an authorized key to your linux user
SSH_KEY=<ssh_key>
mkdir -p $HOME/.ssh
touch $HOME/.ssh/authorized_keys
echo $SSH_KEY > $HOME/.ssh/authorized_keys
chmod 700 $HOME/.ssh
chmod 600 $HOME/.ssh/authorized_keys
chown -R $(whoami):$(whoami) $HOME/.ssh
No Name Default Action Description
1 SIGHUP terminate process terminal line hangup
2 SIGINT terminate process interrupt program
3 SIGQUIT create core image quit program
4 SIGILL create core image illegal instruction
5 SIGTRAP create core image trace trap
6 SIGABRT create core image abort program (formerly SIGIOT)
7 SIGEMT create core image emulate instruction executed
8 SIGFPE create core image floating-point exception
9 SIGKILL terminate process kill program
#!/usr/bin/env python
import os, argparse, sys, time, shutil
MS_CONVERT_TIME = 1000
parser = argparse.ArgumentParser(description='Rename image filenames')
parser.add_argument('start', type=int, help='starting ID to use as ballot ID')
parser.add_argument('input', help='input directory of images')
@azye
azye / algoz
Created October 20, 2019 21:24
prefix sum,https://www.geeksforgeeks.org/prefix-sum-array-implementation-applications-competitive-programming/,https://leetcode.com/problems/flip-string-to-monotone-increasing/solution/
@azye
azye / ring.c
Last active September 26, 2019 22:22
cool program that was sent to me... compile with gcc and run.
k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
>i;i+=0.02){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
@azye
azye / react_from_scratch.md
Last active June 7, 2019 04:29
building a react project without a toolchain (WIP)

React From Scratch

TLDR of how to make a starter react project from scratch so we don't have a black box toolchain. This guide is no hand holding -- use it if you generally understand how project organization scaffolding works and how JS/Babel/Webpack work together.

Prerequisites

  • npm
  • node

Create a project directory