Skip to content

Instantly share code, notes, and snippets.

View logicaroma's full-sized avatar

Ramin Mohammadi logicaroma

View GitHub Profile
//
// EGOTitledTableViewCell.h
// EGOClasses
//
// Created by Shaun Harrison on 6/2/09.
// Copyright 2009 enormego. All rights reserved.
//
#import <UIKit/UIKit.h>
//
// PeopleListViewController.m
// Paparazzi
//
// Created by Marcio Valenzuela on 2/20/10.
// Copyright 2010 Personal. All rights reserved.
//
#import "PeopleListViewController.h"
#import "Photo.h"
@nolim1t
nolim1t / gist:522837
Created August 13, 2010 13:01
Snippet to get the closest location (The dataset must be an array of dictionaries)
// Method: What is Nearer helper function
// Pre-requisite: dataset loaded in the app delegate
-(NSDictionary *) whatIsNearer:(CLLocation *)currentLocation {
whichway_ipadAppDelegate *appdelegate = (whichway_ipadAppDelegate *)[[UIApplication sharedApplication] delegate];
float closest_distance;
int linecnt = 1;
NSDictionary *tmpDict = [[[NSDictionary alloc] init] autorelease];
for (NSDictionary *store in appdelegate.dataset) {
NSString *latlong = [store objectForKey:@"LatLong"];
NSArray *latlongarray = [latlong componentsSeparatedByString:@","];
<!DOCTYPE html>
<!-- Helpful things to keep in your <head/>
// Brian Blakely, 360i
// http://twitter.com/brianblakely/
-->
<head>
<!-- Disable automatic DNS prefetching.
@nickcharlton
nickcharlton / gist:779831
Created January 14, 2011 16:31
An example using iOS's location services.
// LocationServices.h
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@interface LocationServices : NSObject <CLLocationManagerDelegate> {
CLLocationManager *locationManager;
CLLocation *currentLocation;
@nickdenardis
nickdenardis / PHP Redirect in Chrome
Created February 4, 2011 13:53
Chrome is picky about the HTTP code being specified before the Location.
// Redirect
header("HTTP/1.1 301 Moved Permanently");
header('Location: ' . $results['url']);
die();
//
// PMThreadsViewController.m
//
#import "neoseekerAppDelegate.h"
#import "PMThreadsViewController.h"
#import "RootViewController.h"
#import "GTMOAuthAuthentication.h"
#import "JSON.h"
@hagino3000
hagino3000 / gist:897783
Created April 1, 2011 05:20
Handle location event And HTTP get by Objective-C
-(NSString*)locationString:(CLLocation *)newLocation {
NSDateFormatter * formatter = [[[NSDateFormatter alloc] init] autorelease];
[formatter setTimeStyle:NSDateFormatterMediumStyle];
return [NSString stringWithFormat:@"(%@) Location %.06f %.06f %@", ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground) ? @"bg" : @"fg", newLocation.coordinate.latitude, newLocation.coordinate.longitude, [formatter stringFromDate:newLocation.timestamp]];
}
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
fromLocation:(CLLocation *)oldLocation
{
@yahelc
yahelc / gist:1004702
Created June 2, 2011 16:02
Simpler Twitter Intents / Google Analytics Script
(function(){
var event_names = {
"click" : "" ,
"tweet" : "",
"retweet" : "source_tweet_id",
"follow" : "screen_name",
"favorite" : "tweet_id"
};
for(var event_name in event_names)
@necolas
necolas / README.md
Last active March 28, 2024 20:34
Experimenting with component-based HTML/CSS naming and patterns

NOTE I now use the conventions detailed in the SUIT framework

Template Components

Used to provide structural templates.

Pattern

t-template-name