Skip to content

Instantly share code, notes, and snippets.

// Hiding NavBar and TabBar example
// Created by Joel Kopelioff on 1/30/15.
//
import UIKit
import SVProgressHUD
import CoreData
class MyViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UIScrollViewDelegate {
@jkopelioff
jkopelioff / UIImageView+AFNetworking+UIActivityIndicator.swift
Created August 6, 2015 20:57
UIImageView+AFNetworking+UIActivityIndicator
//
// UIImageView+AFNetworking+UIActivityIndicator.swift
//
// Created by Joel Kopelioff on 8/6/15.
// Copyright (c) 2015 DemandMedia Inc
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@jkopelioff
jkopelioff / ExpandOutModalTransitioningManager.swift
Last active August 29, 2015 14:26
ExpandOutModalTransitioningManager.swift
//
// ExpandOutModalTransitioningManager.swift
// eHow
//
// Created by Joel Kopelioff on 7/9/15.
// Copyright (c) 2015 Demand Media.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@jkopelioff
jkopelioff / String+Regex.swift
Created August 13, 2015 20:27
Additional functionality to Strings using regex
extension String {
func matchRegex(pattern: Regex) -> Bool {
let range: NSRange = NSMakeRange(0, count(self))
if pattern.regex != nil {
let matches: [AnyObject] = pattern.regex!.matchesInString(self, options: pattern.matchingOptions, range: range)
return matches.count > 0
}
return false
}
@jkopelioff
jkopelioff / ModelFactory.swift
Created August 13, 2015 22:53
Model Factory that maps Dictionary value to Model properties
//
// ModelFactory.swift
// Society6
//
// Created by Joel Kopelioff on 8/10/15.
// Copyright (c) 2015 Demandmedia Inc. All rights reserved.
//
import Foundation
@jkopelioff
jkopelioff / NSObject+Utils.swift
Created August 14, 2015 19:45
A function equivalent to "valueForKeyPath" but supports Array substructure
public extension NSObject {
func valueForKeyPathWithIndexes(fullPath:String) -> AnyObject? {
var testrange:NSRange = (fullPath as NSString).rangeOfString("[")
if testrange.location == NSNotFound {
return self.valueForKeyPath(fullPath)
}
let parts:Array = fullPath.componentsSeparatedByString(".")
@jkopelioff
jkopelioff / LinkedStoryboardSegue.swift
Created August 18, 2015 18:42
Custom segue to link storyboards
//
// LinkedStoryboardSegue.swift
//
//
import UIKit
class LinkedStoryboardSegue: UIStoryboardSegue {
@jkopelioff
jkopelioff / RoundedButtons.swift
Created August 27, 2015 18:08
Rounded UI Button extension
//
// RoundedUIButtion.swift
// eHow
//
// Created by Joel Kopelioff on 4/13/15.
// Copyright (c) 2015 Demand Media. All rights reserved.
//
import UIKit
//
// AttributtedStrings.swift
// eHow
//
// Created by Joel Kopelioff on 3/5/15.
// Copyright (c) 2015 Demand Media. All rights reserved.
//
import Foundation
<?php
include('../predis/lib/Predis/Autoloader.php');
$m = new MongoClient(); // connect
$collection = $m->opencorkage->selectCollection("restaurants.losangeles");
$base_url = 'http://www.opentable.com/';
$simple_info = 'httphandlers/RestaurantInfoLiteNew.ashx?rid=';
$restaurant_listings = 'los-angeles-restaurant-listings';