Feature Name: (fill me in with a unique identity, myawesomefeature)
Type: (feature, enhancement)
Start Date: (fill me in with today's date, YYYY-MM-DD)
Author: (your names)
#!/bin/sh | |
### | |
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
### | |
# Alot of these configs have been taken from the various places | |
# on the web, most from here | |
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
function translateError(msg) { | |
var newErr = new Error(msg); // placed here to get correct stack | |
return e => { | |
newErr.originalError = e; | |
throw newErr; | |
} | |
} | |
async function asyncTask() { | |
const user = await UserModel.findById(1).catch(translateError('No user found')) |
# Set AWS credentials and S3 paramters | |
AWS_KEY="" | |
AWS_SECRET="" | |
S3_BUCKET="" | |
S3_BUCKET_PATH="/" | |
S3_ACL="x-amz-acl:private" | |
function s3Upload | |
{ | |
path=$1 |
#!/usr/bin/env bash | |
## | |
# Usage: tf_move_state.sh source_directory target_directory source_resource_name <target_resource_name (uses source_resource_name if not provided)> | |
# Provide source and target directories using relative paths. | |
# WARNING: TEST ON AN INCONSPICUOUS AREA AS STAINING MAY OCCUR | |
# Credit to https://github.com/mcalhoun | |
set -e |
/** | |
Ember Data: Dependent Relationships | |
This package extends Ember Data to support creating relationships | |
where a model's dirty state depends not only on its own attributes | |
but on the dirty state of models in dependent relationships as well. | |
```javascript | |
App.Thing = DS.Model.extend({ | |
name : DS.attr('string'), |
# This is a reasonably well-behaved helper for command-line scripts needing to ask a simple yes/no question. | |
# It optionally accepts a prompt and a default answer that will be returned on enter keypress. | |
# It keeps asking and echoes the answer on the same line until it gets y/n/Y/N or enter. | |
# I tried to get Highline to behave like this directly, but even though it's sophisticated, I didn't like the result. | |
# This isn't especially elegant, but it is straightforward and gets the job done. | |
require 'highline/import' | |
def yesno(prompt = 'Continue?', default = true) | |
a = '' | |
s = default ? '[Y/n]' : '[y/N]' |