Skip to content

Instantly share code, notes, and snippets.

@leshill
leshill / git-prunelocal
Last active June 21, 2024 14:50
Prune local tracking branches that have been removed upstream. Place file in your path (perhaps `~/bin` or `~/scripts`).
#!/bin/bash
#
# Prune local tracking branches that have been removed upstream.
# Your remote tracking branches can be removed automatically by setting `fetch.prune` to true or running `git fetch -prune`.
# Another command to clean up your remote tracking branches is `git remote prune <remote>`.
#
# Author: @leshill
# https://gist.github.com/leshill/9a1088a17f94cef24831
if [[ $# = 1 && $1 == '-n' ]]; then
@jheitzeb
jheitzeb / gist:1104924
Created July 25, 2011 19:15
Google Docs Survey Emailer
function onFormSubmit(e) {
var to_email = "YOUREMAIL@YOURCOMPANY.COM";
var ss = SpreadsheetApp.getActiveSpreadsheet();
var spreadsheet_name = ss.getName();
var sheet = ss.getSheets()[0];
var columns = sheet.getRange("A1:U1").getValues()[0];
var email_subject = "New response for [" + spreadsheet_name + "]";
var email_body = "Spreadsheet: " + spreadsheet_name + "\r\n\r\n";
var email_body_html = "<p><b>Spreadsheet: " + spreadsheet_name + "</b></p>";
@objectoriented
objectoriented / aws_cf_invalidate.rb
Created September 28, 2010 17:37 — forked from jmlacroix/aws_cf_invalidate.rb
Ruby script to invalidate objects on Amazon's CloudFront CDN (shows status of recent requests also)
require 'rubygems'
require 'hmac-sha1' # on OS X: sudo gem install ruby-hmac
require 'net/https'
require 'base64'
#
# CHANGE ME: S3 access credentials go here, along with CloudFront Distribution ID
#
s3_access=''
s3_secret=''
@acdha
acdha / bookmarklet-template.js
Created April 3, 2009 21:04
A template for creating bookmarklets which load jQuery from the Google CDN - see http://chris.improbable.org/2009/apr/3/cleaning-up-the-web-with-jquery-and-a-little-help/
/*
To avoid polluting the global namespace this uses an anonymous
function which is called with either the URL for an external
JavaScript file or a function. In either case jQuery will be loaded
from the Google CDN before your code is executed so it's free to
depend on jQuery without checking for it and can do things like
jQuery.getScript() to load other components (e.g. jQuery UI),
stylesheets, etc.
*/
(function (target, msg) {