Skip to content

Instantly share code, notes, and snippets.

-.. .- ... .... -.. --- - -.. --- - -.. --- - ... .--. .- -.-. . -.. --- - -.. .- ... .... ... .--. .- -.-. . -.. .- ... .... -.. --- - -.. --- - -.. --- - ... .--. .- -.-. . -.. .- ... .... -.. --- - -.. .- ... .... -.. .- ... ....
@lindon-fox
lindon-fox / NSButton+PaintCode.m
Last active August 29, 2015 14:13
Cocoa category to style NSButton for PainCode use (with an image only) - For creating the button in code (not in a nib/storyboard)
//
// NSButton+PaintCode.m
// LookUp
//
// Created by Grattan Johnny on 1/10/15.
//
//
#import "NSButton+PaintCode.h"
@lindon-fox
lindon-fox / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@lindon-fox
lindon-fox / gist:8b961f59546ec661f32a
Created October 20, 2014 07:43
Perform after delay with swift
func delay(delay:Double, closure:()->()) {
dispatch_after(
dispatch_time(
DISPATCH_TIME_NOW,
Int64(delay * Double(NSEC_PER_SEC))
),
dispatch_get_main_queue(), closure)
}
//source: http://stackoverflow.com/a/24318861/377384
@lindon-fox
lindon-fox / gist:bc9d24c0f6f9e95f795e
Created October 20, 2014 07:08
Hot to list available fonts on iOS in Swift
for fontFamilyName in UIFont.familyNames() {
println("This is the font family: \(fontFamilyName)")
for fontName in UIFont.fontNamesForFamilyName(fontFamilyName.description) {
println(" This is the font name: \(fontName)")
}
}
@lindon-fox
lindon-fox / ControllerProgressSummary
Created March 18, 2013 07:30
Strange logging on Salesforce
public void doSearch() {
System.debug('mgical fun');
System.debug('mgical fun3');
System.debug('mgical fun4');
System.debug('mgical fun5');
System.debug('mgical fun 2-');
System.debug('mgical fun 2');
System.debug('mgical fun 2');
System.debug('mgical fun 2');
System.debug('mgical fun 2');
#pragma mark -
#pragma mark Subscription restore request methods
- (void)submitRestoredTransaction:(SKPaymentTransaction *)transaction {
UASubscriptionProduct *product = [[UASubscriptionManager shared].inventory productForKey:transaction.payment.productIdentifier];
NSString *key = product.subscriptionKey;
NSString *product_id = transaction.payment.productIdentifier;
NSString *receipt = [[[NSString alloc] initWithData:transaction.transactionReceipt
encoding:NSUTF8StringEncoding] autorelease];
[UAStoreKitObserver restoreTransaction:] [Line 100] Restore Transaction: <SKPaymentTransaction: 0x1c571860> id: com.company.sixmonthsub
2013-01-12 16:03:41.037 testapp2[900:907] [M] => -[UAStoreKitObserver restoreTransaction:] [Line 103] Original transaction: <SKPaymentTransaction: 0x1c565c60>
2013-01-12 16:03:41.038 testapp2[900:907] [M] => -[UAStoreKitObserver restoreTransaction:] [Line 111] Product no longer exists in inventory: com.company.sixmonthsub
2013-01-12 16:03:41.064 testapp2[900:907] [M] => -[UASubscriptionObserver restoreTransaction:] [Line 264] Restoring Transaction for Product ID: com.company.sixmonthsub
2013-01-12 16:03:41.065 testapp2[900:907] [M] => -[UASubscriptionObserver logTransaction:] [Line 496] Transaction ID: 1000000061622236
2013-01-12 16:03:41.067 testapp2[900:907] [M] => -[UASubscriptionObserver logTransaction:] [Line 497] Transaction Date: 2013-01-12 04:33:41
2013-01-12 16:03:41.068 testapp2[900:907] [M] => -[UASubscriptionObserver logTransaction:] [Line 500] Original Transacti
INVALID PRODUCT ID: com.company.sixmonthsub
@lindon-fox
lindon-fox / about.md
Created August 10, 2011 04:04 — forked from jasonrudolph/about.md
Programming Achievements: How to Level Up as a Developer