Skip to content

Instantly share code, notes, and snippets.

View azeitler's full-sized avatar

Andreas Zeitler azeitler

View GitHub Profile
Pod::Spec.new do |s|
s.name = 'TouchXML'
s.version = '0.1'
s.license = 'Simplified BSD License'
s.summary = "TouchXML is a lightweight replacement for Cocoa's NSXML* cluster of classes."
s.homepage = 'https://github.com/doPanic/TouchXML'
s.author = { 'Jonathan Wight' => 'schwa@toxicsoftware.com' }
s.source = { :git => 'https://github.com/doPanic/TouchXML.git', :commit => '5da25c16f20de52792bcb5cc3ea4c9dff4646e8f' }
s.source_files = 'Source/**/*.{h,m}'
s.requires_arc = true
@azeitler
azeitler / gist:320646d9771785d0a4f1
Created September 6, 2014 18:03
OS X Jenkins Shell Wrapper
#!/bin/sh
DESC="Jenkins CI Server"
NAME=jenkins
PIDFILE=$HOME/$NAME.pid
LOGFILE=$HOME/Library/Logs/dopanic.$NAME.log
d_start() {
(nohup java -XX:PermSize=512M -XX:MaxPermSize=2048M -Xmn128M -Xms1024M -Xmx2048M -jar /usr/local/opt/jenkins/libexec/jenkins.war > $LOGFILE 2>&1) &
PID=$!
MJPopupViewContentInteractionNone = 1, // no tap interaction, dismiss manually or from outside
MJPopupViewContentInteractionDismissEverywhere, // tapping the background or the viewcontroller will dismiss the popup
MJPopupViewContentInteractionDismissBackgroundOnly, // only tapping the background will dismiss the popup
-(void)presentPopupViewController:(UIViewController*)popupViewController;
-(void)dismissPopupViewController:(UIViewController*)popupViewController;
@azeitler
azeitler / UIButton+Block.h
Created July 11, 2012 15:08 — forked from joshdholtz/UIButton+Block.h
iOS - UIButton+Block
//
// UIButton+Block.h
// BoothTag
//
// Created by Josh Holtz on 4/22/12.
// Copyright (c) 2012 Josh Holtz. All rights reserved.
//
#define kUIButtonBlockTouchUpInside @"TouchInside"
@azeitler
azeitler / gist:2906921
Created June 10, 2012 18:56
RemoveChildInAsset
public static void RemoveChildInAsset (GameObject child)
{
GameObject prefab = PrefabUtility.FindPrefabRoot (child);
RemoveChildInAsset (prefab, child);
}
public static void RemoveChildInAsset (GameObject prefab, GameObject child)
{
try {
string oldName = child.name;
child.name = System.Guid.NewGuid ().ToString ();
@azeitler
azeitler / gist:2906852
Created June 10, 2012 18:35
AddChildInAsset and AddChildInAssetWithComponent<T>
public static GameObject AddChildInAsset (GameObject prefab, string name = "NewChild")
{
GameObject instance = (GameObject)PrefabUtility.InstantiatePrefab (prefab);
GameObject child = AddChild (instance, System.Guid.NewGuid ().ToString ());
PrefabUtility.ReplacePrefab (instance, prefab, ReplacePrefabOptions.ConnectToPrefab);
GameObject newChild = prefab.transform.FindChild (child.name).gameObject;
GameObject.DestroyImmediate (instance);
newChild.name = name;
prefab.MakeDirty ();
AssetDatabase.SaveAssets ();
@azeitler
azeitler / ColoredMaterialCache.cs
Created November 23, 2011 17:57
Colored Material Cache
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
/// <summary>
/// manages instances of the same material with random colors
/// if a Material+Color combination does not yet exist it will be created
/// if the combination has been created before it will be returned from the cached
/// </summary>
public static class ColoredMaterialCache {
@azeitler
azeitler / CodeUtil.Unity.cs
Created November 13, 2011 02:14
C# Method Generation for Deep-Copy of any Class
using UnityEngine;
using UnityEditor;
public static class CodeUtilUnity {
[MenuItem("Tools/Test: CreateCopyMethod (Transform)")]
public static void TestCreateCopyMethod () {
Debug.Log (CreateCopyMethod (typeof(Transform), true));
}
}