Skip to content

Instantly share code, notes, and snippets.

View judismith's full-sized avatar

Judi Smith judismith

  • PJS Engineering
  • Phoenix
View GitHub Profile
@judismith
judismith / Toggl_API_Get_Clients.rb
Created August 21, 2012 03:10
Ruby script to list of clients from Toggl through API
require 'net/https'
require 'uri'
@path = '/api/v6/clients.json'
# insert API token in the user variable
@user = ''
@pass = 'api_token'
uri = URI.parse('https://www.toggl.com')
@judismith
judismith / BCX_API_Delete_Proj.rb
Created August 21, 2012 03:07
Delete projects through Basecamp Next API from list in file
require 'net/https'
require 'uri'
require 'rubygems'
require 'json/pure'
@user = 'username'
@pass = 'password'
file = File.new("bc_proj.txt", "r")
@judismith
judismith / BCX_API_Get_Projects.rb
Created August 21, 2012 03:02
Ruby script to get all projects from Basecamp Next API to file
require 'net/https'
require 'uri'
# replace 9999999 with your instance id
@path = '/9999999/api/v1/projects.json'
@user = 'username'
@pass = 'password'
uri = URI.parse('https://basecamp.com')
http = Net::HTTP.new(uri.host, uri.port)
@judismith
judismith / BCX_API_upload.rb
Created August 21, 2012 03:00
Ruby script to create projects through the Basecamp Next API from file
require 'net/https'
require 'uri'
require 'rubygems'
require 'json/pure'
# replace 9999999 with your instance id
@path = '/9999999/api/v1/projects.json'
@user = 'username'
@pass = 'password'
@judismith
judismith / FM Applescript Ping
Created August 11, 2012 04:22
Test for internet connection within Filemaker
try
set thePing to do shell script "/sbin/ping -o -c 5 www.google.com"
on error
set thePing to "error"
end try
tell application "FileMaker Pro Advanced"
if thePing is not "error" then
set cell "g_internet" to "true"
else
@judismith
judismith / Log tasks and hours to Day One
Created August 10, 2012 16:36
AppleScript to create Day One entry for hours logged in TaskPaper - Based on the AppleScript from Brett Terpstra to log TaskPaper completed tasks to Day One. This script does both
set archivedTasks to ""
set hoursEntries to ""
tell application "TaskPaper"
tell front document
-- don't care which file your log entry came from?
-- comment the next line out
set archivedTasks to "## " & name & return
set hoursEntries to "## " & name & ": Hours" & return
repeat with _task in search with query "project != Archive and @done"
if entry type of _task is not project type then