This Gist was automatically created by Carbide, a free online programming environment.
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
# Backwards compatibility for fish 2.0.0 | |
not contains source (builtin -n) | |
and alias source . |
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
/* 2>/dev/null | |
COMPILED=${0%.*} | |
[[ -e "$COMPILED" ]] || clang $0 -o "$COMPILED" -framework Foundation | |
exec "$COMPILED" $@ | |
*/ | |
#import <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) |
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 | |
set -euo pipefail | |
mkdir -p tmp/overrides/webpack%3a/%2e | |
while true; do | |
while IFS= read -r -d '' override_file | |
do | |
file=$(echo "$override_file" | python -c 'import re, sys; print re.split("^tmp/overrides/webpack%3a/%2e/|%3f.*$", sys.stdin.read().strip())[1]') | |
cp -f "$override_file" "$file" |
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
{ | |
let clientAppState = JSON.parse($("#client-app-state").text.replace(/&q;/g, '"')) | |
let { HttpState } = clientAppState | |
let route = Object.keys(HttpState)[0] | |
HttpState[route].data.properties.identifier.uuid | |
} |
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
// pbpaste | deno run --reload https://gist.githubusercontent.com/szhu/54a314fa055b4e6d07e1446ca9f3ea8a/raw/convertPropTypesToTs.ts | pbcopy | |
interface ToStringAble { | |
toString(): string; | |
} | |
type TypeSpecToString = (this: TypeSpec) => string; | |
interface TypeSpec { | |
name: string; |
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
# Tell Spotlight to ignore all node_modules directories. | |
# Run this from the home directory. | |
# Pieced together from: | |
# - https://github.com/yarnpkg/yarn/issues/6453#issuecomment-498110933 | |
# - https://stackoverflow.com/a/4210072/782045 | |
# - https://superuser.com/a/151427/110699 | |
# - https://apple.stackexchange.com/a/258791/31413 | |
# - https://unix.stackexchange.com/a/24563/64762 | |
# This does a dry run; remove `echo` to do actually do it. |
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
// domToTsv - Convert rows in a webpage into TSV-formatted table. | |
// Example usage: | |
// This converts instacart.com order receipts to TSV. | |
domToTsv( | |
// Select a single table: | |
[`#store-wrapper main`], | |
// For each table, select every row: | |
`:scope > ul > li`, |
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 | |
set -e | |
old_stash_count=$(git stash list | wc -l) | |
git stash push --keep-index --include-untracked --quiet | |
if test "$old_stash_count" == "$(git stash list | wc -l)"; then | |
echo "All changes have been committed." | |
exit 0 | |
fi |
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
for (let image of document.querySelectorAll("image")) { | |
let url = (image.getAttribute("xlink:href")); | |
fetch(url).then(res => res.blob()).then(blob => open(URL.createObjectURL(blob))); | |
} |