Skip to content

Instantly share code, notes, and snippets.

View aileron's full-sized avatar

AILERON aileron

View GitHub Profile
@aileron
aileron / bootstrap.sh
Created November 18, 2024 02:53
This script sets up a new Rails project with modern frontend stack including Inertia.js, React, Tailwind CSS, and shadcn/ui components.
#!/bin/bash
# Exit immediately if a command exits with a non-zero status
set -e
# Get directory name from argument, default is "my-app"
APP_NAME=${1:-"my-app"}
# Check if directory already exists
if [ -d "$APP_NAME" ]; then
@aileron
aileron / ridgepole.rake
Created November 18, 2024 02:52
ridgepole rake task
module RidgepoleTask
extend Rake::DSL
namespace :ridgepole do
desc "Exec Apply Dry Run"
task(apply_dry_run: :environment) { ridgepole "--apply --dry-run" }
desc "Exec Apply"
task(apply: :environment) { ridgepole "--apply --drop-table" }
@aileron
aileron / vcdal.js
Created March 3, 2023 10:11
vcdal.js
var $jscomp = $jscomp || {};
$jscomp.scope = {};
$jscomp.arrayIteratorImpl = function(a) {
var d = 0;
return function() {
return d < a.length ? {
done: !1,
value: a[d++]
} : {
done: !0
require 'nokogiri'
html = <<HTML
<main>
<div>plain div</div>
<div class="test">test</div>
<div class="test">test</div>
</main>
HTML
@aileron
aileron / youtube.html
Created November 10, 2022 08:13
background youtube video autoplay
<script src="https://cdn.jsdelivr.net/gh/thelevicole/[email protected]/dist/YouTubeToHtml5.js"></script>
<video data-yt2html5="https://www.youtube.com/watch?v=ScMzIvxBSi4" playsinline autoplay muted loop ></video>
<script>
new YouTubeToHtml5();
</script>
<style>
html, body {
margin: 0;
padding: 0;
}
require 'time'
wd = ["日", "月", "火", "水", "木", "金", "土"]
while line = gets
begin
pos = line.index('\t')
time_text = line[0..pos]
cmd = line[pos..line.size].strip
time = Time.parse(time_text)
@aileron
aileron / reloadDNS.sh
Created April 11, 2022 09:26
reloadDNS
alias reloadDNS="sudo killall mDNSResponder && sudo dscacheutil -flushcache"
@aileron
aileron / .py
Created February 1, 2022 05:47
Keyhac
import sys
import os
import datetime
import subprocess
from keyhac import *
def configure(keymap):
keymap_terminal = keymap.defineWindowKeymap( app_name="com.googlecode.iterm2" ) # iterm2だけのローカル設定
keymap_terminal["Ctrl-J"] = "104" # CTRL-Jを入力するとかなを送信。104はかなキーの仮想キーコード
set-option -g default-terminal screen-256color
# set-option -g default-command "reattach-to-user-namespace -l zsh"
set -g terminal-overrides 'xterm:colors=256'
set -g pane-border-status top
# Use vim keybindings in copy mode
setw -g mode-keys vi
# Setup 'v' to begin selection as in Vim
bind-key -T copy-mode-vi v send -X begin-selection
@aileron
aileron / .zshrc.prompt
Created August 3, 2021 01:47
.zshrc.prompt
# Pure
# by Sindre Sorhus
# https://github.com/sindresorhus/pure
# MIT License
# change this to your own username
DEFAULT_USERNAME='sindresorhus'
# threshold (sec) for showing cmd exec time