Skip to content

Instantly share code, notes, and snippets.

@sjas
sjas / pfx-to-crt-and-key.sh
Created October 16, 2017 07:51 — forked from whereisaaron/pfx-to-crt-and-key.sh
Extract a crt file (PEM), key file, and chain bundle from a PFX file, prompts for password or use PFXPASSWORD environment variable
#!/bin/bash
#------------------
# Extract the key, certficiate, and chain in PEM format from a PFX format file
#
# Must supply the input pfx file
PFX_PATH="$1"
if [ "${PFX_PATH}" == "" ]; then
echo "Must supply pfx file path"
exit 1
@twolfson
twolfson / README.md
Created September 14, 2017 00:42
Handling uncaught sync and async errors in AWS Lambda

AWS Lambda has nice safeguards for logging but not great handling for error reporting. I typically use Sentry but in this project, we're using Rollbar

Here's a setup to remove AWS Lambda's forceful exit on uncaught error and replace it with an error reporter to Rollbar:

// Load in our dependencies
const assert = require('assert');
const Rollbar = require('rollbar');

// Initialize our Rollbar handler
@jdiamond
jdiamond / mongoose-as-promised.js
Created December 30, 2012 18:58
Mongoose as Promised
var mongoose = require('mongoose');
var Q = require('q');
mongoose.Promise.prototype.then = function(fulfilled, rejected) {
var deferred = Q.defer();
this.addCallback(deferred.resolve);
this.addErrback(deferred.reject);
return deferred.promise.then(fulfilled, rejected);
@trey
trey / happy_git_on_osx.md
Last active February 18, 2024 10:46
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"