Skip to content

Instantly share code, notes, and snippets.

+ (NSDate *)localDateForEventDate:(NSDate *)eventDate
{
NSTimeZone *pacificTimeZone = [NSTimeZone timeZoneWithName:@"America/Los_Angeles"];
NSCalendar *pacificCalendar = [NSCalendar currentCalendar];
[pacificCalendar setTimeZone:pacificTimeZone];
unsigned int unitFlags = NSYearCalendarUnit|NSMonthCalendarUnit|NSDayCalendarUnit|NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit;
NSDateComponents *eventDateComponents = [pacificCalendar components:unitFlags fromDate:eventDate];
NSCalendar *localCalendar = [NSCalendar currentCalendar];
@robc
robc / batch_unzip
Created October 24, 2009 06:45
Simple Ruby script to unzip all files in the current working directory
#!/usr/bin/env ruby
# Invokes unzip for each file in a given directory
completed_files = Array.new
current_directory = Dir.getwd
Dir.foreach(current_directory) do |file_name|
if (file_name.include?(".zip") && !completed_files.include?(file_name))
system("unzip", file_name)
completed_files << file_name
end
@robc
robc / .gitignore
Created August 11, 2009 04:17
.gitignore file for use in iPhone projects
build/**/*
.DS_Store
<PROJECT_NAME>.xcodeproj/*.pbxuser
<PROJECT_NAME>.xcodeproj/*.mode1v3
@robc
robc / add_tweetie_filter.sh
Created August 4, 2009 05:26
Syntax to add a filtering term to the Mac version of Tweetie
# Make sure you're running the latest Tweetie beta (http://atebits.posterous.com/test-filtering-in-tweetie-for-mac), then call this as follows (ensuring it's in your path):
# add_tweetie_filter.sh term_to_filter
#!/bin/sh
defaults write com.atebits.tweetie-mac filterTerms -array-add '$1'
rem Create a batch file containing this
rem and point the git core.editor property to it.
rem eg. git config --global core.editor c:/Progra~2/e/cmd/e_git.bat
@echo off
e.exe --wait %*
.description: <UITableViewCell: 0x1190d40; frame = (0 112; 320 58); text = 'host'; autoresize = W; layer = <CALayer: 0x1190f70>>
.frame: 0, 112, 320, 58
.subviews: 2
--subview-- subviews/0
.description: <UIGroupTableViewCellBackground: 0x1191070; frame = (9 0; 302 58); autoresize = W; layer = <CALayer: 0x1191040>>
.frame: 9, 0, 302, 58
.subviews: 0
--subview-- subviews/1
#define CONTENT_TEXT_FONT_SIZE 15
#define HEADING_FONT_SIZE 18
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CGFloat widthBuffer = 40;
if (indexPath.section == EVENT_TIME_DETAILS_SECTION)
{
widthBuffer += 73;
if (indexPath.row == LOCATION_ROW_IN_TIME_DETAILS_SECTION)
public override void HandleInput()
{
if (!IsActive) return;
#if XBOX
if (!playerInputMapper.IsConnected || playerInputMapper.Pause)
#else
if (playerInputMapper.Pause)
#endif
AddExtraScreen(new PauseMenuScreen());
@robc
robc / clean_safari4_website_preview.rb
Created April 12, 2009 14:06
A quick Ruby Script to clear out Safari 4's Website Previews from disk
# Cleans out Safari 4's website previews - these can rapidly consume a large amount of disk space :/
path = "/private/var/folders/so/soew68z1HjWMADz0uUh4GE+++TI/-Caches-/com.apple.Safari/Webpage Previews"
Dir.foreach(path) do |entry|
file_path = "#{path}/#{entry}"
File.delete(file_path) unless File.directory?(file_path)
end
Instructions:
- General
Destroy Meteors to score points
Use Hyperspace to get out of tricky situations
Extra life every 5000 points
- Meteor Swarm
Clear the wave before time runs out
Larger Meteors take more shots before exploding!