Skip to content

Instantly share code, notes, and snippets.

View chaojian-zhang's full-sized avatar
🏯
When I am doing programming: I want to be God.

Charles Zhang chaojian-zhang

🏯
When I am doing programming: I want to be God.
View GitHub Profile
  • Convert images to video: ffmpeg -framerate 4 -start_number 51 -i _DSC12%d.jpg -c:v libx264 -r 4 output.mp4 (Recommendataion) Use Screen2Gif's editor instead.
  • Convert video into gif
  • Convert video into image sequence:
  • Crop video: ffmpeg -i in.mp4 -vf crop=w:h:x:y out.mp4
  • Change video frame rate:
  • Scale video resolution: ffmpeg -i input.avi -vf scale=320:240 output.avi
  • Scaleing while keeping aspect ratio: ffmpeg -i input.jpg -vf scale=320:-1 output_320.png
  • Scale images: ffmpeg -i input.jpg -vf scale=320:240 output_320x240.png
  • Multiple filters (separate using comma): ffmpeg -i 1.mp4 -vf "crop=720:720:264:0, scale=320:-1" 1.gif
  • Trim/Cut video: ffmpeg -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output1.mp4
@chaojian-zhang
chaojian-zhang / Debian - Basic Host.k.md
Last active July 26, 2022 21:21
Digital Ocean Debian Server Configurations; What commands to run from a clean slate
@chaojian-zhang
chaojian-zhang / Test1.c
Created October 28, 2021 03:17
Basic Lectures on C
int main()
{
int a = 5;
int* b = &a;
int c[] = {1, 2, 3, 4, 5};
return 0;
}
  • Put general language/usage notes here.

Snippets

  • Put Snippets here.

Print value of Pi to Any Number of Accuracy

@chaojian-zhang
chaojian-zhang / (Note) Rider Usage Note.k.md
Last active September 29, 2021 21:44
Rider for Unreal.

Assume VS 2019 style shortcut preset.

  • (Feature) Ctrl+T for Search Everywhere for symbols and definitions, which is different from Search from Files (Ctrl+Shift+F);
  • (Code Navigation) Alt+Shift+L: Navigate to file in solution explorer;
@chaojian-zhang
chaojian-zhang / (Reference) VS Shortcuts.md
Last active November 23, 2022 14:11
Visual Studio very common shortcuts that's used and forgotten by us.

Visual Studio Shortcuts

Navigation

  • Ctrl+-: Go to last cursor location (navigate back); Same effect if one has "Navigate back" mouse button;
  • Alt+F12: Peek definition; Press again to peek declaration;
  • Ctrl+K, O: Switch between header and cpp file;
  • Ctrl+K, R: Find all references;
  • Alt+*: Go (back to) current debug line;
  • F9: Toggle breakpoint
@chaojian-zhang
chaojian-zhang / Minecraft Mods.md
Created September 9, 2021 03:18
Minecraft MODs Installation Guide
@chaojian-zhang
chaojian-zhang / TmuxUsageNotes.md
Last active September 8, 2021 17:27 — forked from MohamedAlaa/tmux-cheatsheet.markdown
Tmux Shortcuts & Cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s test
@chaojian-zhang
chaojian-zhang / DwarfFortressPlayNotes.md
Last active June 8, 2022 15:36
Dwarf Fortress play notes.

Overview - Dwarf Fortress Play Notes

Notes for Dwarf Fortress, reminders of some things I tend to forget.

We play with Vanilla! It lacks the sound effect and Dwarf Therapist but is otherwise most integrated, feels natural, and had little distraction.

Git Dwarf Fortress Play Notes.

General Indexed Notes

@chaojian-zhang
chaojian-zhang / DockerUsageNotes.md
Last active February 10, 2023 21:44
Docker Usages Notes

Basics

  • docker run --name <your_container_name> alpine/git <git_command>
  • docker run -it --name <your_container_name> alpine/git <git_command>: Run with tty interactive
  • docker run -d --name couch -p 8091-8094:8091-8094 -p 11210:11210 couchbase: Run (e.g. a server) unattached
  • docker cp container_name:/git/getting-started .: Copy files/folders between a container and the local filesystem
  • docker start <your_container_name>: Start a stopped container
  • docker attach <your_container_name>: Attach to running container