Skip to content

Instantly share code, notes, and snippets.

View brainwo's full-sized avatar
💭

Brian Wo brainwo

💭
View GitHub Profile
@Saren-Arterius
Saren-Arterius / Waydroid.sh
Last active June 17, 2025 05:17
Install Waydroid on Steam Deck (As of 2024-03-16)
#!/bin/sh
cage -- bash -c 'wlr-randr --output X11-1 --custom-mode 1280x800; sleep 1; sudo /usr/local/bin/waydroid-helper & waydroid show-full-ui'
@lobre
lobre / zig_type_system.md
Last active October 5, 2025 22:19
Zig type system illustrated using ascii diagrams

Zig Type System

Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.

So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?

*const ?u8
?*const u8
*const [2]u8
@xacnio
xacnio / telegram_video_sticker_ffmpeg.md
Last active July 20, 2025 23:05
Telegram - Create Video Sticker (.WEBM) with FFMPEG

Command

ffmpeg -y -i animated_sticker.mov -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -s 512x512 -b:v 400K output.webm
  • If .webm file size greater than 256 KB, you should reduce "-b:v 400K"
  • .mov video file may has alpha channel but not required.
  • My video sticker pack for example: https://t.me/addstickers/msn_animations

Telegram Sticker Command

@ityonemo
ityonemo / test.md
Last active September 15, 2025 13:49
Zig in 30 minutes

A half-hour to learn Zig

This is inspired by https://fasterthanli.me/blog/2020/a-half-hour-to-learn-rust/

Basics

the command zig run my_code.zig will compile and immediately run your Zig program. Each of these cells contains a zig program that you can try to run (some of them contain compile-time errors that you can comment out to play with)

@rydmike
rydmike / analysis_options.yaml
Last active March 20, 2025 19:21
RydMike lints v2.4.0 - Personal preferences and starting point for Dart & Flutter linter rules setup.
# RydMike LINTER Preferences v2.4.0
#
# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
#
# We include and activate all lint rules, later below we disable the not used or desired ones.
# You can find a list of all lint rules to put in your all_lint_rules.yaml file here:
# https://dart.dev/tools/linter-rules/all
#
# This version is updated for Flutter 3.29 and Dart 3.7.
#
@brainwo
brainwo / win32_window.cpp
Last active June 30, 2020 06:44
Borderless Windows App (Flutter)
// Get monitor size
// https://stackoverflow.com/a/10845821
MONITORINFO info;
info.cbSize = sizeof(MONITORINFO);
GetMonitorInfo(monitor, &info);
int monitor_width = info.rcMonitor.right - info.rcMonitor.left;
int monitor_height = info.rcMonitor.bottom - info.rcMonitor.top;
// Create window
html, html > *, html > * > *, .browser-toolbar {
border: none !important;
-moz-appearance: none !important;
box-shadow: none !important;
background: transparent!important;
}
.titlebar-color, .browser-toolbar, findbar {
background: rgba(49, 54, 59, 0.75)!important;
}
@Zeinok
Zeinok / wine-breeze-dark-theme.md
Last active October 6, 2025 19:49
Breeze Dark theme for Wine

Made possible with this reddit post.

Install

wine regedit wine-breeze-dark.reg

Uninstall (Reset Wine color scheme)

wine regedit wine-reset-theme.reg

@dikiaap
dikiaap / git-io-custom-url.md
Last active September 8, 2025 00:26
git.io custom URL

Update: As of 11 January 2022, git.io no longer accepts new URLs.

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com