Skip to content

Instantly share code, notes, and snippets.

@lenguyenthanh
lenguyenthanh / Dagger 2.md
Last active March 20, 2025 03:40
Dagger 2 configuration

Small gist shows how to config Dagger 2 to an Android project

@NSExceptional
NSExceptional / UpdateXcodePluginUUIDs.m
Last active December 23, 2015 10:25
A program that adds the UUID of the current installation of Xcode (in /Applications/Xcode.app) to every Xcode plug-in's Info.plist. Does nothing if the plug-in already contains the current UUID.
//
// main.m
// UpdateXcodePluginUUIDs
//
// Created by Tanner on 12/21/15.
// Copyright © 2015 Tanner Bennett. All rights reserved.
//
#import <Foundation/Foundation.h>
//
// Signal+Extensions.swift
// Khan Academy
//
// Created by Nacho Soto on 10/1/15.
// Copyright © 2015 Khan Academy. All rights reserved.
//
import ReactiveCocoa
@bsneed
bsneed / Timings.txt
Last active January 9, 2016 17:29
Performance Comparison of Swift JSON->Model frameworks.
Time to decode 10,000 Person struct's from JSON:
Argo (Simple): 8.563 seconds
measureBlock {
let _ : [Person]? = decode(data)
}
Argo (Decomp'd): 3.344
measureBlock {
let json: Argo.JSON = JSON.parse(data)
// We're going to try to build a collectionview layout engine that can serve up cells and supplementary views
// in a generic way. I haven't built this all the way to the collection view, and I don't konw what the real
// brief is, so there may be lots of gotchas here that don't work as desired, but it scopes out several ways
// to get a handle on the problem and how I'd at least probably start.
// Ultimately, this requires converting (Model, IndexPath) -> Cell and (Model, IndexPath) -> SupView. I'm
// assuming that's the only feature of these factories.
@beccadax
beccadax / Example.swift
Last active March 6, 2020 16:10
Elegant handling of localizable strings in Swift. Note: This code is in Swift 2 and would need updates to be used in modern Swift.
let color = "blue"
let num = 42
localized("Colorless green ideas sleep furiously.")
localized("Colorless \(color) ideas sleep furiously.")
localized("\(num.formatted("%05d")) colorless green ideas sleep furiously.")
@dmrev
dmrev / SmartKey.swift
Last active December 11, 2015 18:28
Another statically-typed NSUserDefaults inspired by https://github.com/radex/SwiftyUserDefaults
class SmartKeyBase: Equatable, Hashable {
private let defaults = NSUserDefaults.standardUserDefaults()
private(set) static var allKeys = Set<SmartKeyBase>()
let name: String
static func removeAllValues() {
allKeys.forEach { $0.removeValue() }
}
init(_ name: String) {
@ssherar
ssherar / UIColorFromRGB.swift
Last active April 18, 2017 21:05
UIColorFromRGB - adapted from http://stackoverflow.com/a/12397366 for Swift
/**
Returns a UIColor object from a Hexadecimal string with a solid colour
i.e.
UIColorFromRGB("#FF0000") == UIColor.redColor()
UIColorFromRGB("#0000FF") == UIColor.blueColor()
UIColorFromRGB("#GGGGGG") == UIColor.blackColor()
UIColorFromRGB("#Hello") == UIColor.blackColor()
@darcyparker
darcyparker / installNeovim.sh
Last active February 15, 2025 12:54
Build and install neovim for Debian
#!/usr/bin/env bash
#Build and install neovim for Debian
#See: https://neovim.io/
#See: https://github.com/neovim/neovim/wiki/Building-Neovim#quick-start
#See: https://gist.github.com/darcyparker/153124662b05c679c417
#Save current dir
pushd . > /dev/null || exit
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 20, 2025 21:15
The best FRP iOS resources.

Videos