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 clean-js () { | |
local transforms='arrow,for-of,for-each,arg-rest,arg-spread,obj-method,obj-shorthand,no-strict,exponent,multi-var,let,class,commonjs,template,default-param,destruct-param,includes' | |
lebab --transform $transforms | prettier --no-semi --single-quote | |
} |
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 bash | |
# Add this function to your .bashrc/.zshrc | |
function ts-add () { | |
if [ "$1" = "--dev" ] || [ "$1" = "-D" ]; then | |
dev=true | |
shift | |
fi | |
packages=("$@") |
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/zsh | |
REPO="org-foo/repo-bar" | |
TARGET_YEAR=2019 | |
function encode_uri_component() { | |
node -e "console.log(encodeURIComponent(process.argv[1]).replace(/%20/g, '+'));" "$1" | |
} | |
function get_pr_search_url() { |
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
// Sprite sheet/texture atlas sampling in OpenGL/GLSL with Shadron | |
// (c) 2020 Mick Dekkers | |
// This work is licensed under the terms of the MIT license. See https://opensource.org/licenses/MIT for a copy. | |
// Tested with the emoji spritesheets at https://github.com/iamcal/emoji-data , specifically: | |
// https://github.com/iamcal/emoji-data/blob/8930a29f7193cc7603765c9046edac7ca529de78/sheets-clean/sheet_apple_64_clean.png | |
parameter int outputSize = 300.0 : range(1, 1024); | |
parameter int spriteSize = 64 : range(1, 1024); | |
parameter int spritePadding = 2 : range(1, 100); |
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 bash | |
if [[ $BASH_VERSION == [0123].* ]]; then | |
>&2 printf "\033[0;31mThe %s script requires bash >= v4 (released february 2009)\033[0m\n" "$0" | |
>&2 echo "You are using bash $BASH_VERSION" | |
if [[ "$(uname -s)" == Darwin* ]]; then | |
>&2 echo "macOS is known to include a particularly ancient version of bash due to licensing shenanigans." | |
>&2 printf "You can use homebrew to update it yourself: \033[1;36mbrew install bash \033[0m\n" | |
fi | |
exit 1 |
OlderNewer