Skip to content

Instantly share code, notes, and snippets.

View chrislavender's full-sized avatar

Chris Lavender chrislavender

View GitHub Profile
@chrislavender
chrislavender / uninstall_gems.sh
Created November 10, 2017 19:02 — forked from IanVaughan/uninstall_gems.sh
Uninstall all rbenv gems
#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
@chrislavender
chrislavender / New Relic BitCode .dSYM file upload script
Last active May 31, 2017 17:00
Script to upload .dSYM files for BitCode enabled apps to New Relic
#!/bin/bash
# Currently New Relic doesn't provide a script to upload .dSYM files for BitCode enabled apps.
# To use this...
# 1) Replace <APP_NAME> & <APPLICATION_TOKEN> with info from the New Relic Mobile tab's Settings -> Application.
# 2) download the dSYM files for a given build from iTunesConnect
# 3) run this script from with in the directory that contains the .dSYM files
count=0
for DSYM in $( ls -d *".dSYM/" ); do
@chrislavender
chrislavender / gist:cad26500c9655627544f
Last active April 19, 2024 15:28
HTTP Live Streaming Tutorial

Note: This is an older post that I did back when I thought I might have time to be a blogger. Oh I was oh so wrong. However, it has proven useful for some folks on stackoverflow. Thus I'm keeping it alive here on Gist.

One of my past projects dealt heavily with an open source Apple technology called HTTP Live Streaming. It’s an HTTP based streaming protocol that at its most fundamental level provides a way to stream video and audio from just about any server with nothing but a few free software tools provided by Apple**. However, it has a few additional features that I think make it a really exciting tool. Yet, I haven’t seen HTTP Live Streaming used very much. This is probably mainly due to the combination of a lack of good/clear documentation, and Apple’s Live Streaming Developer Tools being command line based also make the barrier to entry higher than many developers want to deal with.

The hope is to share my understanding of how to use this technology to:

@chrislavender
chrislavender / DebugMacros
Created October 27, 2013 05:05
Macros for logging in an Objective C development environment.
#ifdef DEBUG
// Bog standard Logging
#define DNSLog(fmt, ...) NSLog(fmt, ##__VA_ARGS__);
// Log statement with a bit more detail as to where you are
#define DNSLog1(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
// Log statement without the normal NSLog fluff at the start
#define DNSLog2(fmt, ...) fprintf( stderr, "%s\n", [[NSString stringWithFormat:(@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__] UTF8String] );
// Logs out to a UILocalNotification, where you can pull it down in Notification Center
#define DNSLogN(fmt, ...) UILocalNotification *localNotif__LINE__ = [[UILocalNotification alloc] init];\
if (localNotif__LINE__) {\
@chrislavender
chrislavender / UIView (FindUIViewController)
Last active December 17, 2015 01:39
Find the ViewController that contains a UIView
// http://stackoverflow.com/questions/1340434/get-to-uiviewcontroller-from-uiview-on-iphone
@interface UIView (FindUIViewController)
- (UIViewController *)firstAvailableUIViewController;
- (id)traverseResponderChainForUIViewController;
@end
@implementation UIView (FindUIViewController)
- (UIViewController *)firstAvailableUIViewController
{