Skip to content

Instantly share code, notes, and snippets.

@taylanpince
taylanpince / gist:8096410
Created December 23, 2013 12:37
Address geocoding with geopy
import simplejson as json
from geopy.geocoders.googlev3 import GoogleV3
from urllib import urlopen
from django.conf import settings
from django.contrib.gis.geos import GEOSGeometry
from django.db.models import signals
from specials.models import Special
@taylanpince
taylanpince / gist:4ddd7f1b1e20fd0eee23
Created May 6, 2014 15:23
Mark file as "Do Not Backup" in iOS
#include <sys/xattr.h>
const char *filePath = [[storeURL path] fileSystemRepresentation];
const char *attrName = "com.apple.MobileBackup";
u_int8_t attrValue = 1;
setxattr(filePath, attrName, &attrValue, sizeof(attrValue), 0, 0);
@taylanpince
taylanpince / iphone_checker.py
Created October 18, 2014 21:05
iPhone Availability Checker
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"
@taylanpince
taylanpince / gist:28e483c2dc81f99e95aa
Created December 20, 2014 21:05
OV7670 Arduino UNO Simple Test
// OV7670+FIFO Simple Data Test
//
// OV7670 Arduino
// 3V3 3.3V
// GND GND
// SYNC 2
// D0-D7 6-13
//
void setup() {
@taylanpince
taylanpince / gist:01e701dca986648de364
Created December 21, 2014 13:32
Arduino OV7670 Port Register Integration
#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){
@taylanpince
taylanpince / gist:a30199647af85698b10b
Created December 24, 2014 18:04
OV7670 Arduino Serial Integration
#include <Wire.h>
#define OV7670_address 0x21
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#define vga 0
@taylanpince
taylanpince / gist:67e7bc40baba0a27b430
Created December 30, 2014 13:27
OVR7670 FIFO Read to Serial
#include <avr/io.h>
#include <avr/interrupt.h>
//
// RCLK 2
// VSYNC 3
// D0-D4 A0-A3
// D5-D8 4-7
// WE 8
// WRST 9
@taylanpince
taylanpince / gist:4c22a780080ed9923b69
Created January 1, 2015 23:11
OV7670 Arduino SPI
#include <Wire.h>
#include <SPI.h>
#define OV7670_address 0x21
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#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