This file contains hidden or 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 | |
# shellcheck shell=dash | |
set -euf | |
hook_name="$(basename "$0")" | |
check_hooks() { | |
project="$1" |
This file contains hidden or 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 -euf | |
install_dir=$1 | |
if [ -e "$install_dir" ]; then | |
printf 'Install path `%s` already exists; use different path.\n' \ | |
"$install_dir" \ | |
1>&2 | |
exit 1 | |
fi |
This file contains hidden or 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
# This file is automatically @generated by Cargo. | |
# It is not intended for manual editing. | |
version = 3 | |
[[package]] | |
name = "anyhow" | |
version = "1.0.41" | |
source = "registry+https://github.com/rust-lang/crates.io-index" | |
checksum = "15af2628f6890fe2609a3b91bef4c83450512802e59489f9c1cb1fa5df064a61" |
This file contains hidden or 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
const N = 1_000_000 | |
const M_MAX = 2_000_000_000 | |
const treeHeight = () => (Math.random() * (M_MAX - N) | 0) + N | |
const testCase = () => { | |
const trees = Array.from({ length: N }, treeHeight) | |
return N + ' ' + treeHeight() + '\n' + trees.join(' ') + '\n' | |
} |
This file contains hidden or 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
tell application "System Preferences" | |
activate | |
reveal anchor "Privacy_AllFiles" of pane id "com.apple.preference.security" | |
display dialog "Mark your favourite terminal app to give Full Disk Access." buttons {"Got it"} default button 1 | |
end tell |
This file contains hidden or 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 ruby | |
[].filter_map {} # filter_map support check | |
require 'net/http' | |
MIRRORLIST = Net::HTTP.get(URI('https://www.archlinux.org/mirrorlist/?country=KR&country=JP&country=SG&country=TW&country=HK&protocol=https')) | |
ARCH = `uname -m`.strip | |
REPO = 'core' |
This file contains hidden or 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
try %{ require-module plug } catch %{ eval %sh{ | |
if not [ -d "$kak_config/autoload/plugins/plug" ]; then | |
git clone -q --depth=1 \ | |
https://github.com/alexherbo2/plug.kak \ | |
"$kak_config/autoload/plugins/plug" \ | |
2>&1 >/dev/null | |
cat <<- EOF | |
source "%{$kak_config/autoload/plugins/plug/rc/plug.kak}" | |
require-module plug | |
hook -once global KakBegin .* plug-upgrade |
This file contains hidden or 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
# plug.kak | |
declare-option -hidden str plug_kak_path "%val{config}/plugins/plug.kak" | |
nop %sh{ | |
if [ ! -f "$kak_opt_plug_kak_path/rc/plug.kak" ]; then | |
mkdir -p $kak_opt_plug_kak_path | |
git clone https://github.com/robertmeta/plug.kak $kak_opt_plug_kak_path | |
fi | |
} | |
source "%opt{plug_kak_path}/rc/plug.kak" |
This file contains hidden or 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
verbosity = 2 | |
[language.typescript] | |
filetypes = ["typescript"] | |
roots = ["tsconfig.json"] | |
command = "typescript-language-server" | |
args = ["--stdio"] |
This file contains hidden or 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
// TypeScript Playground: https://www.typescriptlang.org/play?target=99&jsx=0&ts=4.0.2#code/C4TwDgpgBAogjgVwIYBsDOAeA+lCAPYCAOwBM0oAhAGktwOLKgEEamA+KAXiiIgDcIAJwBQw0JCgBJImATAuwqEqgAfKAG8o4iAC4oAciT6aRJAFtdUNMEEBLIgHMoAX0XK1m7Xv0AjY1CQHSyIEMx8hFzclDy1wS30AY38+WzRbHxRLTQS9AEYaMHsIJDAwTO9CgC9KoxdI5VUNWMhvEmTU9PKmkj0AJgKikrL4hIALWwSAa2J9OtcxONg8SATCEgUGmK8DIxNzS2s7RxplQMsEUggAMyKSGhS0jPPLm951102m7d9-Uws9C4ka63GhnPQhMJCE5KB6dZ5A14Qd5RRqeOLeJJ7f5QQHAt6goIAl4gqCwp56bJ5Gg9HHE-FQQq8IZdfRVGqzZz1dxfdEGNpY+F4pEEwWIu6kjrkpo5WkIkk0-oMwalFljCbTIgcyILCRMVbIFBcZhENAAdyEGGksmAbB10AAShA0AgUPJuPADZgYMsIKthcx9agaN6VmtbXbjWaLQAVDjcaNAA | |
type Equals<_ extends B, B extends A, A> = never | |
type Input = | |
| { type: 'a', name: string } | |
| { type: 'b', age: number } | |
| { type: 'c', visible: { c: 1, pineapple: 'pizza' } } | |
| { type: 'd', visible: { d: 2, pineapple: 'chicken' } } |