Skip to content

Instantly share code, notes, and snippets.

View adamdahan's full-sized avatar
🎯
Focusing

Adam Dahan adamdahan

🎯
Focusing
  • Toronto
View GitHub Profile
@werediver
werediver / WiFiSsid.swift
Created July 14, 2016 12:47
Get the connected Wi-Fi network SSID on iOS (in Swift).
import Foundation
import SystemConfiguration.CaptiveNetwork
func getWiFiSsid() -> String? {
var ssid: String?
if let interfaces = CNCopySupportedInterfaces() as NSArray? {
for interface in interfaces {
if let interfaceInfo = CNCopyCurrentNetworkInfo(interface as! CFString) as NSDictionary? {
ssid = interfaceInfo[kCNNetworkInfoKeySSID as String] as? String
break
@werediver
werediver / TextFieldCell.swift
Last active August 20, 2016 07:34
How to get data from UITableView's cells?
import UIKit
import XCPlayground
// SKIP FOR NOW :)
protocol SmartCell {
associatedtype Model
static var reuseId: String { get }
import Foundation
protocol ServiceLocator {
func getService<T>(type: T.Type) -> T?
func getService<T>() -> T?
}
extension ServiceLocator {
@ryanchang
ryanchang / lldb_cheat_sheet.md
Last active May 4, 2024 15:49
LLDB Cheat Sheet

LLDB Cheat Sheet

A complete gdb to lldb command map.

Print out

  • Print object
(lldb) po responseObject
(lldb) po [responseObject objectForKey@"state"]
  • p - Print primitive type
@tom-go
tom-go / install_theos.sh
Created August 13, 2012 16:15
Theos install script
#!/bin/bash
export THEOS=/opt/theos
# clone theos.git
cd /opt
git clone git://github.com/DHowett/theos.git
# clone iphoneheaders.git
cd $THEOS
mv include include.bak