Hat tip to Clean Code by Robert C. Martin (Uncle Bob)
- Consistency
- Predictability
- Maintainability
- Readability
| "use client"; | |
| import { Drawer } from "@repo/components"; | |
| import { Button } from "@repo/components/ui/button"; | |
| import { Input } from "@repo/components/ui/input"; | |
| import { Label } from "@repo/components/ui/label"; | |
| import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@repo/components/ui/select"; | |
| import { useSearchParams } from "next/navigation"; | |
| import { useEffect, useState } from "react"; |
| import localforage from 'localforage'; | |
| import { useCallback, useEffect, useState } from 'react'; | |
| type Setter = (value: any) => Promise<any>; | |
| /** | |
| * Usage example: | |
| * | |
| * const IS_DEV_KEY = 'is-dev'; | |
| * |
| import localforage from 'localforage'; | |
| import { useCallback, useEffect, useState } from 'react'; | |
| type Setter = (value: any) => Promise<any>; | |
| /** | |
| * Usage example: | |
| * | |
| * const IS_DEV_KEY = 'is-dev'; | |
| * |
| killport() { | |
| if [ -z "$1" ]; then | |
| echo "Usage: killport <port>" | |
| return 1 | |
| fi | |
| lsof -ti:$1 | xargs kill -9 | |
| } |
| #!/bin/bash | |
| ## Installation: Add to path and call with `dates` or `dates <directory>` | |
| ## Bard prompt: "write me a script to use exiftool to prefix mp4 filenames with their timestamps" | |
| if [[ $1 ]]; then | |
| echo "The first argument exists" | |
| current_directory=$(pwd)/$1 | |
| else |
| Get-ChildItem "C:\Users\chris\Downloads" -Filter *.zip | | |
| Foreach-Object { | |
| $name = $_.Name | |
| $folderName = $name.Split('.')[0] | |
| $folderPath = "C:\Users\chris\Downloads\takeout-in\$folderName\" | |
| echo "Processing $folderPath" | |
| New-Item $folderPath -type Directory |
| Run chromaui/action@v1 | |
| Chromatic CLI v5.7.0 | |
| https://www.chromatic.com/docs/cli | |
Fireline is a recent open source project of mine.
It's a series of drop-in Firebase Functions and React hooks that integrate with Stripe to add SaaS payments to web apps.
| steps: | |
| - name: 'gcr.io/cloud-builders/docker' | |
| entrypoint: 'bash' | |
| args: ['-c', 'docker pull us.gcr.io/$PROJECT_ID/flyerr:latest-$BRANCH_NAME || exit 0'] | |
| - name: 'gcr.io/cloud-builders/docker' | |
| args: | |
| [ | |
| 'build', | |
| '-t', | |
| 'us.gcr.io/$PROJECT_ID/flyerr:latest-$BRANCH_NAME', |