Skip to content

Instantly share code, notes, and snippets.

View langford's full-sized avatar

Michael Langford langford

View GitHub Profile
@langford
langford / Apple.style
Created January 2, 2014 17:54
This format file does 99% of what I want out of my code's formatting It's only big flaw is that it overindents blocks (which will need to be fixed by the tool writer). There is a workaround for for another bug as well in the spec. All and all, pretty good. strictcodeapp.com
! DO NOT CHANGE THIS FILE MANUALLY !
STYLE_NAME=Apple
S_NAME=array
S_BEG
name[SOME]
S_END
@langford
langford / gist:6165405
Last active December 20, 2015 16:59
.profile script to make git colorize and show what state your repo is in.
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
function parse_git_branch_remote {
git rev-parse --git-dir > /dev/null 2>&1
if [ $? -eq 0 ]; then
#include "limits.h"
volatile int char_min = CHAR_MIN;
void limitPrint(void) {
printf("Size of Boolean type is %d byte(s)\n\n",
(int)sizeof(_Bool));
printf("Number of bits in a character: %d\n",
@langford
langford / gist:1045517
Created June 24, 2011 19:42
Why is my UI frozen during this?
[UIView animateWithDuration:0.5 delay:0.0 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState animations:^(void){
self.clippingContainerView.alpha = 1.0;
} completion:^(BOOL finished){
[UIView animateWithDuration:0.5 delay:5.5 options:UIViewAnimationOptionAllowUserInteraction|UIViewAnimationOptionBeginFromCurrentState animations:^(void){
self.clippingContainerView.alpha = 0.0;
} completion:^(BOOL finished){
self.state = cvcStateHiddenControls;
}];
}
];
@langford
langford / InternetFailoverPlan
Created April 29, 2011 19:40
$212 upfront/ $624 Annual Internet failover plan
I've been having some connectivity problems off and on the last few
weeks due to storms taking out some combination of power/internet or
damaging some of the networking equipment here (in spite of the surge
protectors, etc in place) as well as a incident with bad wiring
getting worse due to storms/electrical shorts.
While the iPhone's tethering was a stopgap measure that helped in the
meanwhile, it was by no means a final solution, nor did it allow
efficient completion of the tasks at hand nor good communication while
things were going on as the phone would overheat if I left it running
@langford
langford / resize_icons.sh
Created April 29, 2011 16:54
Make other icons from 512x512
#!/bin/bash
export CONVERSIONAPP="/Applications/ImageMagick-6.5.8//bin/convert"
export DYLD_LIBRARY_PATH="$DYLD_LIBRARY_PATH:/Applications/ImageMagick-6.5.8//lib"
export MAGICK_HOME="/Applications/ImageMagick-6.5.8/"
$CONVERSIONAPP SpecificArtAssets/icons/512x512.png -resize 57x57 GeneratedFiles/Icon.png
$CONVERSIONAPP SpecificArtAssets/icons/512x512.png -resize 114x114 GeneratedFiles/[email protected]
$CONVERSIONAPP SpecificArtAssets/icons/512x512.png -resize 72x72 GeneratedFiles/Icon-72.png
$CONVERSIONAPP SpecificArtAssets/icons/512x512.png -resize 29x29 GeneratedFiles/Icon-Small.png
$CONVERSIONAPP SpecificArtAssets/icons/512x512.png -resize 50x50 GeneratedFiles/Icon-Small-50.png