Skip to content

Instantly share code, notes, and snippets.

View tylerhall's full-sized avatar

Tyler Hall tylerhall

View GitHub Profile
@tylerhall
tylerhall / keybase.md
Created March 26, 2014 20:10
keybase.md

Keybase proof

I hereby claim:

  • I am tylerhall on github.
  • I am tylerhall (https://keybase.io/tylerhall) on keybase.
  • I have a public key whose fingerprint is 6A6A CE7D E268 8F9A 9E97 E2B6 14C1 60A4 6D68 61A9

To claim this, I am signing this object:

@tylerhall
tylerhall / Sosumi Multiple Devices Example
Created July 28, 2010 01:08
Sosumi multiple devices example.
<?PHP
require 'class.sosumi.php';
$ssm = new Sosumi('username', 'password');
// Print a list of all the devices in your MobileMe account
print_r($ssm->devices);
// $device_number is an integer (0 through ...) that corresponds
// to the device you want info about.
@tylerhall
tylerhall / NSDictionary+Embedded.h
Created August 19, 2010 04:04
NSDictionary category that lets you retrieve a value from a dictionary of dictionaries in a single statement. I'm gonna feel really dumb if there was already a way to do this.
#import <Foundation/Foundation.h>
@interface NSDictionary (EmbeddedValue)
- (id)embeddedValueWithKeys:(NSArray *)keys;
@end
@tylerhall
tylerhall / SkypeRepeatDial.applescript
Created August 19, 2010 20:55
If you ever have a reason to repeatedly dial and hangup on someone, here's a Skype way to do it.
property ScriptName : "Repeat Call"
property PhoneToDial : "+15551234567"
repeat
tell application "Skype"
send command "CALL " & PhoneToDial script name ScriptName
delay 10
set activeCalls to send command "SEARCH ACTIVECALLS" script name ScriptName
@tylerhall
tylerhall / SafariToFFCookies.php
Created August 19, 2010 20:58
Converts your Safari cookies into the standard Netscape (Firefox) format.
#!/usr/bin/php
<?PHP
$plist = file_get_contents($_ENV['HOME'] . '/Library/Cookies/Cookies.plist');
preg_match_all('/<dict>(.*?)<\/dict>/ms', $plist, $matches);
$dicts = $matches[1];
$fp = fopen('cookies.txt', 'w');
foreach($dicts as $dict)
{
$domain = match('/Domain<\/key>.*?<string>(.*?)<\/string>/ms', $dict, 1);
@tylerhall
tylerhall / domain1-index.html
Created August 19, 2010 21:03
Cross-domain way to resize an iFrame from within the frame itself.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<script type="text/javascript" charset="utf-8">
function resizeFrame(newHeight) {
document.getElementById('theFrame').height = newHeight;
}
</script>
</head>
<?PHP
require 'includes/master.inc.php';
if($Auth->loggedIn()) redirect('index.php');
if(!empty($_POST['username']))
{
if($Auth->login($_POST['username'], $_POST['password']))
redirect('index.php');
else
@tylerhall
tylerhall / NSData+Base64.h
Created December 30, 2010 17:12
Note that I'm using Google's (awesome) GTMHTTPRequest library.
//
// NSData+Base64.h
// base64
//
// Created by Matt Gallagher on 2009/06/03.
// Copyright 2009 Matt Gallagher. All rights reserved.
//
// Permission is given to use this source code file, free of charge, in any
// project, commercial or otherwise, entirely at your risk, with the condition
// that any redistribution (in part or whole) of source code must retain
00 05 * * * /usr/sbin/diskutil mount /dev/disk1s3
<?PHP
include 'class.sosumi.php';
$ssm = new Sosumi('your-username', 'your-password');
$location = $ssm->locate();