Skip to content

Instantly share code, notes, and snippets.

$ swift
Welcome to Apple Swift version 4.0.2 (swiftlang-900.0.69.1 clang-900.0.38). Type :help for assistance.
1> import Foundation
2> NSNumber(value: true) as? Int
$R0: Int? = 1
$ DEVELOPER_DIR=/Applications/Xcode_8.3.3.app swift
Welcome to Apple Swift version 3.1 (swiftlang-802.0.53 clang-802.0.42). Type :help for assistance.
1> import Foundation
@dmishe
dmishe / gist:6802407
Created October 2, 2013 23:59
TestFlight 2.1.1 spec
Pod::Spec.new do |s|
s.name = 'TestFlightSDK'
s.version = '2.1.1'
s.license = {
:type => 'Commercial',
:text => <<-LICENSE
All text and design is copyright © 2010-2013 TestFlight App, Inc.
All rights reserved.
Pod::Spec.new do |s|
s.name = "AFRaptureXMLRequestOperation"
s.version = '1.0.2'
s.summary = "AFRaptureXMLRequestOperation is an extension for AFNetworking that provides an interface to parse XML using RaptureXML."
s.license = 'MIT'
s.author = { "Jan Sanchez" => "jan.sanchez@outlook.com" }
s.homepage = 'https://github.com/jansanz/AFRaptureXMLRequestOperation'
s.source = { :git => 'https://github.com/jansanz/AFRaptureXMLRequestOperation.git', :tag => '1.0.2' }
s.platform = :ios, '5.0'
s.source_files = 'AFRaptureXMLRequestOperation/*.{h,m}'

Step 1: Configure the table view.

  • Set a view as the table footer
  • Set the background color to clear.

Step 2: Set the default table view values when your view loads. The values and variables seen here are explained below.

- (void)viewDidLoad {
    [super viewDidLoad];
{
"ignore": false,
"like": false,
"started": false,
"top_shelf": false,
"queue": false,
"current": false,
"item": {
"subtitle": "",
"creator": "A string",
static NSDateFormatter *monthYearFormatter;
#import "NSDate+DateUtils.h"
@implementation NSDate (DateUtils)
- (NSString *)stringMonthYear
{
if (!monthYearFormatter)
{
monthYearFormatter = [[NSDateFormatter alloc] init];
[statusMapping mapKeyPath:@"item" toRelationship:@"item" withMapping:itemMapping];
[statusMapping mapKeyPath:@"item" toRelationship:@"item" withMapping:serializationItemMapping serialize:YES];
AssertionError: Tuples differ: (datetime.date(2011, 9, 19), N... != (datetime.datetime(2011, 9, 19...
First differing element 0:
2011-09-19
2011-09-19 08:17:24
- (datetime.date(2011, 9, 19), None)
+ (datetime.datetime(2011, 9, 19, 8, 17, 24), None)
? ++++ +++++++++++
@dmishe
dmishe / jsonp.js
Created October 22, 2010 13:57
Pure JS JSONP call
function jsonp(url, callback, name, query)
{
if (url.indexOf("?") > -1)
url += "&" + callback + "="
else
url += "?"+ callback +"="
url += name + "&";
if (query)
url += encodeURIComponent(query) + "&";
url += new Date().getTime().toString(); // prevent caching
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.locate</string>
<key>Disabled</key>
<true/>
<key>ProgramArguments</key>
<array>