この記事はVim駅伝の2023-11-08の記事です。
前回の記事はkyoh86さんのTOMLはスニペット書くのに良い感じです。
次回の記事はNI57721さんのVimで最近閉じたファイルを開こうです。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一上一下 | |
一世一代 | |
一世一元 | |
一世一度 | |
一世之傑 | |
一世之雄 | |
一世木鐸 | |
一世風靡 | |
一丘一壑 | |
一丘之貉 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// deno run --allow-net=bsky.social invite_history.ts | |
import AtprotoAPI from "npm:@atproto/api"; | |
const { BskyAgent } = AtprotoAPI; | |
const service = "https://bsky.social"; | |
const agent = new BskyAgent({ service }); | |
const identifier = "YOUR_BLUESKY_IDENTIFIER"; // did or handle | |
const password = "YOUR_BLUESKY_PASSWORD"; // app-password is available |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Usage: | |
// 1. Create a deno.json(c) file in the root of your project | |
// 2. Add hook scripts in "tasks" key like: | |
// { | |
// "tasks": { | |
// "pre-commit": "deno fmt", | |
// "pre-push": "deno test" | |
// }, | |
// "hooks_dir": ".my-hooks" // optional, default: ".hooks" | |
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# define in your .bashrc or .zshrc | |
# fuzzy edit gist | |
fest() { | |
gh gist list "$@" | fzf --with-nth=-2,-4,-3,2..-5 | awk '{print $1}' \ | |
| xargs --no-run-if-empty --open-tty gh gist edit | |
} | |
# view web gist | |
vest() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let col = getcurpos('.')[2] | |
let line = getline('.') | |
let pre = substitute(line[:col-1], '^.*[^0-9A-Za-z_.]', '', '') | |
let post = substitute(line[col:], '[^0-9A-Za-z_.].*$', '', '') | |
echo pre .. post |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- https://support.microsoft.com/ja-jp/topic/%E3%83%AD%E3%83%BC%E3%83%9E%E5%AD%97%E5%85%A5%E5%8A%9B%E3%81%AE%E3%81%A4%E3%81%A5%E3%82%8A%E4%B8%80%E8%A6%A7%E8%A1%A8%E3%82%92%E7%A2%BA%E8%AA%8D%E3%81%97%E3%81%A6%E3%81%BF%E3%82%88%E3%81%86-bcc0ad7e-2781-cc9a-e524-7de506d8fdae | |
local roman_kana_table = { | |
-- common symbols in japanese writings | |
['~'] = '~', [','] = '、', ['.'] = '。', ['/'] = '・', | |
['-'] = 'ー', ['['] = '「', [']'] = '」', | |
-- other full-space symbols | |
-- ['!']='!', ['"']='”', ['#']='#', ['$']='$', ['%']='%', | |
-- ['&']='&', [''']='’', ['(']='(', [')']=')', ['*']='*', | |
-- ['+']='+', [',']=',', ['-']='-', ['.']='.', ['/']='/', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Save this file as `git-sw` in your $PATH and run `chmod +x git-sw`. | |
# Run `git sw -` to switch to last branch. | |
# Run `git sw` to select branch using fzf. | |
# Run `git sw branch-name` to pass query to fzf. | |
# If the argument is matched to existing branch, change to that immediately. | |
# Create new branch when query is not matched by `fzf --print-query | tail -1`. | |
# ref: https://github.com/junegunn/fzf/issues/1693#issuecomment-699642792 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function threeCharactersTimestamp(date?: Date) { | |
if (!date) { | |
date = new Date(); | |
} | |
const [h, m, s] = [date.getHours(), date.getMinutes(), date.getSeconds()]; | |
// min & sec eatch 4 seconds | |
const ms = Math.floor((m * 60 + s) / 4); | |
const [m2, s2] = [Math.floor(ms / 30), ms % 30]; |
NewerOlder