Skip to content

Instantly share code, notes, and snippets.

View abiriadev's full-sized avatar
|| -> Result<_, !> { Abiria()? }

Abiria abiriadev

|| -> Result<_, !> { Abiria()? }
View GitHub Profile
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
뷱뷱벋멀미빠부앏
걻뺢벙춫뿡폶즇닋
뱓턂톭쁂첛몺희멍
러슽턊벅툜뚏첞몱
핢슗랾볻알리바바
@abiriadev
abiriadev / 夢で世界を変えるなら.md
Last active January 26, 2022 02:10
Korean lyrics of <夢で世界を変えるなら>(꿈에서 세계를 바꿀 수 있다면)

世界を変えたいと思ってる
세상을 바꾸고 싶다고 생각했지
(세카이오 카에타이토 오못테루)

みんな思ってる
다들 생각하고 있어
(밋나 오못테루)

選ぶのは 自分が本当に望んでること
선택한 건 자신이 정말로 바라고 있는 것