Skip to content

Instantly share code, notes, and snippets.

@shazron
shazron / gist:943736
Created April 27, 2011 04:55
About XCode 4 Project Template (How To Create Custom Project Template)
From: http://snipt.net/yonishin/about-xcode-4-project-template
XCode 4 Projects and Files Template Folder: /Developer/Library/Xcode/Templates
Examples:
/Developer/Library/Xcode/Templates/Project Templates/Base/Other/Empty.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Base/Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Mac Base.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Command Line Tool.xctemplate
/Developer/Library/Xcode/Templates/Project Templates/Mac/Application/Cocoa Application.xctemplate
@kristopherjohnson
kristopherjohnson / Stopwatch.swift
Last active July 13, 2022 11:24
Swift classes for calculating elapsed time, similar to .NET's System.Diagnostics.Stopwatch class
// Copyright (c) 2017 Kristopher Johnson
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
@Kevinwlee
Kevinwlee / pem.md
Created February 2, 2016 15:13
Creating PEMs for ContextHub

Certificates

Before you can use the push services you will need to create a Production and Sandbox push certificate for you application.

After you have downloaded your push certificates, you will need to create a PEM file out of both of them.

  1. Open the Keychain Access application and select your production certificate and its private key.
  2. From the File menu select "Export Items..."
  3. Name the export "Certificates.p12" and save them to your desktop.
  4. Open a terminal window and change directories to your Desktop
@andreif
andreif / AppDelegate.swift
Created March 16, 2016 22:15
Example of UIPageViewController without storyboard i.e. created programmatically
// derived from https://www.veasoftware.com/posts/uipageviewcontroller-in-swift-xcode-62-ios-82-tutorial
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = ViewController()
@StanDimitroff
StanDimitroff / UIImage+CIPerspectiveCorrection.swift
Last active June 21, 2023 04:49
Image perspective correction
extension UIImage {
var flattened: UIImage? {
let ciImage = CIImage(image: self)!
guard let openGLContext = EAGLContext(api: .openGLES2) else { return nil }
let ciContext = CIContext(eaglContext: openGLContext)
let detector = CIDetector(ofType: CIDetectorTypeRectangle,
context: ciContext,
options: [CIDetectorAccuracy: CIDetectorAccuracyHigh])!
/*
**********************************
Voice identifier: com.apple.ttsbundle.Maged-compact
Voice language: ar-SA
Voice name: Maged
Voice quality: 1
**********************************
Voice identifier: com.apple.ttsbundle.Zuzana-compact
Voice language: cs-CZ
Voice name: Zuzana