Skip to content

Instantly share code, notes, and snippets.

Dennis Oberhoff docterd

Block or report user

Report or block docterd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
kravik / detect-text.swift
Last active Feb 1, 2019
iOS 11 Vision. Text detection
View detect-text.swift
let image = UIImage(named: "text.png")!
let vnImage = VNImageRequestHandler(cgImage: image.cgImage!, options: [:])
let textRectsRequest = VNDetectTextRectanglesRequest { (request, error) in
if let results = request.results as? [VNTextObservation] {
for result in results {
print("boundingBox \(result.boundingBox)")
print("characterBoxes \(result.characterBoxes)")
cemolcay / ArcTextLayer.swift
Created Jan 22, 2017
Draws a curved string on a CALayer with angle, radius and text that you give.
View ArcTextLayer.swift
import UIKit
// swift port of stackoverflow answer
extension CGFloat {
/** Degrees to Radian **/
var degrees: CGFloat {
return self * (180.0 / .pi)
steipete / gist:d9b44d8e9f341e81414e86d7ff8fb62d
Last active Dec 3, 2019
Using iOS 13.2 devices with Xcode 11.1 (instead of Xcode 11.2) (also, Xcode 10.3)
View gist:d9b44d8e9f341e81414e86d7ff8fb62d
// The trick is to link the DeviceSupport folder from the beta to the stable version.
// sudo needed if you run the Mac App Store version. Always download the dmg instead... you'll thank me later :)
// Support iOS 13.2 devices (Xcode 11.2) with Xcode 11.1:
sudo ln -s /Applications/ /Applications/
// Xcode 10.3 to Xcode 11
sudo ln -s /Applications/ /Applications/
// Then restart Xcode and reconnect your devices. You will need to do that for every beta of future iOS versions
pkuecuekyan / SearchContainerInTabBar.swift
Last active Nov 23, 2019
Set up a UISearchContainerViewController inside a UITabBar for tvOS 9
View SearchContainerInTabBar.swift
func setupTabBarWithSearchContainerView() {
// configure a UIViewController to display search results
// needs to conform to the UISearchResultsUpdating protocol
let searchResultsViewController = SearchResultsViewController()
// setup UISearchController and hook up to search results UIViewController
let searchController = UISearchController(searchResultsController: searchResultsViewController)
searchController.searchResultsUpdater = searchResultsViewController
searchController.hidesNavigationBarDuringPresentation = false
View Bearing.swift
Calculate initial compass bearing between two locations
- parameter fromLocation: Source Location
- parameter toLocation: Destination Location
- returns: bearing (CLLocationDirection)
private func bearingFromLocation(fromLocation: CLLocation, toLocation: CLLocation) -> CLLocationDirection {
mackuba /
Last active Dec 7, 2019
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them:

OS X El Capitan

  • split view - two apps side by side on full screen
View deploy.prototxt
name: "GoogleNet"
input: "data"
input_dim: 10
input_dim: 3
input_dim: 224
input_dim: 224
# hierarchy 1
# conv -> relu -> pool -> lrn
nicklockwood / Hacking UIView Animation
Last active Oct 23, 2019
This article was originally written for issue 12, but didn't make the cut. It was intended to be read in the context of the other articles, so if you aren't familiar with concepts such as CALayer property animations and the role of actionForKey:, read the articles in that issue first.
View Hacking UIView Animation

Hacking UIView animation blocks for fun and profit

In this article, I'm going to explore a way that we can create views that implement custom Core Animation property animations in a natural way.

As we know, layers in iOS come in two flavours: Backing layers and hosted layers. The only difference between them is that the view acts as the layer delegate for its backing layer, but not for any hosted sublayers.

In order to implement the UIView transactional animation blocks, UIView disables all animations by default and then re-enables them individually as required. It does this using the actionForLayer:forKey: method.

Somewhat strangely, UIView doesn't enable animations for every property that CALayer does by default. A notable example is the layer.contents property, which is animatable by default for a hosted layer, but cannot be animated using a UIView animation block.

View Maths.swift
// See:
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
leplatrem /
Created Jan 14, 2014
Split a big MBTiles into smaller ones, based on column index
#!/usr/bin/env python
import os
import sys
import shutil
import subprocess
class UserError(Exception):
You can’t perform that action at this time.