Skip to content

Instantly share code, notes, and snippets.

View cbowns's full-sized avatar

Christopher Bowns cbowns

View GitHub Profile
@cbowns
cbowns / cgfloat-64-bit-macros.h
Last active August 29, 2015 14:08 — forked from samdmarshall/gist:6891174
A collection of macros for supporting mathematic functions on both 32- and 64-bit systems.
#pragma mark -
#pragma mark CGFloat
#pragma mark Trigonometric Functions
#define CGFloatCos(a) (CGFLOAT_IS_DOUBLE ? cos(a) : cosf(a))
#define CGFloatSin(a) (CGFLOAT_IS_DOUBLE ? sin(a) : sinf(a))
#define CGFloatTan(a) (CGFLOAT_IS_DOUBLE ? tan(a) : tanf(a))
#define CGFloatACos(a) (CGFLOAT_IS_DOUBLE ? acos(a) : acosf(a))
#define CGFloatASin(a) (CGFLOAT_IS_DOUBLE ? asin(a) : asinf(a))
#define CGFloatATan(a) (CGFLOAT_IS_DOUBLE ? atan(a) : atanf(a))
// Copyright (c) 2012-2013 Peter Steinberger (http://petersteinberger.com)
//
// 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
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@cbowns
cbowns / IPInsetLabel.h
Created May 25, 2012 01:26
IPInsetLabel: a simple UILabel subclass that adds padding insets and auto-height-resizing
//
// IPInsetLabel.h
// Instapaper
//
// Created by Marco Arment on 7/23/11.
// Copyright 2011 Instapaper LLC, released to the public domain.
//
#import <UIKit/UIKit.h>
@cbowns
cbowns / backup_growl.rb
Created May 15, 2012 16:37 — forked from bewebste/backup_growl.rb
Script to display Time Machine progress messages as Growl notifications
#!/usr/bin/ruby
#Just run this script in a terminal window, leaving the window open in the
#background so it can continue to process messages.
IO.popen("syslog -F \'$(Sender): $Message\' -w -k Sender com.apple.backupd") { |syslogIO|
while (inputString = syslogIO.gets) do
escapedString = inputString.gsub("'", "\\'")
`/usr/local/bin/growlnotify -a 'Time Machine' -t 'Time Machine' -m '#{escapedString}'`
end
}
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end
# first you'll want to create a gist then `git clone` the private url
# second you'll want to run this script in the gist's directory
loop do
`git commit -a -m save && git push origin master`
sleep 60 * 4
end