Skip to content

Instantly share code, notes, and snippets.

View DenTelezhkin's full-sized avatar

Denys Telezhkin DenTelezhkin

View GitHub Profile
@DenTelezhkin
DenTelezhkin / LoadableFromXibView.swift
Last active July 4, 2020 17:47
DEPRECATED. Please use https://github.com/MLSDev/LoadableViews. Create reusable views in XIBs and easily load them in another XIB, storyboard, or programmatically.
import Foundation
import UIKit
protocol NibDefinable {
var nibName: String { get }
}
extension NibDefinable {
var nibName : String {
return String(self.dynamicType)
import Cocoa
// for-in
func checkForIn(array: [Int], dict: [Int: String]) {
for num in array where dict[num] != nil {
num
}
}
checkForIn([1,2,3,4], dict: [1:"one", 2:"two"])
@orta
orta / _SQL.sql
Last active November 8, 2016 12:12
Top 300 Pods by Application Integrations
SELECT pods.name, stats_metrics.download_total, stats_metrics.download_week, stats_metrics.app_total, stats_metrics.app_week FROM stats_metrics JOIN pods ON stats_metrics.pod_id = pods.id ORDER BY app_total DESC LIMIT 300;
@steipete
steipete / openssl-build.h
Last active May 30, 2023 11:34
Updated script that builds OpenSSL with Bitcode enabled (tested with Xcode 7.0b3)
#!/bin/bash
# This script downlaods and builds the iOS and Mac openSSL libraries with Bitcode enabled
# Credits:
# https://github.com/st3fan/ios-openssl
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh
# Peter Steinberger, PSPDFKit GmbH, @steipete.
set -e
import Cocoa
// Note: use of enumeration var in generic is instadeath
// Note: use of static var in generic is not yet supported
public protocol EnumConvertible: Hashable {
init?(hashValue hash: Int)
static func countMembers() -> Int
static func members() -> [Self]
}
@mackuba
mackuba / wwdc15.md
Last active August 6, 2022 17:28
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: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@rbobbins
rbobbins / protocols.md
Last active June 11, 2024 22:11
Notes from "Protocol-Oriented Programming in Swift"

PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug

Protocol-Oriented Programming in Swift

Speaker: David Abrahams. (Tech lead for Swift standard library)

  • "Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.

  • OOP has been around since the 1970's. It's not actually new.

  • Classes are Awesome

    • Encapsulation
    • Access control
@Tokuriku
Tokuriku / Count lines of code in Xcode project
Last active June 30, 2024 21:09 — forked from ccabanero/Count lines of code in Xcode project
Count lines of code in SWIFT Xcode project
1. Open Terminal
2. cd to your Xcode project
3. Execute the following when inside your target project:
find . -name "*.swift" -print0 | xargs -0 wc -l
@isoiphone
isoiphone / gist:0a1e20d0ffa7bd28073e
Created May 13, 2015 06:55
This seems to be the ONLY way to change a bar tint color of a MFMailComposeViewController (on iOS 8)
let navigationBarAppearance = UINavigationBar.appearance()
let previousColor = navigationBarAppearance.barTintColor
navigationBarAppearance.barTintColor = .whiteColor()
let mailCompose = MFMailComposeViewController()
navigationBarAppearance.barTintColor = previousColor
@RenGate
RenGate / buildstep.sh
Created February 20, 2015 09:11
Automatic generation of build number in Xcode project for easy Apple TestFlight distribution. It is a known fact that Apple TestFlight checks build number of uploaded ipa file and rejects binary if its build number is "less" than the one of the latest accepted build. It is hard to constantly change build number and push it to repo for building u…
buildNumber=$(date +%y.%m.%d.%H%M)
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"