Skip to content

Instantly share code, notes, and snippets.

@umiyosh
umiyosh / tts_by_token.py
Last active March 19, 2024 06:41
Script for text to speech with text split by token size.
import logging
import os
from pathlib import Path
import sys
import openai
import pygame
from semantic_text_splitter import TextSplitter
@umiyosh
umiyosh / .obsidian.vimrc
Last active February 8, 2024 01:46
.obsidian.vimrc
" Yank to system clipboard
set clipboard=unnamed
" keymap
" Moving to the end and beginning of a line
noremap <C-e> $
noremap <C-a> ^
" Notebook Link Related
exmap followLinkUnderCursor obcommand editor:follow-link

iTerm2 Powerline Font: How to Resolve Glyph Display Problems

Issues

When using the Powerline font in iTerm2, the following problems occur:

  • Powerline glyphs appear with slightly inconsistent sizes.
  • Powerline glyphs are colored differently.

These display issues can be addressed by applying the workarounds described below.

@umiyosh
umiyosh / gist:2b35aec355bcdad0e1bad9d362fa2383
Last active December 23, 2023 08:23
Vegeta with realtime client monitoring

Vegeta with realtime client monitoring

Pre requisite

brew install vegeta
go install github.com/rs/jaggr@latest
go install github.com/rs/jplot@latest

How to execute

# Pre requirement: install https://github.com/Omochice/deepl-translate-cli
# Usage: source <(curl -sSL https://gist.githubusercontent.com/umiyosh/96ac77719c6de6c79c52529dcef24b1d/raw/9ad164120d66f5afdb1b4ece4d07740b29fb7caa/github-copilot-cli-wrapper.sh)
# Example: https://twitter.com/umiyosh/status/1641625929360474113
function 'myhelp' () {
if [ -z "$*" ]
then
echo "Usage: ?? '<任意の日本語>'"
return 1
fi
translated_cmd=$(echo "$*" | deepl-translate-cli -pro -s ja -t en)
@umiyosh
umiyosh / gist:67cbcaf978e965bae0608e421f844501
Last active April 22, 2022 09:00
Example for passing git log to fzf with color without pager

unbuffer git --no-pager log --date=iso --pretty=format:'%x09%C(yellow)%h%Creset - <%x09%C(cyan bold)%an%Creset> %ce - %cd - %C(magenta reverse)%d%Creset %s ' --abbrev-commit|fzf --ansi

image

勉強会事前作業

gvmインストール

% bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
% vi .bashrc 
if [[ -f $HOME/.gvm/scripts/gvm ]] ; then
  source $HOME/.gvm/scripts/gvm
fi
if [[ -f $HOME/.gvm/scripts/gvm ]] ; then
source $HOME/.gvm/scripts/gvm
fi
@umiyosh
umiyosh / .vimrc
Last active November 7, 2018 11:11
scriptencoding utf-8
if has('vim_starting')
set runtimepath+=~/.vim/plugged/vim-plug
if !isdirectory(expand('~/.vim/plugged/vim-plug'))
echo 'install vim-plug...'
call feedkeys(' ')
call system('mkdir -p ~/.vim/plugged/vim-plug')
call system('git clone https://github.com/junegunn/vim-plug.git ~/.vim/plugged/vim-plug/autoload')
end
endif
@umiyosh
umiyosh / pretty_cluster_node.py
Created March 27, 2017 13:23
pretty_cluster_node.py
import fileinput
import re
masters_info = []
slaves_info = []
for line in fileinput.input():
info = {}
cluster_node = re.split(r' +', line)
if 'master' in cluster_node[2]: