Hardware
- Your trusty (and sharp!) chef knife
- Large bowl
- Big shallow saucepan or big sauté pan
- Tongs or a big spoon
- Tbsp and tsp for measuring or you can eyeball it if you’re sassy
<アンダブロッブ />
Do you know what love is? It’s a hot bath. What happens to things when you leave them in a bath for too long? Huh? They get soft; fall apart. […] It’s a war, baby: this life. The things we endure. You said you saw the future and it’s an apocalypse. Who survives that? The lovers? Or the fighters? They sell us this lie that love is gonna save us. […] Love isn’t gonna save us… it’s what we have to save. Pain makes us strong enough to do it. All our scars, our anger, our despair: it’s armor. Baby, god loves the sinners best ’cause our fire burns bright bright bright. Burn with me.
—Sydney Barret, Legion S2/E4
Here are some organizational patterns I found useful over the years (listed alphabetically!):
const out = { end: '\x1b[0m', // Modifiers. blink: '\x1b[5m', bright: '\x1b[1m', dim: '\x1b[2m', hidden: '\x1b[8m', reverse: '\x1b[7m', underscore: '\x1b[4m', // Foreground Colors. black: '\x1b[30m', blue: '\x1b[34m', cyan: '\x1b[36m', green: '\x1b[32m', magenta: '\x1b[35m', red: '\x1b[31m', yellow: '\x1b[33m', white: '\x1b[37m', // Background Colors. bgBlack: '\x1b[40m', bgBlue: '\x1b[44m', bgCyan: '\x1b[46m', bgGreen: '\x1b[42m', bgMagenta: '\x1b[45m', bgRed: '\x1b[41m', bgYellow: '\x1b[43m', bgWhite: '\x1b[47m', };
Usage:
console.log(out.red, 'Something went wrong:', err, out.end);
I can’t promise you any thing
But I can tell you I’ll never leave.
I have a problem getting values from deeply nested objects: if one of the properties along the namespace is incorrect|modified|removed, Javascript throws. To avoid this, you can end up with obnoxious validation:
// Trying to get this.data.homeScene.user.name const isValid = ( typeof this.data === 'object' && typeof this.data.homeScene === 'object' && typeof this.data.homeScene.user === 'object' && typeof this.data.homeScene.user.name === 'string' ); if (isValid) { const { name } = this.data.homeScene.user; ... }
What if I made a reusable helper to validate the namespace and return the value?
export default function getNamespace(startObj, path) { const isValidArgs = ( typeof startObj === 'object' && typeof path === 'string' ); if (!isValidArgs) return undefined; const finalValue = path .split('.') .reduce((obj, p) => ((typeof obj === 'object') ? obj[p] : undefined ), startObj);{ return finalValue; }
Now the obnoxious validation looks like this:
// Trying to get this.data.homeScene.user.name const name = getNamespace(this, 'data.homeScene.user.name'); if (name) { ... }
$ git merge -Xours branch-name $ git merge -XTheirs banch-name
Comes in really handy for sweeping updates, like running eslint --fix
on an entire code base or merging package-lock.json
.
Git command line is pretty confusing. Here are some aliases that I found helpful that normalize it with other command line commands and add a little bit better context.
Open global .gitconfig
file:
$ open ~/.gitconfig
If there isn’t an [alias]
section already, add one:
[alias] cd = checkout ll = branch ls = branch delete-merged = !git branch --merged | egrep -v \"(^\\*|master|development)\" | xargs git branch -d new-up = !git push -u origin `git symbolic-ref --short HEAD` stage = add unstage = reset HEAD
Update 2018-07:
To set VS Code as the default editor for commit and merge messages:
[core] editor = code --wait
Here they are for not forgetting: