Skip to content

Instantly share code, notes, and snippets.

View chriswebb09's full-sized avatar

Christopher Webb chriswebb09

View GitHub Profile
func palindrome(string: String) -> Bool {
var replacedString = string.replacingOccurrences(of: " ", with: "")
replacedString = replacedString.components(separatedBy:.punctuationCharacters).joined()
return replacedString.lowercased() == String(replacedString.lowercased().reversed())
}
class ViewController: UIViewController, ARSCNViewDelegate, ARSessionDelegate {
@IBOutlet weak var sceneView: ARSCNView!
override func viewDidLoad() {
super.viewDidLoad()
}
func run() {
let configuration = ARWorldTrackingConfiguration()
def main():
crawl = WebCrawler()
new_data = crawl.request_resource()
if new_data is not None:
for url in new_data:
print(url)
def request_resource(self):
r = requests.get(self.url)
urls = re.findall('http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+', r.text)
return urls
def __init__(self):
print(sys.argv[0])
if sys.argv[1].startswith("http://") or sys.argv[1].startswith("https://"):
self.url = sys.argv[1]
else:
self.url = "https://" + sys.argv[1]
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
var coordinator: MainCoordinator!
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
window = UIWindow(frame: UIScreen.main.bounds)
import UIKit
protocol ApplicationCoordinator {
var appCoordinator: Coordinator! { get set }
var window: UIWindow { get set }
func start()
}
import UIKit
protocol TabControllerCoordinator: Coordinator {
var tabBarController: UITabBarController { get set }
var childCoordinators: [NavigationCoordinator] { get set }
}
import UIKit
protocol Coordinator: class {
weak var delegate: CoordinatorDelegate? { get set }
var type: CoordinatorType { get set }
func start()
}
import UIKit
protocol NavigationCoordinator: Coordinator {
var navigationController: UINavigationController { get set }
}