View ota.c
#include <stdio.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <unistd.h> | |
#define _GNU_SOURCE 1 | |
#include <string.h> | |
#include <sys/stat.h> // for mkdir | |
#include <sys/mman.h> // for mmap |
View IncompatibleAppsList.plist
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>IncompatiblePaths</key> | |
<array> | |
<dict> | |
<key>Application Name</key> | |
<string>Sxs Memory Card Driver</string> | |
<key>Blurb</key> |
View products.json
{ | |
"products": [ | |
{ | |
"name": "macbook-12-inch", | |
"brand": "MacBook", | |
"model": "MacBook 12-inch", | |
"video-screensaver": { | |
"src": "\/videos\/mac-fall2016\/16x10\/screensaver.mov", | |
"width": "1152", | |
"height": "720" |
View iOS 7 dynamic font mappings
+ (void)describePreferredFonts | |
{ | |
static NSArray *textStyles; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
textStyles = @[UIFontTextStyleHeadline, | |
UIFontTextStyleSubheadline, | |
UIFontTextStyleBody, | |
UIFontTextStyleFootnote, | |
UIFontTextStyleCaption1, |
View Trees.swift
//: Playground - noun: a place where people can play | |
//: Prop 'til you Drop | |
indirect enum Formula : CustomStringConvertible { | |
case Var(String) | |
case Or(Formula, Formula) | |
case And(Formula, Formula) | |
case Imply(Formula, Formula) | |
case BiImply(Formula, Formula) | |
case Negate(Formula) |
View MHNatGeoViewControllerTransition
Pod::Spec.new do |s| | |
s.name = 'MHNatGeoViewControllerTransition' | |
s.version = '0.0.1' | |
s.summary = 'A new ViewController transition inspired by NatGeo City Guides by National Geographic.' | |
s.homepage = 'https://github.com/michaelhenry/MHNatGeoViewControllerTransition' | |
s.author = 'Michael Henry' | |
s.source = { :git => 'https://github.com/michaelhenry/MHNatGeoViewControllerTransition.git' } | |
s.source_files = 'MHNatGeoViewControllerTransition/*' | |
end |
View gist:3444720
- (void)refreshArticles | |
{ | |
[SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeGradient]; | |
__weak SMArticlesViewController *me = self; | |
[[self articlesDataSource] loadArticlesWithOnLoad:^(NSArray *newObjects) { | |
if (me != nil) { | |
[me.tableView reloadData]; | |
[SVProgressHUD dismissWithSuccess:nil afterDelay:1]; |
View gist:3444690
#import <RestKit/RestKit.h> | |
@class SMArticle | |
@interface SMArticleDataController : NSObject | |
- (void)loadArticlesWithOnLoad:(RKObjectLoaderDidLoadObjectsBlock)loadBlock onError:(RKRequestDidFailLoadWithErrorBlock)failBlock; | |
- (int)articleCount; | |
- (SMArticle*)articleAtIndex:(int)index; |
View gist:3444638
#import "SMArticle.h" | |
#import <RestKit/RestKit.h> | |
@implementation SMArticle | |
@synthesize articleID,name; | |
+ (RKObjectMapping *)mapping { |
View gist:3444636
NSURL* baseURL = [NSURL URLWithString:@"https://api.example.com/"]; | |
RKObjectManager* objectManager = [RKObjectManager objectManagerWithBaseURL:baseURL]; | |
objectManager.acceptMIMEType = RKMIMETypeJSON; | |
objectManager.serializationMIMEType = RKMIMETypeJSON; | |
[objectManager.mappingProvider setMapping:[SMArticle mapping] forKeyPath:@"article"]; | |
[objectManager.mappingProvider |
NewerOlder