To start, list current installed Java versions:
/usr/libexec/java_home -verbose
/** | |
* Example usage: | |
* | |
* // default depth of 3: (fastest) | |
* type keys = Paths<SomeNestedObject> // returns "property" | "nested.property" | "nested.nested.property" | |
* | |
* // depth of 10: (can be slow) | |
* type keys = Paths<SomeNestedObject, 10> | |
* | |
* // depth of 10 with keys of type string and number: (slowest) |
#!/usr/bin/env bash | |
# | |
# simple recursive search and replace string in files | |
# setup: alias replace='~/replace.sh' | |
# notes: you will need to escape special chars! eg: replace '\/dir1' '\/dir2' . | |
# usage: replace <oldstring> <newstring> <path> <depth> | |
# examples: | |
# replace "([^\s]+.php)" "\/\1" . | |
# replace "\"\/([^\/]+.php)" "\"\/dir\/\1" . |
import React, { type PropsWithChildren } from 'react'; | |
import { PersistQueryClientProvider } from '@tanstack/react-query-persist-client'; | |
import { onlineManager } from '@tanstack/react-query'; | |
import { queryClient } from './queryClient'; | |
import { storagePersister } from './storagePersister'; | |
export function QueryClientProvider(props: PropsWithChildren) { | |
return ( | |
<PersistQueryClientProvider | |
client={queryClient} |
# NOTE: must be run on a MacOS Agent! | |
steps: | |
- script: | | |
# Install AVD files | |
yes | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86_64' | |
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses | |
# Create emulator | |
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86_64' --force |
#!/usr/bin/env bash | |
# | |
# Approach: | |
# 1. Find variable declaration in the form of "$my-var: anyvalue" | |
# 2. Loop through found variables and find occurrences of each variable in all sass files | |
# 3. Filter out vars that occurred only once | |
if [ -z "$1" ]; then | |
echo "Please specify a directory as the first argument." | |
exit 1 |
server { | |
listen YOUR_IP_ADDRESS:80 default_server; | |
root /var/www/nginx; | |
index index.html index.htm; | |
# This is just an invalid value which will never trigger on a real hostname. | |
server_name _; | |
server_name_in_redirect off; |
# Install AVD files
yes | $ANDROID_HOME/tools/bin/sdkmanager --install 'system-images;android-29;default;x86'
yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses
# Create emulator
echo "no" | $ANDROID_HOME/tools/bin/avdmanager create avd -n Pixel_API_29_AOSP -d pixel --package 'system-images;android-29;default;x86' --force
$ANDROID_HOME/emulator/emulator -list-avds
cloc --exclude-dir=vendor,.xcodeproj,xcuserdata,build,Pods,node_modules,.gradle,dist,yarn.lock,package-lock.json . |
find . -iname "bin" -o -iname "obj" | xargs rm -rf |