Skip to content

Instantly share code, notes, and snippets.

View asmallteapot's full-sized avatar
😴
😴

Ellen Teapot asmallteapot

😴
😴
View GitHub Profile
@asmallteapot
asmallteapot / nginx.conf
Created March 14, 2012 19:00
My default Nginx configuration for serving Django projects.
# file: /etc/nginx/sites-available/example.com
# nginx configuration for example.com
server {
listen 80;
server_name example.com;
access_log /srv/www/example.com/logs/access.log;
error_log /srv/www/example.com/logs/error.log;
# pass root to django
@asmallteapot
asmallteapot / gist:2138337
Created March 20, 2012 17:20
Path to iOS 5.1 icon masks. Thanks to Matt Comi of Big Bucket Software for sharing this.
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.1.sdk/System/Library/PrivateFrameworks/MobileIcons.framework
@asmallteapot
asmallteapot / Prefix.pch
Created March 26, 2012 15:28
Macro to make accessing custom methods on your app delegate easy.
#import "STAppDelegate.h"
#define ST_APP_DELEGATE (STAppDelegate *)[[UIApplication sharedApplication] delegate]
@asmallteapot
asmallteapot / NFLQuarterback.h
Created March 27, 2012 15:08 — forked from jeremyjbowers/passer_rating.py
An Objective-C method to compute NFL passer rating.
#import <Foundation/Foundation.h>
#define NUMBER_IN_RANGE(num, floor, ceiling) ((num >= floor && num <= ceiling) ? num : ((num < floor) ? floor : ceiling))
@interface NFLQuarterback
@property (nonatomic, strong) NSNumber *completions;
@property (nonatomic, strong) NSNumber *interceptions;
@property (nonatomic, strong) NSNumber *touchdowns;
@property (nonatomic, strong) NSNumber *yards;
@property (readonly) NSNumber *passerRating;
@asmallteapot
asmallteapot / gist:2368038
Created April 12, 2012 15:14
Notes from @UncleBobMartin’s Demanding Professionalism talk in Tampa, Florida on 11 April 2012.

Demanding software professionalism

Presented by Bob Martin in Tampa, Florida on 11 April 2012.

Miscellany

“Uranus is not a naked–eye object under any circumstances.”

  • Copernicus’ motivation was religious, not scientific! Galileo looked at the phases of Venus to determine its orbit in relation to Sol.

Bob: How do you become unafraid of your code?

@asmallteapot
asmallteapot / gist:2369226
Created April 12, 2012 17:11
#GeekLunchTPA build 001

#GeekLunch (Pinellas County) has been a rousing success, but I’ve been consistently missing it since I started working in South Tampa. So, it’s time for a Hillsborough County-based equivalent.

GeekLunch Tampa

Map and Street View of 309 North Westshore Boulevard, Tampa FL 33609

Google Directions to Chipotle Westshore

The inaugural edition of GeekLunch Tampa is tentatively scheduled for Friday, 20 April 2012, Noon local time, at Chipotle Westshore (see map above). Parking and seating can be scarce, so plan on arriving a few minutes earlier than that.

@asmallteapot
asmallteapot / php.example.com
Created April 30, 2012 14:38
Disregard PHP-FPM; proxy Apache behind Nginx.
# file: /etc/nginx/sites-available/php.example.com
# nginx configuration for php.example.com
server {
listen 80;
server_name php.example.com;
root /srv/www/php.example.com/www/;
access_log /srv/www/php.example.com/logs/access.log;
error_log /srv/www/php.example.com/logs/error.log;
@asmallteapot
asmallteapot / iOS fonts.md
Created May 16, 2012 13:39 — forked from dustinrue/gist:2707456
Custom fonts in iOS apps

Original blog post

  1. Add your custom font files to Git/Xcode/your app’s target.
  2. Add a UIAppFonts array entry to your Info.plist.
  3. Add each font’s filename (including extension) to the UIAppFonts entry.
  4. Now you can use the font like any that came with iOS.
@asmallteapot
asmallteapot / list-apps.sh
Created May 23, 2012 15:08
Generate a Markdown-formatted list of all installed Mac apps.
ls -d1 /Applications/*.app | sed -e 's/\.app\///g' | sed -e 's/^\/Applications\//\* /g' | sort -f
@asmallteapot
asmallteapot / NightOfCurry.md
Created June 10, 2012 16:05
WWDC Night of Curry 2012

tl;dr: Come grab curry with nerds from the Internet on Sunday, 10 June (the day before WWDC) at 6:30 PM in San Francisco.

WWDC Night of Curry 2012

For those of us who won’t have the opportunity to gorge ourselves on meat (or tofu) before WWDC 2012, I’m putting together an alternative dinner based on Indian Food.

The Place

Map of Little Delhi Restaurant (Click the map for directions)