Skip to content

Instantly share code, notes, and snippets.

View DerAndereAndi's full-sized avatar
💭
Learning ...

Andreas Linde DerAndereAndi

💭
Learning ...
View GitHub Profile
@benchester
benchester / script.php
Created August 1, 2012 11:07
jenkins post-build script for uploading to HockeyApp
<?php
// USAGE:
// php script.php -t "title" -b "bundleID" -p "platform" -r "release type"
$new_url = "https://rink.hockeyapp.net/api/2/apps/new";
function getMyBundleID()
{
// framework folder, there shouldn't be more than one
foreach (glob("*.framework") as $framework) {}
@damianjsullivan
damianjsullivan / Xcode4HockeyAppIntegration.sh
Created July 3, 2012 17:19 — forked from SpacyRicochet/Xcode4HockeyAppIntegration.sh
Automatic HockeyApp Upload XCode Script
#!/bin/bash
#
# (Above line comes out when placing in Xcode scheme)
#
# Inspired by original script by incanus:
# https://gist.github.com/1186990
#
# Rewritten by martijnthe:
# https://gist.github.com/1379127
#
@alloy
alloy / gist:2888157
Created June 7, 2012 10:45
Somebody who is contacting everyone that has ever commented on a project that he has problems with.

FROM SENDER:

Hi,

Sorry to disturb you, 

I have some (big) problems to compile MTLocation framework and i would like to know if you have a workable example to share with me.

I saw your comment on github...
@jonathanpenn
jonathanpenn / device_uuid.rb
Created May 15, 2012 03:37
Ruby script that fetches the UUID of the first iOS device plugged into your machine
#!/usr/bin/env ruby
ioreg = `ioreg -w 0 -rc IOUSBDevice -k SupportsIPhoneOS`
device_uuid = ioreg[/"USB Serial Number" = "([0-9a-z]+)"/] && $1
if device_uuid
puts device_uuid
else
puts "No device detected."
exit 1
@bjhomer
bjhomer / 0_explanation.md
Created April 23, 2012 19:32
Putting "*.m diff=objc" in <repo_root>/.gitattributes

Running echo "*.m diff=objc" >> .gitattributes in a git repo tells git to use the obj-c diff algorithm when running git diff. For the most part, this isn't much different from the standard diff algorithm. However, it adds one key benefit.

In a unified git diff, added lines are prefixed with a +, and removed lines are prefixed with a -. Unchanged lines are provided for context, and have no prefix. As added context, though, unified diffs have a @@-prefixed line at the beginning of each hunk. Minimally, the @@ lines specify which lines in the file are being changed. It can also contain a label, if git can determine an appropriate label for that section of code.

By default, the label on a hunk context line is the name of the enclosing C function. That works great for C-ish code, but completely misses Obj-C method signatures. As a result, when diffing Obj-C files, the context label is either empty, or falls back to the last C-ish declaration it could find. This is usually entirely useless.

Adding

@0xced
0xced / UIDevice+HostUUID.h
Created April 15, 2012 22:26
Alternative iOS device unique identifier
#import <UIKit/UIKit.h>
@interface UIDevice (HostUUID)
- (NSString *) xcd_uniqueIdentifier;
@end
@DukeyToo
DukeyToo / expressjs benchmark 2012-4-11
Created April 11, 2012 19:47
ab benchmarks on EC2 medium instance
ubuntu@domU-12-31-39-0C-49-FB:~$ ab -n 8000 -c 250 -k http://localhost:8001/middleware
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 800 requests
Completed 1600 requests
Completed 2400 requests
Completed 3200 requests
@alloy
alloy / gist:2133808
Created March 20, 2012 10:11
My wishes for HockeyApp.net / a Crash Report app

My wishes for HockeyApp.net / a Crash Report app:

  • Toggle column visibility (e.g. hide mem address column).

  • Highlight app specific frames, and have a toggle to only show those.

  • Highlight crashed thread.

  • Import crash groups from HockeyApp if this is a standalone app.

@0xced
0xced / NSRunningApplication+DockIcon.h
Created March 15, 2012 16:00
NSRunningApplication category to dynamically show and hide any running application icon in the Dock
//
// Created by Cédric Luthi on 2011-05-03
// Copyright 2011-2012 Cédric Luthi. All rights reserved.
//
#import <AppKit/AppKit.h>
@interface NSRunningApplication (DockIcon)
- (BOOL) setDockIconHidden_xcd:(BOOL)dockIconHidden;
@cbarrett
cbarrett / gist:1642401
Created January 19, 2012 20:31
Had this laying around for quite a while -- really useful and kind of dumb it's not built in...
// stringByAddingPercentEscapesUsingEncoding is pretty conservative about escaping characters, which is fine most of the time. This method however escapes *all special characters*, allowing any arbitrary string to be used when building any part of a URL.
// (c) 2011 Springs & Struts. Released under MIT-style license. See: http://www.opensource.org/licenses/mit-license.php
@interface NSString (SSURLEscaping)
- (NSString *)ss_stringByEscapingAllURLCharactersForRealWithEncoding:(NSStringEncoding)encoding;
@end
@implementation NSString (SSURLEscaping)
- (NSString *)ss_stringByEscapingAllURLCharactersForRealWithEncoding:(NSStringEncoding)encoding