+ app
- App.js
- Layout.js
+ components
- FormText.js
- FormEmail.js
- Card.js
- CancelButton.js
- Pagination.js
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
import { type UseHook } form "./useHookShared"; | |
import { useHookOld } from "./useHookOld"; | |
import { useHookNew } from "./useHookNew"; | |
type MyComponentProps = { | |
id: string; | |
variant?: "default" | "bold", | |
} | |
export function MyComponent(props: MyComponentProps) { |
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
const stages = ['production', 'staging', 'development', 'test'] as const; | |
type Stage = typeof stages[number]; | |
function getStage(stages: Stage[]) { | |
if (!stages.length) return 'production'; | |
for (const stage of stages) { | |
// if any of the provided stages is production, assume we are in production | |
if (stage === 'production') { |
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
/* eslint-disable @typescript-eslint/no-unused-vars */ | |
/* eslint-disable no-console */ | |
/* ************************************** */ | |
export interface Branding<BrandT> { | |
_type: BrandT; | |
} | |
export type Brand<T, BrandT> = T & Branding<BrandT>; |
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
// Most of this is copied from: https://github.com/wbyoung/babel-plugin-transform-postcss | |
const {spawnSync, spawn} = require('child_process') | |
const path = require('path') | |
const socketPath = path.join('/tmp', 'styled-jsx-plugin-postcss--' + process.pid + '.sock') | |
const nodeExecutable = process.argv[0] | |
const clientExcutable = path.join(__dirname, 'client.js') | |
const serverExcutable = path.join(__dirname, 'server.js') |
- Strict-Transport-Security. Ensures that all traffic, even the first request to a non-https version of the URL, will be encrypted.
- Referrer-Policy. Allows you to tell the browser what to set as the referrer URL when going to an external site.
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
### ABOUND BACKUPS | |
DB_BK_CMD = /home/user/backups/site_name/do-db-backup.sh | |
FILE_BK_CMD = /home/user/backups/site_name/do-files-backup.sh | |
# backup / Every day @ 3 am | |
0 3 * * * $DB_BK_CMD do-daily database_name | |
0 3 * * * $FILE_BK_CMD do-daily /home/user/public_html | |
# rotate weekly / Every 7 days @ 3:30am |
I'm a freelance programmer. Sometimes I work on projects where the client wants
to occasionally see code updates in their own repo, but I don't want them to see
my work schedule. If I push my dev repo, they'll see when I'm working, how many
hours, etc. To solve that, I started maintaining a for-client
branch that
only shows weekly, squashed merges of master. Each commit is monolithic, with
one commit message (it doesn't include all of the individual commit times, messages,
etc. from the master branch).
NewerOlder