This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 <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); |
This file contains hidden or 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
DEFAULT_GEO_RADIUS = 50 | |
EARTH_RADIUS_IN_KM = 6371 | |
EARTH_RADIUS_IN_MILES = 3959 | |
if comparator == "within": | |
comparator = "$within" | |
params = value.split(",") | |
if len(params) > 3: |
This file contains hidden or 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 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 |
This file contains hidden or 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 hashlib, hmac, mimetypes, os, time | |
from base64 import b64encode, b64decode | |
from calendar import timegm | |
from datetime import datetime | |
from email.utils import formatdate | |
from urllib import quote | |
from tornado.gen import coroutine, Return | |
from tornado.httpclient import AsyncHTTPClient, HTTPError |
This file contains hidden or 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 <sys/xattr.h> | |
- (NSInteger)markFilesInDirectoryAsDoNotBackup:(NSString *)path { | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSDirectoryEnumerator *directoryEnumerator = [fileManager enumeratorAtPath:path]; | |
NSString *filePath = nil; | |
NSInteger count = 0; | |
const char *attrName = "com.apple.MobileBackup"; | |
u_int8_t attrValue = 1; |
This file contains hidden or 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
static NSInteger compareListingTypesAccordingToStaticOrder(ListingType *type1, ListingType *type2, void *context) { | |
static NSArray *orderedTypes = nil; | |
if (orderedTypes == nil) { | |
orderedTypes = [[NSArray alloc] initWithObjects: | |
@"Everything", @"Restaurants", @"Bars", | |
@"Cafes", @"Bakeries", @"Fashion Stores", | |
@"Design Stores", @"Bookstores", @"Art Galleries", | |
@"Fitness Clubs", @"Grocery", @"Hotels", @"Services", nil]; | |
} |
This file contains hidden or 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
#pragma mark - Scroll View Delegate | |
- (void)scrollViewDidScroll:(UIScrollView *)scrollView { | |
[super scrollViewDidScroll:scrollView]; | |
if (_refreshInProgress) return; | |
if (self.tableView.contentOffset.y > 50.0 && self.tableView.contentOffset.y < 140.0) { | |
if (self.tableView.contentOffset.y <= 90.0) { | |
[(RefreshView *)self.tableView.tableHeaderView displayInstructions]; |