Skip to content

Instantly share code, notes, and snippets.

@huytd
huytd / wordle.md
Last active March 17, 2024 20:51
Wordle in less than 50 lines of Bash

image

How to use:

./wordle.sh

Or try the unlimit mode:

@huytd
huytd / .gitconfig
Created August 4, 2016 16:26
Use neovim as diff tool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $REMOTE $MERGED -c '$wincmd w' -c 'wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
local wezterm = require 'wezterm'
local config = {}
if wezterm.config_builder then
config = wezterm.config_builder()
end
config.color_scheme = 'One Half Black (Gogh)'
config.font = wezterm.font 'Office Code Pro'

Screenshots:

image image image
@huytd
huytd / hiccup.vim
Last active October 14, 2023 03:51
My latest Vim config in Lua
" Hiccup Theme for Vim
" Author: Huy Tran
" License: BSD 3 Clauses
" Put this file to: colors/hiccup.vim
highlight clear
if exists('syntax_on')
syntax reset
endif
@huytd
huytd / tokyo-rs-simple-bot.js
Created October 12, 2023 07:50
Simple bot for tokyo-rs
const USERNAME = "rotate-bot";
const ws = require('ws');
const client = new ws(`wss://combat.sege.dev/socket?key=${USERNAME}&name=${USERNAME}`);
client.on('open', () => {
console.log('Connected!');
setInterval(() => {
client.send(JSON.stringify({
@huytd
huytd / todo.vim
Created June 14, 2020 07:34
A Todo list syntax in Vim, with an actual checkbox
" Vim syntax file
" Language: Todo
" Maintainer: Huy Tran
" Latest Revision: 14 June 2020
if exists("b:current_syntax")
finish
endif
" Custom conceal
(defun read-journal (path)
(with-temp-buffer
(insert-file-contents (concat "~/notes/journal/" path))
(split-string (buffer-string) "\n" t)))
(defun read-first-three-lines (list)
(cond ((>= (length list) 4) (subseq list 1 3))
((>= (length list) 1) (nthcdr 1 list))
(t list)))
@huytd
huytd / customize.material-dark-theme.md
Last active September 2, 2023 13:03
My minimal Emacs config

;; Automatically generated
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(anzu-cons-mode-line-p nil)