Moved to knu/azik.
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/sh | |
# | |
# git-delete-merged - delete local branches that have been merged on GitHub | |
# | |
# Copyright (c) 2022 Akinori MUSHA | |
# | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions |
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
[alias] | |
main = "!set -e; p=refs/remotes/origin; if r=\"$(git symbolic-ref $p/HEAD 2>/dev/null)\"; then echo \"${r#$p/}\"; exit; fi; printf %s \"Fixing the broken ref $p/HEAD... \" >&2; if r=\"$(git remote show origin | awk '/^ HEAD branch: /{print $3}')\"; then echo done. >&2; echo \"$r\"; git symbolic-ref \"$p/HEAD\" \"$p/$r\"; else echo failed. >&2; exit 1; fi" | |
rails-db-rollback = "!sh -ec 'git diff --name-only --diff-filter=A \"${1-$(git main)}\" -- db/migrate | ruby -e \"puts \\$<.read.scan(%r{/([0-9]+)_})\" | sort -r | while read v; do rake db:migrate:down VERSION=$v; done' ." |
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/sh | |
set -ex | |
sudo rsync -av /Applications/Google\ Drive\ File\ Stream.app/Contents/MacOS/dfsfuse.kext /Library/Extensions/ | |
sudo kextload /Library/Extensions/dfsfuse.kext | |
killall Google\ Drive\ File\ Stream || : | |
while pgrep -q Google\ Drive\ File\ Stream; do | |
sleep 1 | |
done |
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
knu = require("knu") -- https://github.com/knu/hs-knu | |
-- Switch between Karabiner-Elements profiles as Barrier enters a different host | |
do | |
-- Configure Barrier (https://github.com/debauchee/barrier) to output log to ~/Library/Logs/barrier.log | |
local logFile = os.getenv("HOME") .. "/Library/Logs/barrier.log" | |
local lineNo = 1 | |
local host = nil | |
local defaultProfile = "Default" | |
local profileForHost = function (host) |
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
# frozen_string_literal: true | |
require 'benchmark/ips' | |
require 'date' | |
Benchmark.ips do |x| | |
x.config(time: 5, warmup: 2) | |
funcs = [ | |
->(a, b) { |
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
(with-eval-after-load 'lsp | |
(defun my-lsp-search-node_modules () | |
(and buffer-file-name | |
(lsp-clients-flow-activate-p buffer-file-name major-mode) | |
(let* ((flow-location "node_modules/.bin/flow") | |
(root (locate-dominating-file buffer-file-name flow-location))) | |
(if root | |
(set (make-local-variable 'lsp-clients-flow-server) | |
(expand-file-name flow-location root)))))) |
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
function unLoad() { | |
const { events } = this.props; | |
const { editor } = this.state; | |
if (!editor) return; | |
const { change, ...eventsSansChange } = events; | |
for (const [event, handler] of Object.entries(eventsSansChange)) { | |
editor.on(event, handler); | |
} | |
} |
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/sh | |
set -e | |
while getopts 'x' opt; do | |
case "$opt" in | |
x) | |
flags=--ignored | |
;; | |
*) |
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
require 'net/protocol' | |
class Net::Protocol | |
module ForceSNI | |
def ssl_socket_connect(*) | |
@sock.hostname = @host if @sock.respond_to? :hostname= | |
super | |
end | |
end | |
prepend ForceSNI |