Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / pomodoro.py
Last active May 23, 2023 05:35
A pomodoro timer that write the tracked time into a file near you
#!/usr/bin/env python3
##############################################################################
# Installation:
# First, run the following command to install the required dependencies:
# pip3 install rumps
# Then, copy the script to /usr/bin/local/tmr
##############################################################################
import rumps
@huytd
huytd / tien-len-mien-nam-by-bing-gpt.py
Created May 9, 2023 00:04
Card game Thirteen (a.k.a Tiến lên miền nam) made by Bing Chat
# Step 1: Import the random module
import random
# Step 2: Define a class for cards
class Card:
def __init__(self, rank, suit):
self.rank = rank # an integer from 3 to 15 (3 is lowest and 15 is highest)
self.suit = suit.lower() # a string from "spades", "clubs", "diamonds", or "hearts"
def __str__(self):
userChrome.ChromeTabs-Enabled true
userChrome.DarkTheme.TabFrameColor.Black.Enabled true
userChrome.DarkTheme.TabFrameType.Shadow.Enabled true
userChrome.DragSpace.Top.Fullscreen.Enabled true
userChrome.DragSpace.Top.Maximized.Enabled true
userChrome.DragSpace.Top.Windowed.Enabled true
userChrome.TabCorners.Option10.Enabled true
userChrome.Toolbar.Transparency.Low.Enabled true
[editor]
true-color = true
color-modes = true
idle-timeout = 75
[editor.indent-guides]
render = true
[editor.cursor-shape]
insert = "bar"
@huytd
huytd / github_light.toml
Created March 16, 2023 18:33
Github Light theme for Helix Editor
"comment" = { fg = "#969da5", modifiers = ["italic"] }
"constant" = { fg = "#24292f" }
"constant.character.escape" = { fg = "#007025" }
"diagnostic.warning" = { underline = { color = "#7d4e00", style = "curl" } }
"diagnostic.error" = { underline = { color = "#f07171", style = "curl" } }
"diagnostic.info" = { underline = { color = "#007025", style = "curl" } }
"diagnostic.hint" = { underline = { color = "#007025", style = "curl" } }
"error" = { fg = "#f07171" }
"function" = { fg = "#24292f" }
"function.macro" = {}
@huytd
huytd / fish.zshrc
Last active February 15, 2023 19:28
Make Zsh act like a Fish shell
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
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"
# 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
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
# 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