- Additional optional downloads:
- Older SDKs, eg, for building ancient projects.
- Older compilers (for same).
- Either ship gcc/llvm-gcc or don't. Don't ship clang and call it 'gcc', that just breaks anyone who actually needs GCC and finds your not-gcc in the PATH.
This file contains 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 "SPVMainViewController.h" | |
@implementation SPVMainViewController | |
{ | |
UIView *_weightView; | |
UIPanGestureRecognizer *_recog; | |
} | |
- (void)viewDidLoad | |
{ |
This file contains 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 BOOL PSPDFIsDevelopmentBuild(void) { | |
#if TARGET_IPHONE_SIMULATOR | |
return YES; | |
#else | |
static BOOL isDevelopment = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// There is no provisioning profile in AppStore Apps. | |
NSData *data = [NSData dataWithContentsOfFile:[NSBundle.mainBundle pathForResource:@"embedded" ofType:@"mobileprovision"]]; | |
if (data) { |
This file contains 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 <UIKit/UIKit.h> | |
UIColor * operator"" _c(unsigned long long color) | |
{ | |
unsigned long long redComponent = (color & 0xff0000 >> 16); | |
unsigned long long greenComponent = (color & 0x00ff00) >> 8; | |
unsigned long long blueComponent = color & 0xff; | |
float red = redComponent / 255.0; | |
float green = greenComponent / 255.0; | |
float blue = blueComponent / 255.0; |
This file contains 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
######################### | |
# .gitignore file for Xcode5 | |
# | |
# NB: if you are storing "built" products, this WILL NOT WORK, | |
# and you should use a different .gitignore (or none at all) | |
# This file is for SOURCE projects, where there are many extra | |
# files that we want to exclude | |
# | |
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# and https://gist.github.com/adamgit/3786883 |
This file contains 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
typedef enum _UIBackgroundStyle { | |
UIBackgroundStyleDefault, | |
UIBackgroundStyleTransparent, | |
UIBackgroundStyleLightBlur, | |
UIBackgroundStyleDarkBlur, | |
UIBackgroundStyleDarkTranslucent | |
} UIBackgroundStyle; | |
@interface UIApplication (UIBackgroundStyle) | |
-(void)_setBackgroundStyle:(UIBackgroundStyle)style; |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
- /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
- /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
- /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
- /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
This file contains 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
// Export iOS App Icons | |
// by Lucius Kwok | |
// Takes the currently open document and exports it in the standard iOS app icon sizes. | |
// This script is designed for Photoshop CS5. | |
// To install, place this file in the /Applications/Adobe Photoshop CS5/Presets/Scripts/ folder. | |
try { | |
var doc = app.activeDocument; | |
var startState = doc.activeHistoryState; | |
var initialPrefs = app.preferences.rulerUnits; |
Throughout, let
return_type
be the type of object/primitive/etc. you'd like to return (commonlyvoid
)blockName
be the variable name of the block you're creatingvar_type
be the type object/primitive/etc. you'd like to pass as an argument (leave blank for no parameters)varName
be the variable name of the given parameter And remember that you can create as many parameters as you'd like.
Possibly the most common for of declaration.
This file contains 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
{-# LANGUAGE GADTs, DataKinds, KindSignatures, StandaloneDeriving #-} | |
module BezierVec (bezier) where | |
infixr ::: | |
-- encoding of natural numbers (zero and successor of a natural) | |
data Nat = Z | S Nat | |
-- indexed vectors are lists whose first type argument encodes the length of the list |