Skip to content

Instantly share code, notes, and snippets.

View jsjohnst's full-sized avatar

Jeremy Johnstone jsjohnst

View GitHub Profile
com.sadun.airflick
RequestType := show-photo | play-media
MediaLocation := url or file path
Rotation = 0 | 1 | 2 | 3 (0 ^, 1 <, 2 v, 3 >)
e.g. Photo
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"show-photo", @"RequestType",
@"/Users/ericasadun/Pictures/Spring 2010/EPho 3.JPG", @"MediaLocation",
@"1", @"Rotation",
#!/bin/bash
# If you don't have wget on your Mac, brew install wget
# If you refuse to do that for some odd reason, replace wget with curl -LO (thanks @zadr)
for i in {0..785}; do wget http://qthttp.apple.com.edgesuite.net/1009qpeijrfn/1240/1240_090110_094007_$i.ts; done;
for i in `ls *.ts`; do mv $i `echo $i | awk -F '_' '{printf "%d_%d_%d.%06s", $1, $2, $3, $4}'`; done;
# Then run NullPacketStripper to combine the .ts files together
# It's available from here: http://www.hometheatersoftware.com/stuff/NullPacketStripper/NullPacketStripper_v013beta.zip
window.addEventListener && window.addEventListener('keydown', function(e) {
this.keys ? this.keys.push(e.keyCode) : this.keys = [e.keyCode];
if(this.keys.toString().indexOf("38,38,40,40,37,39,37,39,66,65") >= 0) {
var audio = document.createElement("audio");
audio.src = "http://geek.thinkunique.org/wp-content/vid/tmnt.mp3";
audio.play();
}
}, true);
Steps:
1) svn co <repo_path> ./svn
2) svn export <repo_path> ./export
3) cp -r ./export ./git
4) cd ./git; git init; git commit -am "initial import"; cd ..
5) cp -r ./export ./hg
6) cd ./hg; hg init; hg commit -m "initial import"; cd ..
7) du -hs *
<?xml version='1.0'?>
<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
<signatures version='0.9'>
<enum name='iTunesEKndAlbumListing' value='1799449698'/>
<enum name='iTunesEKndCdInsert' value='1799570537'/>
<enum name='iTunesEKndTrackListing' value='1800696427'/>
<enum name='iTunesEPlSFastForwarding' value='1800426310'/>
<enum name='iTunesEPlSPaused' value='1800426352'/>
<enum name='iTunesEPlSPlaying' value='1800426320'/>
<enum name='iTunesEPlSRewinding' value='1800426322'/>
function callAPI(url, callback) {
var request = new URL();
request.callback = callback;
request.location = url;
KONtx.utility.WaitIndicator.up();
request.fetchAsync(function (u) {
KONtx.utility.WaitIndicator.down();
if (u.response == 200){
KONtx.application.setNetworkRequestFailed(false);
u.callback(u.result);
this.controls.my_button = new KONtx.control.TextButton({
label: "Toggle image visibility",
guid: "toggle_image_visible",
events: {
onClick: function(event) {
my_image.visible = !my_image.visible;
}
}
}).appendTo(this);
/*
@description Patch file to allow widgets using the KONtx.mediaplayer API to run on any Framework version 1.2.20 or higher on 2009 and 2010 model TVs
@author jstone
*/
KONtx_automation_log("loadjs","mediaplayer.js");
if(!KONtx.mediaplayer || !KONtx.mediaplayer._subscribers || typeof KONtx.mediaplayer._subscribers.onSystemPathCreationFailure !== "object") {
log("");log("**");log("");
log("Loading KONtx.mediaplayer patch for < FW 1.3.27");
var LongPuller = function() {
var internals = {};
internals.subscribers = {};
internals.xhrs = {};
internals.doXHR = function(key, url, errorTimeout, reconnectTimeout) {
var xhr = new XMLHttpRequest();
xhr.myCustomData = { key: key, url: url, errorTimeout: errorTimeout || 5000, reconnectTimeout: reconnectTimeout || 100 };
xhr.onreadystatechange = internals.handleResponse;
xhr.open("GET", url);
var MainView = new KONtx.Class({
ClassName: 'MainView',
Extends: KONtx.system.SidebarView,
createView: function() {
this.control.button1 = new KONtx.control.TextButton({
guid: "button1",
label: $_("Main.ButtonLabel"),