Skip to content

Instantly share code, notes, and snippets.

View igrep's full-sized avatar
:shipit:
Programming in TypeScript, Python, or Haskell.

YAMAMOTO Yuji igrep

:shipit:
Programming in TypeScript, Python, or Haskell.
View GitHub Profile
@canalun
canalun / oscillateText.js
Last active October 20, 2024 07:14
text oscillator
const cname = "movearound-text-domdom-enjoy"
addClassToTextsAndImagesRecursively(document.body)
const targets = Array.from(document.getElementsByClassName(cname))
setInterval(() => oscillateElements(targets), 100)
function addClassToTextsAndImagesRecursively(root) {
if (root.tagName === "HEAD" || root.tagName === "SCRIPT" || root.tagName === "STYLE") return
const extendedChildNode = (node) => node.firstChild || node.shadowRoot || node.contentDocument
@kumagi
kumagi / LICENSE.txt
Last active November 24, 2025 05:45
とても簡単なリングバッファ
Copyright 2023 Hiroki Kumazaki
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR O
@igrep
igrep / translate-mdn-ja.vim
Last active November 30, 2025 06:53
MDNの翻訳を始めるときに便利なVim向け関数群
" # 使用方法
" :call BeginTranslation()
" :call OpenJaPath()
" :let commit = GetLatestSourceCommit()
"
" # 概要
"
" ## BeginTranslation
" MDNの翻訳に取りかかる際、現在開いている英語版のパスを日本語版のパスに変換して英語版をコピーし、開く
" その後Front-matterを編集し、title と slug 以外を削除し、l10n を追加することで、翻訳の準備を整える
@lelegard
lelegard / git-set-exec.md
Created December 7, 2021 08:32
Git on Windows: setting executable permission on a script

Git on Windows: setting executable permission on a script

The problem: Create a script (shell, python, whatever) on Windows, add it to a git repository. Then clone or pull the repo on a UNIX system (Linux, macOS). The file won't get the executable permission.

If the script had been created from the beginning on a UNIX system with executable permission, this permission would have been propagated to the repo. However, on Windows, this type of permission does not exist and cannot be set at system level.

@mrtry
mrtry / check-xcode-version.sh
Created May 21, 2021 08:53
.xcode-versionと一致してるかをチェックするスクリプト
# Project rootに移動
cd $(git rev-parse --show-toplevel)
if [ "$(cat .xcode-version)" != "$(xcodebuild -version | awk 'NR==1{print $2}')" ]; then
echo 'Invalid Xcode version'
echo ".xcode-version: $(cat .xcode-version)"
echo "xcodebuild version: $(xcodebuild -version | awk 'NR==1{print $2}')"
exit 1
fi
@mrtry
mrtry / Gemfile
Last active May 23, 2021 10:49
Bump version for react-native
# android/ ios/ に配置
source "https://rubygems.org"
fastlaneVersion = File.join(File.dirname(__FILE__), '../fastlane-version')
eval_gemfile(fastlaneVersion) if File.exist?(fastlaneVersion)
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
@mrtry
mrtry / post-checkout
Created May 19, 2021 12:11
run `npm install` when update package.json
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
prevHEAD=$1
nextHEAD=$2
prevPackageHash=$(git log --format="%C(auto)%h%Creset" -n 1 $prevHEAD -- package.json | cat)
nextPackageHash=$(git log --format="%C(auto)%h%Creset" -n 1 $nextHEAD -- package.json | cat)
if [ "$prevPackageHash" != "$nextPackageHash" ]; then
@mengwangk
mengwangk / compe.lua
Last active January 10, 2022 01:57
Neovim LSP Enhanced - compe.lua
-- Configuration for nvim-compe
local utils = require('utils')
vim.cmd [[set shortmess+=c]]
utils.opt('o', 'completeopt', 'menuone,noselect')
require'compe'.setup {
enabled = true;
autocomplete = true;
@mengwangk
mengwangk / init.lua
Created March 13, 2021 13:14
Neovim LSP Enhanced - init.lua
local on_attach = function(client, bufnr)
-- require('completion').on_attach()
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc')
-- Mappings.
(async () => console.log(
(await import(`data:text/javascript,export default "Is this a safe way to eval?"`)).default
))()