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
@chaojian-zhang
chaojian-zhang / CSharpServer.cs
Last active January 16, 2020 03:54
A C# server that reads local files as input and output new total numbers based on input.
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace CSharpServer
{
@chaojian-zhang
chaojian-zhang / pandoc.md2pdf.sublime-build
Created January 9, 2020 21:15 — forked from keuv-grvl/pandoc.md2pdf.sublime-build
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --pdf-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
"selector": "text.html.markdown",
"shell": true
}
@chaojian-zhang
chaojian-zhang / PythonVideoCaptureJPGs.py
Last active June 26, 2022 03:26
Video Capture (Python,Cv2)
# This is VERY INEFFICIENT - at the moment for 10min video it produces 10*60*25=15000 images
# The framerate calculation is WRONG: it's NOT taking screenshots every 10 frames, but it's taking every frame!
# In fact, it's faster and more efficient if we just re-watch the video in VLC and use Alt-V-S shortcut to take screenshots when needed
import cv2
vidcap = cv2.VideoCapture('temp.mp4')
framerate = vidcap.get(cv2.CAP_PROP_FPS)
success,image = vidcap.read()
count = 0
@chaojian-zhang
chaojian-zhang / RegRename
Created March 21, 2021 21:10
A CLI (Command Line Interface) utility to rename files with regular expression (C# style). Itch.IO: https://charles-zhang.itch.io/rename
using System;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace RegRename
{
class Program
{
static void Main(string[] args)
@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
@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 / 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 / Minecraft Mods.md
Created September 9, 2021 03:18
Minecraft MODs Installation Guide
@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 / (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;