Just run:
curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
/* | |
Copyright 2011 Martin Hawksey | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import sys | |
import urllib2 | |
# This script uses HEAD requests (with fallback in case of 405) | |
# to follow the redirect path up to the real URL | |
# (c) 2012 Filippo Valsorda - FiloSottile | |
# Released under the GPL license |
/** | |
* Invokes a function, performing up to 5 retries with exponential backoff. | |
* Retries with delays of approximately 1, 2, 4, 8 then 16 seconds for a total of | |
* about 32 seconds before it gives up and rethrows the last error. | |
* See: https://developers.google.com/google-apps/documents-list/#implementing_exponential_backoff | |
<h3>Examples:</h3> | |
<pre>//Calls an anonymous function that concatenates a greeting with the current Apps user's email | |
var example1 = GASRetry.call(function(){return "Hello, " + Session.getActiveUser().getEmail();}); | |
</pre><pre>//Calls an existing function | |
var example2 = GASRetry.call(myFunction); |
curl -i https://api.github.com/repos/scrooloose/nerdtree/forks |grep -e "git_url" |awk '{gsub(/,/,"");split($2,a,"/"); system("mkdir "a[4]"; cd "a[4]"; git clone " $2);}' |
function checkURLs() { | |
var errors = []; | |
var ss = SpreadsheetApp.getActiveSpreadsheet(); | |
var rows = ss.getDataRange().getValues(); | |
for (i in rows) { | |
var url = rows[i][0]; | |
var response = UrlFetchApp.fetch(url, {muteHttpExceptions: true}); | |
var status = response.getResponseCode(); | |
if (status !== 200) | |
errors.push(status + ' - '+ url); |
Just run:
curl -ks https://gist.github.com/nicerobot/5652802/raw/install.sh | bash -
// vim: ft=javascript: | |
/*jslint sloppy: true, vars: true, white: true, nomen: true, browser: true */ | |
/*global SpreadsheetApp, UiApp, UrlFetchApp, Utilities */ | |
/* | |
* A script to automate requesting data from an external url that outputs CSV data. | |
* | |
* Adapted from the Google Analytics Report Automation (magic) script. | |
* @author [email protected] (Nick Mihailovski) | |
* @author [email protected] (Ian Lewis) | |
*/ |
/** | |
* --- Continous Execution Library --- | |
* | |
* Copyright (c) 2013 Patrick Martinent | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* | |
* http://www.apache.org/licenses/LICENSE-2.0 |
var isoCountries = { | |
'AF' : 'Afghanistan', | |
'AX' : 'Aland Islands', | |
'AL' : 'Albania', | |
'DZ' : 'Algeria', | |
'AS' : 'American Samoa', | |
'AD' : 'Andorra', | |
'AO' : 'Angola', | |
'AI' : 'Anguilla', | |
'AQ' : 'Antarctica', |