Skip to content

Instantly share code, notes, and snippets.

View generalpiston's full-sized avatar

Abraham Elmahrek generalpiston

View GitHub Profile
@generalpiston
generalpiston / com.google.cloud_sql_proxy.plist
Last active September 7, 2022 17:16
launchctl plist config for google cloud_sql_proxy
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.google.cloud_sql_proxy</string>
<key>ProgramArguments</key>
<array>
<string><cloud_sql_proxy path>/cloud_sql_proxy</string>
@generalpiston
generalpiston / useNext.tsx
Last active September 18, 2021 19:12
Hook for storing, removing, and going to next location in search parameters and provides a default. Automatically clears when going to next location.
import { useCallback, useMemo } from 'react'
interface NextActions {
go: () => void
setValue: (next?: string) => void
clear: () => void
status: 'query'
}
interface DefaultNextActions {