Skip to content

Instantly share code, notes, and snippets.

View grifx's full-sized avatar

Joris Garonian grifx

  • ProductReview.com.au
  • Sydney
  • X @wasquen
View GitHub Profile
@koop
koop / ensure-cert-macos.sh
Created November 28, 2017 20:27
Ensures a certificate is in the macOS system keychain.
#!/bin/bash
# Usage
# $ ./install-cert-macos.sh "/path/to/cert"
CERT_PATH="$1"
# First, grab the SHA-1 from the provided SSL cert.
CERT_SHA1=$(openssl x509 -in "$CERT_PATH" -sha1 -noout -fingerprint | cut -d "=" -f2 | sed "s/://g")
# Next, grab the SHA-1s of any standard.dev certs in the keychain.
# Don't return an error code if nothing is found.

This does NOT work with the OSX stand alone version of postman

How to use Faker with postman?

SET UP:

  • Copy paste (refreshFakerVariables) into: Manage Environments > Globals : refreshFakerVariables
  • Create a Request: http://localhost, and paste in the pre-request script (clearFakerVariables). Save it as: "clearFakerVariables"
  • Create a Request: http://localhost, and paste in the pre-request script (loadFaker). Save it as: "loadFaker"
@gaearon
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {