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 | |
CURRENT_BRANCH=$(git branch --show-current) | |
BRANCHES=$(git branch --format="%(refname:short) %(upstream:track)" | grep "\[gone\]" | awk '{ print $1 }' | grep -v $CURRENT_BRANCH) | |
[[ -n "$BRANCHES" ]] && git branch -D $BRANCHES |
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 | |
MSYS_NO_PATHCONV=1 $(cygpath.exe $LOCALAPPDATA)/SourceTree/app-*/tools/putty/plink.exe git@github.com |
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
import digitalio | |
import board | |
import usb_hid | |
import rotaryio | |
from adafruit_hid.consumer_control import ConsumerControl | |
from adafruit_hid.consumer_control_code import ConsumerControlCode | |
consumer_control = ConsumerControl(usb_hid.devices) | |
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
import board | |
from digitalio import DigitalInOut, Pull | |
import usb_hid | |
from adafruit_hid.keyboard import Keyboard | |
from adafruit_hid.keyboard_layout_us import KeyboardLayout | |
kbd = Keyboard(usb_hid.devices) | |
layout = KeyboardLayout(kbd) | |
class Button: |
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://learn.adafruit.com/adafruit-macropad-rp2040/macropad-basics | |
# https://docs.circuitpython.org/projects/macropad/en/latest/index.html | |
# https://docs.circuitpython.org/projects/hid/en/latest/api.html | |
import time | |
import usb_hid | |
from adafruit_macropad import MacroPad | |
from adafruit_hid.consumer_control import ConsumerControl | |
from adafruit_hid.consumer_control_code import ConsumerControlCode | |
from adafruit_hid.keyboard import Keyboard |
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 | |
sudo apt update | |
sudo apt upgrade -y | |
# Enable systemd | |
echo -e "[boot]\nsystemd=true\n" | sudo tee /etc/wsl.conf > /dev/null | |
# Install Nodejs | |
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - && sudo apt-get install -y nodejs |
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
#!/usr/bin/env node | |
// eth0とdocker0がコンフリクトすると docker run によるコンテナが異常になる | |
// eth0とbr-xxxxがコンフリクトすると docker compose によるコンテナが異常になる | |
const { execSync } = require('child_process'); | |
function ipAddr () { | |
if (process.env.NODE_ENV === 'test') { | |
return [ | |
'inet 172.17.53.125/20 brd 172.17.63.255 scope global eth0', |
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
#!/usr/bin/env node | |
const { execSync } = require('child_process'); | |
const CMD = process.argv[2]; | |
const PORT = process.argv[3]; | |
const IP = execSync('ifconfig eth0').toString().split(/[\r\n]+/) | |
.filter(line => line.match(/inet /))[0].split(/ +/) | |
.filter(token => token)[1]; | |
function usage () { | |
console.log(` |
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 | |
# https://techracho.bpsinc.jp/hachi8833/2017_04_04/38229 | |
# https://gist.github.com/mefellows/4f6ecd2e83de8b591726 | |
# | |
# for localhost:3000 | |
reset() { | |
dnctl -q flush | |
pfctl -f /etc/pf.conf | |
pfctl -d |
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 | |
killall Xcode | |
xcrun -k | |
xcrun simctl delete unavailable | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache" | |
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache" | |
rm -rf ~/Library/Developer/Xcode/DerivedData/* | |
rm -rf ~/Library/Developer/Xcode/Archives/* | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode/* |
NewerOlder