Skip to content

Instantly share code, notes, and snippets.

View kuboon's full-sized avatar
🏠
Working from home

Ohkubo KOHEI kuboon

🏠
Working from home
View GitHub Profile
@kuboon
kuboon / docker-rootful-vz.yaml
Last active April 5, 2024 02:02
lima docker-rootful-vz
# A template to run ubuntu using vmType: vz instead of qemu (Default)
# This template requires Lima v0.14.0 or later and macOS 13.
vmType: "vz"
rosetta:
# Enable Rosetta for Linux.
# Hint: try `softwareupdate --install-rosetta` if Lima gets stuck at `Installing rosetta...`
enabled: true
# Register rosetta to /proc/sys/fs/binfmt_misc
binfmt: true
@kuboon
kuboon / deserialize_bench.rb
Created January 25, 2024 09:10
deserialize_bench.rb
require 'benchmark'
require 'json'
require 'active_support/notifications'
require 'active_support/cache'
array = (1..1000).map { rand }
TIMES = 1000
Benchmark.bmbm do |x|
cache = ActiveSupport::Cache::FileStore.new("./tmp/cache")
@kuboon
kuboon / dive.fish
Last active March 21, 2024 06:41
fish dive into git repo
function dive
set repo $argv[1]
if test -z (echo $repo | cut -d '/' -f3)
set repo github.com/$repo
end
set path ~/repos/$repo
if test -d $path
cd $path
echo "Moved to existing directory $path"
@kuboon
kuboon / gist:c5b8f60044de747015fe8df446bb862e
Created May 8, 2023 06:40
xorshift32 for Excel / google sheets # replace "input" to A1 or anything
=LET(LX, LAMBDA(X, A, BITXOR(X, BITLSHIFT(BITAND(X, 2^(32-A)-1), A))), RX, LAMBDA(X, A, BITXOR(X, BITRSHIFT(X, A))), LX(RX(LX(input, 13), 17), 5))
@kuboon
kuboon / .htaccess
Created February 8, 2023 04:09
rails を cgi で無理やり動かす
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ dispatch.cgi/$1 [QSA,L]
@kuboon
kuboon / Cargo.toml
Created January 5, 2023 11:47
chacha rust sample
[package]
name = "chacha"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
"chacha20poly1305" = "0.10.1"
@kuboon
kuboon / mlogjs.ts
Last active November 28, 2022 08:26
phasefabric 補充, 回復
// https://mlogjs.github.io/mlogjs/editor.html
const pid = Vars.thisx * 10000 + Vars.thisy * 10;
const flagGo = pid;
// const flagRepair = pid + 1;
unitBind(Units.mega);
const [, , , core] = unitLocate.building({
group: "core",
enemy: false,
});
while (true) {
@kuboon
kuboon / .gitconfig
Last active September 9, 2022 08:04
git alias
[alias]
begin = "!f(){ c=`git branch --show-current`; git switch -c $1; git commit --allow-empty -m \"$2\"; git push --set-upstream origin $1; gh pr create -a @me -b \"\" --draft --base $c -t \"$2\"; }; f"
pushtag = "!f(){ git tag -a -f $1 -m \"$2\"; git push -f origin $1 ; }; f"
sync = "fetch --prune --tags -f"
@kuboon
kuboon / autoscroll_after_viewed.js
Created May 31, 2022 04:42
Tampermonkey: auto scroll after viewed
// ==UserScript==
// @name Auto Scroll After Viewed
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Click 'Viewed' checkbox easier.
// @author kuboon
// @match https://github.com/*/files
// @icon https://www.google.com/s2/favicons?domain=github.com&sz=256
// @grant none
// ==/UserScript==
@kuboon
kuboon / Dockerfile
Created February 14, 2022 07:27
.devcontainer
# https://hub.docker.com/_/microsoft-vscode-devcontainers
FROM mcr.microsoft.com/vscode/devcontainers/base:0-ubuntu-21.04
RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
&& apt-get -y install --no-install-recommends fish
RUN chsh -s /usr/bin/fish vscode
USER vscode
SHELL ["/usr/bin/fish", "-l", "-c"]
# http://asdf-vm.com/guide/getting-started.html#_3-install-asdf