Skip to content

Instantly share code, notes, and snippets.

Screenshots:

image image image
@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 / 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
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'
<scheme name="Fleetjetbrain-color-theme" parent_scheme="Darcula" version="1">
<colors>
<option name="CONSOLE_BACKGROUND_KEY" value="1E1F22" />
<option name="LINE_NUMBERS_COLOR" value="D6D6DD" />
<option name="SELECTION_BACKGROUND" value="163761" />
<option name="CARET_ROW_COLOR" value="292929" />
<option name="WHITESPACES" value="737373" />
<option name="CARET_COLOR" value="D6D6DD" />
<option name="INDENT_GUIDE" value="737373" />
<option name="SELECTED_INDENT_GUIDE" value="737373" />
let mapleader=" "
set ideajoin
set clipboard+=unnamed
set clipboard+=ideaput
inoremap jk <ESC>
nnoremap <C-j> 10jzz
nnoremap <C-k> 10kzz
nnoremap H h
[
{
"context": "Editor",
"bindings": {
"cmd-b": "editor::GoToDefinition",
"cmd-shift-b": "editor::GoToTypeDefinition",
"cmd-r": "project_symbols::Toggle",
"cmd-0": "workspace::ToggleLeftSidebar",
"ctrl-0": "outline::Toggle"
}
@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):