Skip to content

Instantly share code, notes, and snippets.

View ohtwo's full-sized avatar
🌙
° ☾ ☆ ¸. ¸ ★ :.  . • ○ ° ★

Kang Byeonghak ohtwo

🌙
° ☾ ☆ ¸. ¸ ★ :.  . • ○ ° ★
View GitHub Profile
@jacobbubu
jacobbubu / ioslocaleidentifiers.csv
Created February 15, 2012 14:41
iOS Locale Identifiers
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
@digitaljhelms
digitaljhelms / gist:4287848
Last active April 26, 2024 10:44
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@rxaviers
rxaviers / gist:7360908
Last active May 4, 2024 17:52
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@akisute
akisute / APIClient.swift
Last active October 6, 2015 17:53
Example of APIClient and TestCase in Swift, using AFNetworking/Bolts
import UIKit
// How to make singleton classes in Swift: http://stackoverflow.com/questions/24024549/dispatch-once-singleton-model-in-swift
// Basically using global constants is the most easy and safe way to go
class APIClient: NSObject {
let functionSessionManager:AFHTTPSessionManager
class var sharedInstance:APIClient {
import Foundation
struct Meter {
var value: Double
init(_ value: Double) {
self.value = value
}
var mm: Double { return value * 1000.0 }
@rbrockerhoff
rbrockerhoff / dictext.swift
Last active March 6, 2020 19:19
Some useful extensions to Dictionary
extension Dictionary {
init (_ array: Array<Element>) {
self = [ : ]
self.merge(array)
}
mutating func merge (array: Array<Element>) {
for (key: KeyType, value: ValueType) in array {
self[key] = value
}
@mattt
mattt / regex.swift
Created August 11, 2014 18:08
Creating a regular expression object from a String literal
class Regex {
let pattern: String
let options: NSRegularExpressionOptions!
private var matcher: NSRegularExpression {
return NSRegularExpression(pattern: self.pattern, options: nil, error: nil)
}
required init(pattern: String, options: NSRegularExpressionOptions = nil) {
self.pattern = pattern
func encode<T>(var value: T) -> NSData {
return withUnsafePointer(&value) { p in
NSData(bytes: p, length: sizeofValue(value))
}
}
func decode<T>(data: NSData) -> T {
let pointer = UnsafeMutablePointer<T>.alloc(sizeof(T.Type))
data.getBytes(pointer)
@radex
radex / NSTimer.md
Last active May 30, 2018 10:33
Swift Extensions: NSTimer

NSTimer is a great example of an over-verbose, outdated Objective-C API. To run a simple line of code after a delay, you need to write a lot of boilerplate crap.

How about this:

NSTimer.schedule(5.seconds) {
  println("Hello world!")
}
@sooop
sooop / Monads.swift
Last active February 3, 2020 16:20
Monad in Swift : 모나드 개념을 Swift로 구현해본다.
/*
모나드는 특정한 타입을 감싸는 타입이며,
raw한 값을 감싸는 함수와
raw한 값을 모나드 값으로 바꾸는 어떤 함수에 바인딩된다.
이를 바탕으로 모나드 프로토콜을 정의하면 다음과 같다.
*/
protocol Monad {