This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'mysql' | |
| require 'active_record' | |
| ActiveRecord::Base.logger = Logger.new('debug.log') | |
| configuration = YAML::load(IO.read('config/database.yml')) | |
| ActiveRecord::Base.establish_connection(configuration['development']) | |
| class FactorWeight < ActiveRecord::Base | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import XCTest | |
| @testable import Society6 | |
| class ModelFactoryTests: XCTestCase { | |
| override func setUp() { | |
| super.setUp() | |
| // Put setup code here. This method is called before the invocation of each test method in the class. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?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'; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // AttributtedStrings.swift | |
| // eHow | |
| // | |
| // Created by Joel Kopelioff on 3/5/15. | |
| // Copyright (c) 2015 Demand Media. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // LinkedStoryboardSegue.swift | |
| // | |
| // | |
| import UIKit | |
| class LinkedStoryboardSegue: UIStoryboardSegue { | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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(".") | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // ModelFactory.swift | |
| // Society6 | |
| // | |
| // Created by Joel Kopelioff on 8/10/15. | |
| // Copyright (c) 2015 Demandmedia Inc. All rights reserved. | |
| // | |
| import Foundation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // 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 |
NewerOlder