Skip to content

Instantly share code, notes, and snippets.

View agnosticdev's full-sized avatar
👨‍💻
netdev, netsec, and mobile

Matt Eaton agnosticdev

👨‍💻
netdev, netsec, and mobile
View GitHub Profile
@agnosticdev
agnosticdev / MasterViewController.swift
Created May 10, 2017 20:28
AlamoFire NetworkReachabilityManager Test For Device Running 10.3.1
import Alamofire
import UIKit
class MasterViewController: UITableViewController {
@IBOutlet weak var titleImageView: UIImageView!
var detailViewController: DetailViewController? = nil
var objects = NSMutableArray()
var networkReachabilityManager = Alamofire.NetworkReachabilityManager(host: "www.apple.com")
@agnosticdev
agnosticdev / UIlabel.swift
Created September 24, 2015 12:57
Swift implementation of a UILabel Programmatically
let cellLabel = UILabel(frame: CGRectMake(10, 0, 400, 21))
cellLabel.textAlignment = NSTextAlignment.Left
cellLabel.text = self.tableData[indexPath.row]
cellLabel.font = UIFont(name: "HelveticaNeue-UltraLight", size: 20)
cellLabel.textColor = UIColor.blackColor()
cellLabel.backgroundColor = UIColor.clearColor()
cell.addSubview(cellLabel)
@agnosticdev
agnosticdev / TableViewController.swift
Created September 21, 2015 16:05
Implementation of a UITableView in a ViewController in Swift
import UIKit
class MyViewController: UIViewController,UITableViewDelegate,UITableViewDataSource {
var tableData: [String] = ["Table Item One", "Table Item Two"]
var tableViewLocal: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
@agnosticdev
agnosticdev / AppDelegate.swift
Created September 21, 2015 10:51
Uses Swift to create a UITabBarController and set it as the rootViewController in the AppDelegate.
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
print("here")
self.window = UIWindow(frame: UIScreen.mainScreen().bounds)
let nav1 = UINavigationController()
@agnosticdev
agnosticdev / html.nanorc
Last active September 12, 2015 17:14
NANORC HTML Syntax Configuration
syntax "html" "\.htm[l]?$"
color red start="<" end=">"
color white "(<|=|>)"
color green "&[^;[[:space:]]]*;"
color yellow ""[^"]*"|qq\|.*\|"
color green "(alt|class|title|id|bgcolor|height|href|label|longdesc|name|onclick|onfocus|onload|onmouseover|size|span|src|style|target|type|value|width)"