Skip to content

Instantly share code, notes, and snippets.

View chrismiles's full-sized avatar

Chris Miles chrismiles

View GitHub Profile
@tonyarnold
tonyarnold / download-wwdc-vids.sh
Last active August 29, 2015 14:02
Downloads all of the available WWDC2014 videos (assuming you have access to them), skipping any that are already downloaded and resuming any that aren't. Requires wget, which can be installed via homebrew. Original credit goes to Krzysztof: https://twitter.com/merowing_/status/474071685826883584. You'll need to be running wget 1.15 or later for …
echo "Downloading HD Videos…"
curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.*._hd_.*dl=1">HD' | sed -e 's/\?dl=1">HD//g' | xargs -n1 wget -N -c
echo "Downloading SD Videos…"
curl https://developer.apple.com/videos/wwdc/2014/ | grep -iIoh 'http.*._sd_.*dl=1">SD' | sed -e 's/\?dl=1">SD//g' | xargs -n1 wget -N -c
echo "Downloading PDFs…"
@sadatrahman
sadatrahman / SRUtilities.m
Created July 12, 2011 09:26
CoreData SQL Debugger
+ (void)installSQLiteDebugger
{
#ifdef DEBUG
[NSClassFromString(@"NSSQLCore") performSelector:@selector(setDebugDefault:) withObject:[NSNumber numberWithBool:YES]];
#endif
}
@heardrwt
heardrwt / NSBundle+RHLaunchAtLoginAdditions.m
Last active December 13, 2015 21:19
RHLaunchAtLoginAdditions
This has moved. See https://github.com/heardrwt/RHAdditions/blob/master/RHAdditions/NSBundle+RHLaunchAtLoginAdditions.m
@kgn
kgn / .gitconfig
Last active May 9, 2016 20:43 — forked from henrik/.bashrc
My user setup
[alias]
cl = clone --recursive
un = reset --hard
st = status -s
aa = add --all
ci = commit -m
co = checkout
cob = checkout -b
br = branch
rbr = branch -r
@tassock
tassock / FloatExtract.m
Created January 24, 2011 00:43
Attempt to
#import <Foundation/Foundation.h>
#include <AudioToolbox/AudioToolbox.h>
#define kInputFileLocation CFSTR("/Users/petermarks/Developer/CoreAudio/FloatExtract/loop.wav")
#pragma mark utility functions
static void CheckResult(OSStatus error, const char *operation)
{
if (error == noErr) return;
char errorString[20];
@mpospese
mpospese / CGRectIntegralScaled.m
Created February 28, 2013 03:34
Pixel aligns rectangles, taking the device's screen scale into account.
CGRect CGRectIntegralScaledEx(CGRect rect, CGFloat scale)
{
return CGRectMake(floorf(rect.origin.x * scale) / scale, floorf(rect.origin.y * scale) / scale, ceilf(rect.size.width * scale) / scale, ceilf(rect.size.height * scale) / scale);
}
CGRect CGRectIntegralScaled(CGRect rect)
{
return CGRectIntegralScaledEx(rect, [[UIScreen mainScreen] scale]);
}
@warnergodfrey
warnergodfrey / gist:7512051
Last active September 21, 2018 03:20
Access the ATO Business Portal using AusKey Mac OS X Mountain Lion
  • Install the latest JRE from Oracle
  • In the Java Control Panel, go to the Security tab and make sure 'Enable Java Content' is checked
  • Open Safari
  • Go to the ATO Business portal site https://bp.ato.gov.au/BpStatics/homepage.htm
  • Click Login
  • A dialog will apear asking you 'Do you want to trust the website “authentication.business.gov.au” to use the “Java” plug-in?'
  • Click 'Trust'
  • Now you will be asked 'Do you want to run this application?'
  • Click 'Run'
  • Another dialog will appear asking you to 'Allow access to the following application from this website?'
@boctor
boctor / BaseViewController.m
Created May 5, 2011 02:08
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@steipete
steipete / ARCCheck.m
Created December 5, 2011 22:26
Don't be a fool and wonder why nothing is working... ADD THIS CHECK.
// ARC is compatible with iOS 4.0 upwards, but you need at least Xcode 4.2 with Clang LLVM 3.0 to compile it.
#if !defined(__clang__) || __clang_major__ < 3 || !__has_feature(objc_arc)
#error This project must be compiled with ARC (Xcode 4.2+ with LLVM 3.0 and above)
#endif
@steventroughtonsmith
steventroughtonsmith / gist:6763213
Created September 30, 2013 12:39
Non-opaque application windows in iOS 7, with optional blur. Shows the user's wallpaper under the app, with Parallax if supported.
typedef enum _UIBackgroundStyle {
UIBackgroundStyleDefault,
UIBackgroundStyleTransparent,
UIBackgroundStyleLightBlur,
UIBackgroundStyleDarkBlur,
UIBackgroundStyleDarkTranslucent
} UIBackgroundStyle;
@interface UIApplication (UIBackgroundStyle)
-(void)_setBackgroundStyle:(UIBackgroundStyle)style;