Skip to content

Instantly share code, notes, and snippets.

@alanning
alanning / chimpy.js
Created May 16, 2019 19:41
Chimpy example config file
import path from 'path';
//const path = require('path')
function isCI() {
return !!process.env.CI;
}
module.exports = {
// - - - - CHIMP - - - -
watch: false,
@alanning
alanning / p12topem.txt
Created July 26, 2018 21:30
Instructions for converting p12 files to pem format
Development Phase:
Step 1: Create Certificate .pem from Certificate .p12
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12
Step 2: Create Key .pem from Key .p12
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12
Step 3: Optional (If you want to remove pass phrase asked in second step)
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem
@alanning
alanning / rename-roles.js
Last active May 19, 2016 12:20
Rename existing user roles
// Rename user roles
//
// Usage:
// 1. Make sure your target mongo database is running and accessible.
// 2. At terminal command line:
// `$ mongo dbname rename-roles.js > out.txt`
//
// Configuration:
//
// BASIC
@alanning
alanning / trace.js
Created March 30, 2015 15:53
Adds client-side logging of collection activity and template rendered events. Toggled via localStorage.
//////////////////////////////////////////////////////////////////////
// Use localStorage to toggle logging of collection activity and
// template rendering
//
// Put this file in 'client/lib/trace.js'
//
// Toggle via browser console:
// localStorage.setItem('Meteor.traceCollections', true)
// localStorage.setItem('Meteor.traceRendered', true)
//
@alanning
alanning / restore-latest.sh
Last active May 19, 2016 12:21
Restore the latest dump of a mongo database into your local mongodb instance
#!/bin/bash
######################################################################
# Restore the latest production dump into local mongodb
######################################################################
# NOTE: Will wipe existing local destination db before restoring latest
echo "Restoring latest production dump to local mongodb"
@alanning
alanning / dump.sh
Last active July 24, 2022 23:42
Backup script that dumps a mongo database and compresses the result. Can be run on-demand or via nightly cron job.
#!/bin/bash
# Performs a dump of target database and compresses result.
# Outputs to: $DUMPDIR/$DUMPNAME.tar.xz
# Note: Absolute paths are required for use in cron jobs
DBNAME=meteor
ROOTDIR=/Users/alanning/foo
DUMPDIR=$ROOTDIR/dumps
@alanning
alanning / bundle
Created September 12, 2014 22:07
Bundle script that prevents velocity packages from going to production
#!/bin/sh
# run me in your app directory
# $ chmod u+x bundle
# $ ./bundle
set -o nounset
set -o errexit
@alanning
alanning / gist:8722e785c645bb6e51bb
Created September 10, 2014 23:57
Admit testing console output
kaia2:~/tmp/Admit (commerce *)$ meteor --settings settings.json
[[[[[ ~/tmp/Admit ]]]]]
=> Started proxy.
=> Meteor 0.9.1.1 is available. Update this project with 'meteor update'.
=> Started MongoDB.
I20140910-19:56:15.619(-4)? Jasmine-Unit is loaded
I20140910-19:56:15.696(-4)? [PackageStubber] NOTE: Calling exported function 'SimpleSchema' in package 'simple-schema' with no parameters returned null or undefined. 'SimpleSchema' has been stubbed with an empty function but if you receive errors due to missing fields in this package, you will need to supply your own custom stub for 'SimpleSchema'. For example, 'tests/simple-schema-stub.js'. Once you have a working stub, please consider contributing it back to the community stubs in the `package-stubber` repo.
I20140910-19:56:15.697(-4)? [PackageStubber] NOTE: Calling exported function 'MongoObject' in package 'simple-schema' with no parameters returned null or undefined. 'MongoObject' has been stubbed with an empty function but if you receive errors due to mis
@alanning
alanning / jquery-stub.js
Created June 28, 2014 00:38
Stub for jquery
/* Zepto v1.1.3 - zepto event ajax form ie - zeptojs.com/license */
function emptyFn () {}
window = {
document: {
createElement: emptyFn,
body: {
appendChild: emptyFn
},
@alanning
alanning / bundle
Last active May 19, 2016 12:22
Bash shell script that bundles Meteor app and includes date and latest git commit hash in destination filename. By default, will not bundle is there are uncommitted changes but you can override with the `-f` flag. Properly handles branches as well.
#!/bin/bash
set -o nounset
set -o errexit
FORCE=false
# Read parameters
# http://stackoverflow.com/questions/192249/how-do-i-parse-command-line-arguments-in-bash