Skip to content

Instantly share code, notes, and snippets.

View nmccready's full-sized avatar

nmccready nmccready

View GitHub Profile
nmccready /
Created November 23, 2021 11:43
git checkout single file
git clone --no-checkout --depth=1 --no-tags $1
git restore --staged $2
git checkout $2
nmccready / classes.dart
Last active August 19, 2021 03:22
Dart Notes
void main() {
final p = new Employee("Nick", height: 5.8, weight: 210, age: 41, taxCode: "123", salary: 2000000);
mixin Health {
String getLifePercentage(int age) => (100 * (age / 101.00)).toStringAsFixed(3);
double getBMI(double height, double weight) => weight / (height * height);
nmccready / promiseMapAnything.js
Created July 29, 2021 19:15
Promise Map Anything
const PromiseMapAnything = (promises, cb) =>
Promise.try(() =>
Promise.resolve(promises).then((arrayOrObject) => {
if (_.isArray(arrayOrObject)) {
return, cb);
const size = Object.values(arrayOrObject).length;
return Promise.all(, (value, key) => cb(value, key, size)));
nmccready / Simple-S3Bucket-SNS
Created July 8, 2021 02:09 — forked from austoonz/Simple-S3Bucket-SNS
A CloudFormation template sample for creating an S3 Bucket with an SNS Trigger.
AWSTemplateFormatVersion: '2010-09-09'
Description: Simple S3 Bucket with SNS Trigger
Type: String
Description: The name of the S3 Bucket to create
nmccready /
Created January 23, 2021 16:36 — forked from apparentlymart/
Terraform State Integrity Issues

Issues with Terraform State Management

The idea of "state" is the lynchpin of Terraform, and yet Terraform's workflow is fraught with gotchas that can lead to the loss or destruction of state. This doc is a set of notes about issues I've encountered, what caused them, and in many cases ideas about how to improve Terraform to avoid or reduce the chances of them.

Each of these scenarios has occured at least within my team. Each time one of these occurs it erodes people's confidence in Terraform, giving it a reputation for being fragile and unforgiving of errors. This this document is not written just to criticize but rather to identify ways in which the situation could be improved.

nmccready / Makefile
Created October 29, 2020 01:48 — forked from ryu1kn/Makefile
Encrypt/decrypt with AWS KMS using AWS cli
# How to encrypt/decrypt your text/blob secret with AWS KMS with AWS cli
SECRET_TEXT="my secret text"
DECRYPTED_SECRET_AS_BLOB=decrypted_secret_blob # Result of decrypt-blob target
nmccready /
Last active April 20, 2022 01:53
parse args and forward
# !/usr/bin/env bash
helpMenu() {
echo '
-i|--install) install all dependencies
-in|--install-node) install node dependencies
-if|--install-flutter) install flutter dependencies
-h|--help) this menu
nmccready /
Created August 7, 2020 13:55
recusive rename mult files
$ find . -name 'index.go' -type f -exec rename 's/index\.go/main\.go/' '{}' \;
nmccready /
Created June 26, 2020 16:34
npm version described

npm version

read it's very straight forward.

Everything in npm config cli is available to be set in .npmrc like preid.

IE this allows your to define your prerelease identifier. By default npm follows this format.