Code

Git Writing Tracker Post-Commit

1
2
3
4
5
6
7
8
9
10
PATH=$PATH:/usr/local/bin:/usr/local/sbin
#!/bin/bash
gitbranch=`git rev-parse --abbrev-ref HEAD`
if [ $gitbranch = "master" ]; then
  date=`date +%m/%d/%Y`
  datetime=`date +%r`
  gitwa=`git diff HEAD^ HEAD --word-diff=porcelain | grep -e "^+[^+]" | wc -w`
  gitwd=`git diff HEAD^ HEAD --word-diff=porcelain | grep -e "^-[^-]" | wc -w`
  commit=`git log -1 --pretty=%B`

imagemagick.rb

1
2
3
4
5
6
7
8
9
10
require 'formula'

class Imagemagick < Formula
  homepage 'http://www.imagemagick.org'

  url 'http://www.imagemagick.org/download/releases/ImageMagick-6.9.8-10.tar.xz'
  sha256 '2bfc0dbddcac1cf08eaab76df1bd32131e97d50544ac5a6d662f1d885e2b6814'

  head 'https://www.imagemagick.org/subversion/ImageMagick/trunk',

WeatherLogger-Today.gs

1
2
3
4
5
6
7
8
9
10
function weatherLogger() {
  var url = "http://api.wunderground.com/api/XXXXXXXXXXX/forecast/q/STATE/CITY.json"
  var response = UrlFetchApp.fetch(url);
  var weather = JSON.parse(response);
  var summary = weather.forecast.simpleforecast.forecastday[0];
  var newFileData = summary["date"]["pretty"] + "\n";
  newFileData += "\n";
  newFileData += "High temp: " + summary["high"]["fahrenheit"] + "°F/" + summary["high"]["celsius"] + "°C";
  newFileData += "\n";

WeatherLogger-Yesterday.gs

1
2
3
4
5
6
7
8
9
10
function weatherLogger() {
  var url = "http://api.wunderground.com/api/XXXXXXXXXXX/yesterday/q/STATE/CITY.json"
  var response = UrlFetchApp.fetch(url);
  var data = JSON.parse(response);
  var summary = data.history.dailysummary[0];
  var slength = summary.length;
  var newFileData = summary["date"]["pretty"] + "\n";
  newFileData += "\n";
  newFileData += "High temp: " + summary["maxtempi"];

DailyReport.applescript

1
2
3
4
5
6
7
8
9
10
on hazelProcessFile(theFile)
  set filePath to "/Users/JoeBuhlig/Dropbox/Text/TaskReports/" -- Where to save the resulting text file (Be sure to add the trailing "/")

  -- Create the new filename as YYYYMMDD.txt
  set todayDate to current date
  set yestDate to todayDate - 1 * days
  set {year:y, month:m, day:d} to yestDate
  set fileName to y * 10000
  set fileName to fileName + (m * 100)

Project Code AppleScript.applescript

1
2
3
4
5
6
7
8
9
10
set thePList to "Users:JoeBuhlig:Dropbox:pList:Project_Codes.plist"
set thePListPath to POSIX path of thePList
tell application "System Events"
  tell property list file thePListPath
    tell contents
      set pcode to value of property list item "HouseCar"
      set yr to text -2 thru -1 of ("00" & (year of (current date))) as number
      set y to text -6 thru -5 of pcode as number
      set inc to text -2 thru -1 of pcode as number

Parse Inbox.scpt

1
2
3
4
5
6
7
8
9
10
on idle
  tell application "OmniFocus"
    tell front document
      set theInbox to every inbox task
      if theInbox is not equal to {} then
        repeat with n from 1 to length of theInbox
          set currentTask to item n of theInbox
          set taskName to name of currentTask
          if taskName starts with "--" then

next