Skip to content

Instantly share code, notes, and snippets.

View towry's full-sized avatar
🎯
Focusing

Towry Wang towry

🎯
Focusing
  • Shanghai
View GitHub Profile
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active November 2, 2025 23:00
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@Tamal
Tamal / git-ssh-error-fix.sh
Last active October 31, 2025 02:02
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
@ChunMinChang
ChunMinChang / Makefile
Last active October 18, 2021 07:02
opaque or transparent interface of the external library
all:
# Build a static library from the Rust file
rustc --crate-type=staticlib ext.rs
# Compile the C file with the static library
# gcc -o sample-c sample.c libext.a
gcc -o sample-c sample.c -L. -lext
./sample-c
# g++ -o sample-cpp sample.cpp libext.a
g++ -o sample-cpp sample.cpp -L. -lext
./sample-cpp
@riskers
riskers / README.md
Last active July 30, 2025 08:37
rime config
import UIKit
import PlaygroundSupport
struct ToDoItem {
let id: UUID
let title: String
init(title: String) {
self.id = UUID()
self.title = title
#!/bin/bash
set -e
CONTENTS=$(tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/tessdata/ "$1" stdout -l eng | xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
@robertpainsi
robertpainsi / commit-message-guidelines.md
Last active November 13, 2025 00:40
Commit message guidelines

Commit Message Guidelines

Short (72 chars or less) summary

More detailed explanatory text. Wrap it to 72 characters. The blank
line separating the summary from the body is critical (unless you omit
the body entirely).

Write your commit message in the imperative: "Fix bug" and not "Fixed
bug" or "Fixes bug." This convention matches up with commit messages
@towry
towry / setup_vpn.md
Last active June 22, 2019 22:06
Installing a vps and setup vpn

Initialize the server.

  1. login as root user.
    • ssh root@server_ip_address
  2. create a new user:
    • adduser username
    • Use the usermod command to add the user to the sudo group. usermod -aG sudo username
    • Test sudo access on new user account. su - username
  3. login as new created user.
@towry
towry / app.js
Last active October 26, 2016 05:01
history api fallback for vue-router
// usage
import historyFallback from 'lib/polyfill/historyFallback'
import historySupport from 'lib/support/history';
let redirected = historyFallback('/', historySupport ? 'history' : 'hash');
if (!redirected) {
// You app ...
// Vue.use(VueRouter);
@Bhavdip
Bhavdip / sketch-never-ending.md
Created October 6, 2016 15:53
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com