Skip to content

Instantly share code, notes, and snippets.

APIKEY = "03724E57-E596-B87B-7CD1-585B3FD3AE99";
CmdUtils.CreateCommand({
name: "track",
homepage: "http://tracker.216brew.com/",
author: { name: "Joseph Anthony Pasquale Holsten", email: "joseph@josephholsten.com"},
contributors: ["Joseph Anthony Pasquale Holsten"],
license: "MIT",
description: "Record your measurements to your <a href='http://tracker.216brew.com/'>Tracker</a>",
help: "Enter a record to track in natural language, amount type date",
#!/usr/bin/env ruby
# Copyright (c) 2009 Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>measurements: index</title>
<link href="/stylesheets/tracker.css?1233610581" media="screen" rel="stylesheet" type="text/css" />
<script src="/javascripts/prototype.js?1233610581" type="text/javascript"></script>
<script src="/javascripts/effects.js?1233610581" type="text/javascript"></script>
#!/bin/sh
# script to backup common files
# see also ~/.backupignore, ~/.archiveignore
print_usage () {
#echo "Usage: ${0##*/} -l"
echo "Usage: `basename $0` [-l | -x | -r]"
return 0
}
set source_folders to the selection of application "Finder"
set destination_folder to choose folder with prompt "Select folder to merge into:"
CopyAndMergeFolders from source_folders into destination_folder
to CopyAndMergeFolders from sourceFolders into destinationFolder
if (count sourceFolders) is equal to 0 then error "No source files selected"
set dest_path to quoted form of POSIX path of (destinationFolder as alias)
set src_paths to ""
repeat with n in sourceFolders
def pretty_factory_name name
name.to_s.gsub '_', ' '
end
Factory.factories.each do |name, factory|
Given( /^an? #{pretty_factory_name name} exists$/ ) do
Factory(name)
end
Given( /^an? #{pretty_factory_name name} exists with an? (.*) of "([^"]*)"$/ ) do |attr, value|
Factory(name, attr.gsub(' ', '_') => value)
end
#!/bin/sh
base='http://github.com'
if [ $1 ]; then
file=`git ls-files --full-name $1`;
fi
current=`git status -s -b | head -1 | cut -d' ' -f2`
remote=`git config branch.$current.remote`
if [ "$remote" = "" ] ; then
@josephholsten
josephholsten / database.yml
Created July 25, 2011 18:55
The best database.yml
development:
database: dev
adapter: postgresql
test:
database: test
adapter: postgresql
cucumber:
database: test
@josephholsten
josephholsten / vapp.rb
Created August 11, 2011 00:07
Application cookbook for solo
#
# Cookbook Name:: application
# Recipe:: solo
#
app = node[:app].to_hash
(app["server_roles"] & node.run_list.roles).each do |app_role|
app["type"][app_role].each do |thing|
node.run_state[:current_app] = app
include_recipe "application::#{thing}"
@josephholsten
josephholsten / fix_ovf.rb
Created November 1, 2011 23:34
Because no one actually implements a standard
#!/usr/bin/env ruby -w
# fix_ovf: convert virtualbox ovf documents to work with vmware
# Usage: fix_ovf < vbox.ovf > vmware.ovf
require 'nokogiri'
class OVFDocument < Nokogiri::XML::Document
XMLNS = {
'rasd' => "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_ResourceAllocationSettingData",
'vssd' => "http://schemas.dmtf.org/wbem/wscim/1/cim-schema/2/CIM_VirtualSystemSettingData",