Skip to content

Instantly share code, notes, and snippets.

View abiriadev's full-sized avatar

Abiria abiriadev

View GitHub Profile
@abiriadev
abiriadev / allow-empty-message.patch
Created March 25, 2025 13:06
force git to allow empty commit message. it's just a hacky joke with experiment. use it on your own risk in production
diff --git a/builtin/commit.c b/builtin/commit.c
index 2f45968222..25e26a2f70 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -125,7 +125,7 @@ static int all, also, interactive, patch_interactive, only, amend, signoff;
static int edit_flag = -1; /* unspecified */
static int quiet, verbose, no_verify, allow_empty, dry_run, renew_authorship;
static int config_commit_verbose = -1; /* unspecified */
-static int no_post_rewrite, allow_empty_message, pathspec_file_nul;
+static int no_post_rewrite, allow_empty_message = 1, pathspec_file_nul;
{
config,
lib,
pkgs,
...
}: let
nordVpnPkg = pkgs.callPackage ({
autoPatchelfHook,
buildFHSEnvChroot,
dpkg,
Language: Cpp
BasedOnStyle: LLVM
AlignAfterOpenBracket: BlockIndent
AlignOperands: DontAlign
AllowShortBlocksOnASingleLine: Always
AllowShortCaseLabelsOnASingleLine: true
AllowShortLoopsOnASingleLine: true
BinPackArguments: false
BinPackParameters: false
int cmp(const void *a, const void *b) { return (*(int *)a > *(int *)b) - (*(int *)a < *(int *)b); }
@abiriadev
abiriadev / README.md
Last active May 9, 2023 18:03
Roll n characters from given string

Usage

Randomly pick N characters from a given string(or standard input), just like rolling a dice repeatedly, then concatenate them into a single string.

Note

Please note that:

  1. It might containe repeated items. If you want to just shuffle them, try removing -r option from shuf command.
  2. It will treat unicode character as one item. see below:
@abiriadev
abiriadev / regextip.md
Created June 16, 2022 13:15
a useful tip about password checking with regex

Verify password with a single regex

Probably, you've ever encountered some circumstances to check a user's input, such as password, before submitting it to the server.

we usually write verbose code to check complex rules, such as there must be at least one special character etc.

is there any way to achieve this with a single line of code?

the answer is, yes.

@abiriadev
abiriadev / Cargo.toml
Last active June 4, 2022 13:08
star! macro. this simply prints a pyramid of stars without... any loop ;)
[package]
name = "star-macro"
version = "0.1.0"
edition = "2021"
[lib]
proc-macro = true
@abiriadev
abiriadev / internet_overdoes.md
Last active March 25, 2023 17:24
translated lyrics of INTERNET OVERDOSE

INTERNET OVERDOSE

この混沌とした 令和のインターネットを
오늘도 이 혼돈 속 인터넷 세상에

照らす一筋の光
한줄기 빛나는 광선

電子の海を漂う オタクに笑顔を
전자의 대해를 헤엄치는 오타쿠들에게 미소를

@abiriadev
abiriadev / .hyper.js
Created February 11, 2022 19:53
my hyper config file
module.exports = {
config: {
fontSize: 16,
fontFamily: 'MesloLGS NF, JetBrains Mono, Menlo, DejaVu Sans Mono, Lucida Console, monospace',
cursorShape: 'BEAM',
selectionColor: 'rgba(98, 108, 128, .4)',
// shell: "/bin/fish"
defaultSSHApp: false,
workingDirectory: '~',
disableLigatures: false,
@abiriadev
abiriadev / .vimrc
Last active December 7, 2022 01:04
my cute ~/.vimrc file >ㅂ<
""" basic settings
syntax on
set nocompatible " useless in nvim, but may stil needed yet
filetype plugin on
" set filetype indent on
set complete-=i " limit the files searched for auto-completes
set lazyredraw " don't redraw screen during macro and script execution.
set encoding=utf-8