Skip to content

Instantly share code, notes, and snippets.

// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible).
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export.
var FORMAT_ONELINE = 'One-line';
var FORMAT_MULTILINE = 'Multi-line';
var FORMAT_PRETTY = 'Pretty';
var LANGUAGE_JS = 'JavaScript';
var LANGUAGE_PYTHON = 'Python';
@adamlazz
adamlazz / tm-pushover.sh
Created January 24, 2014 21:19
Time Machine backup completion notifications using Pushover
#!/bin/sh
running(){
tmutil status | grep "Running" | awk '{print $3}' | cut -c 1
}
notify() {
DATE=`date`
curl -s \
-F "token=<use your own>" \
@jeffjo
jeffjo / gist:9459921
Last active December 13, 2018 08:17
NPM Shrinkwrap Workflow

#NPM Shrinkwrap Workflow

Our workflow consists of the following steps:

  1. Hack on changes and merge to master
  2. CI detects commits to master and runs tests
  3. CI machine runs npm test
  4. Once tests pass, deployable artifact is built on separate system - call this the "build phase"
  5. Build machine runs npm install to install dependencies
  6. Build machine creates gzipped tarball (which includes dependencies) and pushes gzip file to artifact server
@mashpie
mashpie / i18n-express4-cookie-example.js
Last active August 12, 2021 15:48
i18n-express4-cookie-example
@ferthalangur
ferthalangur / prune_tm_backups.bash
Last active January 6, 2017 19:34
Prune Apple OS X Time Machine backups
#!/bin/bash
#############################################################################
# Bash script to delete some number of Apple OS X
# Time Machine (TM) backups, always keeping a minimum number. The goal
# is to rely on the _tmutil_ utility instead of physically accessing
# the files directly ... in hopes that this is less likely to corrupt
# the Time Machine database.
#
# Defaults are set to delete up to 5 backups, and keep a minimum of 5
#
@terranware
terranware / snsToSlack.js
Last active March 7, 2024 14:47
AWS Lambda function to Slack Channel hookup
var https = require('https');
var util = require('util');
exports.handler = function(event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var postData = {
"channel": "#aws-sns",
"username": "AWS SNS via Lamda :: DevQa Cloud",
@voxxit
voxxit / USING-VAULT.md
Last active July 7, 2022 03:02
Consul + Vault + MySQL = <3
git clone https://gist.github.com/dd6f95398c1bdc9f1038.git vault
cd vault
docker-compose up -d
export VAULT_ADDR=http://192.168.99.100:8200

Initializing a vault:

vault init
@mbixby
mbixby / gist:3dae2026a77a9a3d3de9
Last active January 5, 2019 06:55
Webpack Named Modules Plugin
var RequestShortener = require("webpack/lib/RequestShortener");
var _ = require("lodash");
/**
* TODO Docs
* @example new NamedModulesPlugin(/^\.\/app\/(viewmodels|records|adapters)/, /^\.\/app\/(.*)\.js$/)
*/
function NamedModulesPlugin(fileWhitelistRegex, replacementRegex) {
this.fileWhitelistRegex = fileWhitelistRegex;
this.replacementRegex = replacementRegex;
@mlynch
mlynch / info.plist
Last active August 6, 2023 07:31
Disable App Transport Security in iOS 9
<!--
This disables app transport security and allows non-HTTPS requests.
Note: it is not recommended to use non-HTTPS requests for sensitive data. A better
approach is to fix the non-secure resources. However, this patch will work in a pinch.
To apply the fix in your Ionic/Cordova app, edit the file located here:
platforms/ios/MyApp/MyApp-Info.plist
And add this XML right before the end of the file inside of the last </dict> entry:
@gene1wood
gene1wood / all_aws_managed_policies.json
Last active April 4, 2024 18:11
A list of all AWS managed policies and they're policy documents as well as a short script to generate the list
This file has been truncated, but you can view the full file.
{
"APIGatewayServiceRolePolicy": {
"Arn": "arn:aws:iam::aws:policy/aws-service-role/APIGatewayServiceRolePolicy",
"AttachmentCount": 0,
"CreateDate": "2019-10-22T18:22:01+00:00",
"DefaultVersionId": "v6",
"Document": {
"Statement": [
{
"Action": [