Skip to content

Instantly share code, notes, and snippets.

@partlyhuman
partlyhuman / docurl.sh
Created October 8, 2012 09:13
Quickie RESTful API tester for my sinatra app
#!/bin/bash
if [ $# -lt 2 ]; then
echo "USAGE: $0 [METHOD] [/path/to/endpoint] -d [key=value] "
exit 1
fi
COOKIES=.cookies
# JSONLINTER='python -mjson.tool'
JSONLINTER=jsonpretty # gem install jsonpretty
SERVER=http://localhost:3000
@partlyhuman
partlyhuman / new-safari-window.scpt
Created November 20, 2012 05:05
Open new Safari window anywhere, without switching spaces
tell application "Safari"
make new document
activate
end tell
@partlyhuman
partlyhuman / private.xml
Created November 29, 2012 02:55
KeyRemap4MacBook setting to complete pending close-parens/quotes/brackets, insert semicolon, enter.
<?xml version="1.0"?>
<root>
<item>
<name>- XCode Custom Keys -</name>
<item>
<name>Fn+Return completes line with semicolon only in XCode</name>
<identifier>private.xcode.completeline</identifier>
<only>XCODE</only>
<autogen>
--KeyToKey--
@partlyhuman
partlyhuman / tallytasks.rb
Created March 26, 2013 06:01
Convert a sequence of hourly tasks and a regular work week into due dates.
#!/usr/bin/env ruby
require 'date'
class Date
def workday?
return !(self.saturday? or self.sunday?)
end
end
def tally_tasks(hrs_per_day, start_date=nil)
@partlyhuman
partlyhuman / pebble-jsapi-local.js
Created November 14, 2013 23:42
Seed of a local testing harness for quick iteration of PebbleJS apps. Could add to this providing a way to simulate appmessages, etc.
var Pebble = new (function(){
var dispatchTable = {};
this.addEventListener = function(eventName, delegate) {
if (!(eventName in dispatchTable)) dispatchTable[eventName] = [];
dispatchTable[eventName].push(delegate);
}
this.dispatchEvent = function(event) {
@partlyhuman
partlyhuman / index.html
Created January 10, 2015 22:29
TrelloTask
<html>
<head>
<title></title>
<style type="text/css">
body {
background-color: black;
color: white;
}
.select {
position: absolute;
@partlyhuman
partlyhuman / Timestamp
Created June 3, 2015 18:03
Type timestamp in YYYYMMDD when you hit Ctrl+Win+Alt+D
#!^d::
FormatTime, Timestamp,, yyyyMMdd
SendInput, %Timestamp%
return
@partlyhuman
partlyhuman / UnityNotNull.cs
Last active February 23, 2019 00:58
[UnityNotNull] attribute
using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
#if UNITY_EDITOR
using UnityEditor;
using UnityEditor.Callbacks;
#endif
namespace com.partlyhuman
@partlyhuman
partlyhuman / FindByGuid.cs
Last active November 21, 2023 14:53
Unity Find by GUID
using UnityEditor;
using UnityEngine;
namespace com.hololabs.editor
{
public class FindByGuid : EditorWindow
{
[MenuItem("Utility/Find Asset by Guid %&g")]
public static void DoFindByGuidMenu()
{
@partlyhuman
partlyhuman / EmbeddedAnimationClipUtility.cs
Created October 26, 2017 20:37
Work with Animation Clips embedded in an AnimatorController asset
using System.Linq;
using UnityEditor;
using UnityEditor.Animations;
using UnityEngine;
namespace com.hololabs
{
public static class EmbeddedAnimationClipUtility
{
[MenuItem("Assets/Add Embedded Animation Clip", false)]