Skip to content

Instantly share code, notes, and snippets.

View EarMaster's full-sized avatar

Nico Wiedemann EarMaster

View GitHub Profile
@AngryAnt
AngryAnt / DualDisplay.cs
Last active January 24, 2024 08:26
Example use of the Unity 4.1 AirPlay API - gives a setup with the iOS device as controller of the remote display.
using UnityEngine;
using System.Collections;
/*
Runtime use:
To be available, AirPlay needs to be switched on for the device either via a native AirPlay UI component or
via the global AirPlay mirroring setting. Your options are:
A: Modify your Xcode project to layer a native AirPlay Cocoa control somewhere over your Unity content.
@caruccio
caruccio / bash-named-param
Created April 24, 2012 03:25
Named parameters in bash
# Do you like python named parameters (kvargs) ?
# Well, you can have it in bash too!!
$ function myfunc() { local $*; echo "foo=$foo, bar=$bar"; }
$ myfunc bar=world foo=hello
foo=hello, bar=world
@hileon
hileon / gist:1311735
Created October 25, 2011 07:39 — forked from lucasfais/gist:1207002
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (Windows)

General

Ctrl+KB toggle side bar
Ctrl+Shift+P command prompt
Ctrl+` python console
Ctrl+N new file

Editing

@alanleard
alanleard / gist:1278595
Created October 11, 2011 16:26
PageFlip with Pinch/Zoom
var win = Ti.UI.currentWindow;
Titanium.PageFlip = Ti.PageFlip = require('ti.pageflip');
var pdf = 'http://assets.appcelerator.com.s3.amazonaws.com/docs/Appcelerator-IDC-Q1-2011-Mobile-Developer-Report.pdf';
var fileName = pdf.split('/').pop();
var pdfFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, fileName);
function downloadPDF() {
var progressBar = Ti.UI.createProgressBar({ max: 1, min: 0, value: 0, visible: true });
win.add(progressBar);