Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / fish.zshrc
Last active January 31, 2023 23:57
Make Zsh act like a Fish shell
View fish.zshrc
alias ls="ls -G"
alias ll="ls -lAh"
alias st="git status"
alias vim="nvim"
alias dff="git diff"
alias lg "git log --pretty=format:'%Cblue%>(12)%ad %C(yellow)%h %Cgreen%<(7)%aN%Cred%d %Creset%s' --date=short"
alias ad="git add -A"
alias cm="git commit -m"
alias gc="git checkout"
alias rgf="rg --files --hidden | rg"
@huytd
huytd / base16-mono.vim
Created December 22, 2022 05:46
Monochromatic color scheme for Vim, supports both light and dark mode
View base16-mono.vim
if &background ==# 'dark'
let s:bg0 = "151515"
let s:bg1 = "202020"
let s:bg2 = "303030"
let s:bg3 = "505050"
let s:fg1 = "a7adba"
let s:fg2 = "eff1f5"
else
let s:bg0 = "F2F4F4"
let s:bg1 = "eaeded"
View kitty-monochromatic-color
# Monochromatic Color
cursor #928374
cursor_text_color background
url_color #eff1f5
visual_bell_color #8ec07c
bell_border_color #8ec07c
@huytd
huytd / ViMouse Extended
Last active November 16, 2022 22:01
An extended ViMouse with y/u/b/n key movement and mouseMove event fix
View ViMouse Extended
local vimouse = require('vimouse')
vimouse('cmd', 'm')
-------------------------------------------------------
-- Modal mode for windows movement
hs.window.animationDuration = 0.1
local grid = require('hs.grid')
grid.MARGINX = 0
grid.MARGINY = 0
grid.GRIDHEIGHT = 40
@huytd
huytd / .nethackrc
Last active September 10, 2022 07:51
View .nethackrc
# This is an example nethackrc file for NetHack 3.7.x. You should edit
# this file to meet your play style needs.
# Available editors: rnano or virus via the terminal, or see our web-based RC Editor
# at https://www.hardfought.org/nethack/rcedit
# Examples of common defaults:
OPTIONS=windowtype:tty
OPTIONS=showexp,!autopickup,standout
View minecraft-font.css
@font-face {
font-family: "Minecraft Mono";
/* Add other properties here, as needed. For example: */
/*
font-weight: 100 900;
font-style: normal italic;
*/
src: url(data:application/octet-stream;base64,d09GRgABAAAAADtAABAAAAAAnQwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABbAAAABwAAAAcgj9IvUdERUYAAAGIAAAAIgAAACYAJwD6T1MvMgAAAawAAABVAAAAYNjROeFjbWFwAAACBAAAATcAAAF6eSlTcWN2dCAAAAM8AAAAGAAAABgHXw7YZnBnbQAAA1QAAAGxAAACZVO0L6dnYXNwAAAFCAAAAAgAAAAIAAAAEGdseWYAAAUQAAAwUQAAjLg5BAKuaGVhZAAANWQAAAA1AAAANg7rJUdoaGVhAAA1nAAAACAAAAAkEXwHyWhtdHgAADW8AAAAfgAAA1BHFCPebG9jYQAANjwAAAGeAAABqt1cuchtYXhwAAA33AAAACAAAAAgAfYBGm5hbWUAADf8AAAA/AAAAeoCc1AucG9zdAAAOPgAAAHGAAACkPkQtuBwcmVwAAA6wAAAAIAAAACqqHZquQAAAAEAAAAA2odvjwAAAADIeCtBAAAAAN8/rex42mNgZGBg4AFiMQY5BiYGRiC8DMQsQBEmIGaEYAAX8wEiAAB42mNgYTVj/MLAysDCUsQaysDA8ARCM/cxMDAeZ2BgYmDjZACDBqAgA6MDEwMUGJWUpDE4MCio/mGX+S/DwMBZyfjeAagJJMdSxGYJpBQYGAFuRAy6AAAAeNpjYGBgZoBgGQZGBhAoAfIYwXwWhgggLcQgABRhYqhj+KvApSCioK8Qr7BG9c///0A5BYYFCgwKAgix/4//H3pw4MHuBwsfFD1Qu3UdaiYaYGRjgEswMgE
View dummy-path-finding.c
#include <stdio.h>
const int N = 5;
int solve(int map[N][N], int x, int y, int ret[N][N]) {
if (map[y][x] == 2) {
return 1;
} else {
if (y - 1 >= 0 && map[y - 1][x] != 0 && ret[y - 1][x] == 0) {
ret[y - 1][x] = 1;
@huytd
huytd / dummy-dungeon-generator.cpp
Created August 26, 2022 22:01
Dummy dungeon generators
View dummy-dungeon-generator.cpp
#include <cstdlib>
#include <iostream>
#include <time.h>
#include <vector>
#include <stack>
#include <stdlib.h>
using namespace std;
const int SIZE = 40;
@huytd
huytd / rose-pine-moon.js
Created June 7, 2022 05:48
Rose Pine Moon color theme for Blink.sh - Modified from ng-hai/rose-pine-blinksh
View rose-pine-moon.js
const palette = {
base: "#232136",
surface: "#2a273f",
overlay: "#393552",
muted: "#6e6a86",
subtle: "#908caa",
text: "#e0def4",
love: "#eb6f92",
gold: "#f6c177",
rose: "#ea9a97",
@huytd
huytd / money-parser.rs
Created May 8, 2022 08:57
A simple recursive descent parser in Rust
View money-parser.rs
use std::fmt::Display;
/*
money = currency_symbol number ;
currency_symbol = '$' | '£' | '€' ;
number = INTEGER ;
*/
#[derive(Debug, PartialEq, Clone, Copy)]
enum TokenType {