This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
import json | |
from twilio.rest import TwilioRestClient | |
EATON_STORE_CODE = "R121" | |
IPHONE6_SILVER_128_CODE = "MG3F2CL/A" | |
IPHONE6_GREY_128_CODE = "MG3E2CL/A" | |
APPLE_RESERVATION_URL = "https://reserve.cdn-apple.com/CA/en_CA/reserve/iPhone/availability.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// OV7670+FIFO Simple Data Test | |
// | |
// OV7670 Arduino | |
// 3V3 3.3V | |
// GND GND | |
// SYNC 2 | |
// D0-D7 6-13 | |
// | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
static inline void serialWrB(uint8_t dat){ | |
while(!( UCSR0A & (1<<UDRE0))); //wait for byte to transmit | |
UDR0=dat; | |
while(!( UCSR0A & (1<<UDRE0))); //wait for byte to transmit | |
} | |
static void StringPgm(char * str){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
// | |
// RCLK 2 | |
// VSYNC 3 | |
// D0-D4 A0-A3 | |
// D5-D8 4-7 | |
// WE 8 | |
// WRST 9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
#include <SPI.h> | |
#define OV7670_address 0x21 | |
#ifndef cbi | |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <avr/io.h> | |
#include <avr/interrupt.h> | |
#include <HardwareSerial.h> | |
#include "SimpleI2C.h" | |
#ifndef cbi | |
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from lxml import etree | |
OSM_API_URL = "http://api.openstreetmap.org/api/0.6/map?bbox=%s" | |
def get_streets(bbox): | |
""" | |
Makes an OSM API request and parses the streets and their waypoints in the | |
XML response, returns a list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Issue: IE doesn't support Array.indexOf (!) | |
// Solution: Use this | |
if (!Array.indexOf){ | |
Array.prototype.indexOf = function(obj) { | |
for (var i = 0; i < this.length; i++) { | |
if (this[i] == obj) { | |
return i; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/PrivatePlugIns/ | |
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/GCC\ 4.2\ \(Plausible\ Blocks\ -\ iPhoneOS\).xcplugin | |
cd /Developer/Library/Xcode/PrivatePlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/ | |
sudo ln -s /Developer/Library/Xcode/Plug-ins/GCC\ 4.2\ \(Plausible\ Blocks\).xcplugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *trimmedTitle = [self.entryTitle stringByReplacingOccurrencesOfString:@"The Best" | |
withString:@"" | |
options:NSCaseInsensitiveSearch | |
range:NSMakeRange(0, [self.entryTitle length])]; | |
trimmedTitle = [trimmedTitle stringByReplacingOccurrencesOfString:@"in Toronto" | |
withString:@"" | |
options:NSCaseInsensitiveSearch | |
range:NSMakeRange(0, [trimmedTitle length])]; | |
OlderNewer