Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View frankus's full-sized avatar

Frank Schmitt frankus

  • Bellingham, WA, USA
View GitHub Profile
@merlinmann
merlinmann / wisdom.md
Last active April 17, 2024 21:52
Merlin's Wisdom Project (Draft)

Merlin's Wisdom Project

Or: “Everybody likes being given a glass of water.”

By Merlin Mann.

It's only advice for you because it had to be advice for me.

@norio-nomura
norio-nomura / building-yams-using-xcodebuild-without-xcodeproj.sh-session
Last active August 3, 2023 10:56
[Xcode 11] Building Yams using `xcodebuild` without `.xcodeproj` with `-destination "name=iPhone 8"`
➜ 15:27:26 git clone https://github.com/jpsim/Yams.git
Cloning into 'Yams'...
remote: Enumerating objects: 111, done.
remote: Counting objects: 100% (111/111), done.
remote: Compressing objects: 100% (80/80), done.
remote: Total 3987 (delta 58), reused 71 (delta 31), pack-reused 3876
Receiving objects: 100% (3987/3987), 4.24 MiB | 1.85 MiB/s, done.
Resolving deltas: 100% (2313/2313), done.
➜ 15:27:43 cd Yams
➜ 15:27:46 git:(master) rm -rf Yams.xcodeproj
@PadraigK
PadraigK / clamp.swift
Last active May 17, 2019 17:51
Demonstrates clamping a closed range instead of min(maxBound, max(minBound, value))
/*
Instead of this...
CGFloat minConstant = -60.0f;
CGFloat maxConstant = self.actionViewDefaultBottomConstraintConstant;
CGFloat stuckConstant = maxConstant - distanceToBottom;
// :chefpoop:
actionViewBottomContraintConstant = fminf(maxConstant, fmaxf(minConstant, stuckConstant));
*/
@peterprokop
peterprokop / URLRequest.swift
Last active August 29, 2022 15:40
Print NSURLRequest in cURL format (Swift 3)
//
// URLRequest.swift
//
// Created by Peter Prokop on 17/08/2017.
import Foundation
public extension URLRequest {
/// Returns a cURL command for a request
import UIKit
extension UIColor: IntegerLiteralConvertible {
class func convertFromIntegerLiteral(value: IntegerLiteralType) -> UIColor {
let r = Double((value >> 16) & 0xFF) / 255;
let g = Double((value >> 8) & 0xFF) / 255;
let b = Double((value) & 0xFF) / 255;
return UIColor(red:r, green:g, blue:b, alpha:1.0)
}
@mattt
mattt / uiappearance-selector.md
Last active March 19, 2024 12:52
A list of methods and properties conforming to `UIAppearance` as of iOS 12 Beta 3

Generate the list yourself:

$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./*     | \
  sed 's/NS_AVAILABLE_IOS(.*)//g'     | \
  sed 's/NS_DEPRECATED_IOS(.*)//g'    | \
  sed 's/API_AVAILABLE(.*)//g'        | \
  sed 's/API_UNAVAILABLE(.*)//g'      | \
 sed 's/UI_APPEARANCE_SELECTOR//g' | \
@oneredstar
oneredstar / NSData+AESCrypt.h
Created June 18, 2011 21:03 — forked from gonecoding/Readme.markdown
Adding methods to NSData and NSString using categories to provide AES256 encryption on iOS
//
// NSData+AESCrypt.h
//
// AES Encrypt/Decrypt
// Created by Jim Dovey and 'Jean'
// See http://iphonedevelopment.blogspot.com/2009/02/strong-encryption-for-cocoa-cocoa-touch.html
//
// BASE64 Encoding/Decoding
// Copyright (c) 2001 Kyle Hammond. All rights reserved.
// Original development by Dave Winer.