Skip to content

Instantly share code, notes, and snippets.

@alexfish
alexfish / cloudmade tiles
Created April 5, 2011 19:15
returns cloudmade tiles in range
# Format:
# tiles = [
# zoom => [
# [ tx, ty, tz ],
# ],
# [
# [ tx, ty, tz ],
# ],
# zoom => [
# [ tx, ty, tz ],
require 'rubygems'
require 'cloudmade'
include CloudMade
class MapService
def initialize(latmin,latmax,lonmin,lonmax,zoommin,zoommax,styleid)
@latmin = latmin
@latmax = latmax
@lonmin = lonmin
require 'rubygems'
require 'cloudmade'
include CloudMade
class MapService
def initialize(latmin,latmax,lonmin,lonmax,zoommin,zoommax,styleid)
@latmin = latmin
@latmax = latmax
@lonmin = lonmin
@alexfish
alexfish / Reverse Array
Created April 18, 2011 22:31
Reverse an array in Objective-c
-(void)reverse {
int i = 0;
int j = [array count] - 1;
while (i < j) {
[array exchangeObjectAtIndex:i withObject:[array objectAtIndex:j]];
i++
@alexfish
alexfish / .reverse
Created April 18, 2011 23:35
Reverse an array in Ruby without .reverse
i = 0
j = array.length - 1
while i < j do
last = array[j]
first = array[i]
array[i] = last
array[j] = first
@alexfish
alexfish / readme.markdown
Created July 20, 2011 09:53
o2 Takeover

o2 take over

Commented sections in

  • style.css
  • footer.php
  • header.php

Look for the comments in these files to see what to change, all images are already on S3, don't upload entire file as changes have been made for demo purposes

-(void)loadVisiblePlaces {
NSAutoreleasePool *pool2 = [[NSAutoreleasePool alloc] init];
//printf("Starting visible allPlaces");
[[appDelegate filteredPlaces] removeAllObjects];
if ([prefs filterOn]==NO) {
for (Place *p in [appDelegate allPlaces]) {
if(![p.category isEqual:[NSString stringWithFormat:@"Mobile"]]){
<script type="text/javascript">
$(document).ready(function(){
$('#ticker').list_ticker({
speed:2000,
effect:'fade',
});
});
</script>
//
// MySingleton.h
//
// 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:
//
// MySingleton.m
//
// 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: