Skip to content

Instantly share code, notes, and snippets.

@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
#
@mashpie
mashpie / i18n-express4-cookie-example.js
Last active August 12, 2021 15:48
i18n-express4-cookie-example
@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
@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>" \
// 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';