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
| func downloaadXML(webAddress:String){ | |
| if InternetOK() == true{ | |
| if let url = URL(string: webAddress){ | |
| let task = session.dataTask(with: url, completionHandler: { | |
| (data, response, error) in | |
| if error != nil{ | |
| print(error!.localizedDescription) | |
| DispatchQueue.main.async { | |
| self.popAlert(withTitle: "Error", andMessage: error!.localizedDescription) | |
| } |
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
| // | |
| // TestViewController.swift | |
| // etiqa-autoclaim | |
| // | |
| // Created by izzuddin on 25/10/2017. | |
| // Copyright © 2017 etiqa. All rights reserved. | |
| // | |
| import UIKit | |
| 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
| // See: https://devforums.apple.com/message/1000934#1000934 | |
| import Foundation | |
| // Logic | |
| operator prefix ¬ {} | |
| @prefix func ¬ (value: Bool) -> Bool { | |
| return !value | |
| } |
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
| struct CurrencyResult: Codable { | |
| let success: Bool | |
| let name: String | |
| let date: String | |
| let rawCurrencies: [String: Float] | |
| var currencies: [Currency] { | |
| var currencies = [Currency]() |
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 Foundation | |
| class City: NSObject, Codable { | |
| var name: String = "" | |
| var countrycode: String = "" | |
| var district: String = "" | |
| var population: Int = 0 | |
| init(name: String, countrycode: String, district: String, population: Int) { | |
| self.name = name |
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
| /** | |
| * Prints changed to the pasteboard on screen. Can also be made to run a command with each new string. | |
| * Usage: swift paste-log.swift | |
| * Prints all new clipboard items on the screen | |
| * or : swift paste-log.swift wget | |
| * Runs wget with a newly copied string | |
| * Works in Mojave w/XCode 10, and swift 4.2 | |
| */ | |
| 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
| #!/usr/bin/env node | |
| const restify = require( 'restify' ); | |
| // Authentication | |
| const passport = require( 'passport' ); | |
| const LocalStrategy = require( 'passport-local' ).Strategy; | |
| const sessions = require( 'client-sessions' ); | |
| const server = restify.createServer(); |
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
| #!/usr/bin/perl | |
| use Digest::HMAC_MD5 qw/ hmac_md5_hex /; | |
| use DBI; | |
| use URI::Escape; | |
| use CGI; | |
| print "Content-type: text/html\n"; | |
| my $q = CGI->new; |
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
| // | |
| // main.swift | |
| // Test | |
| // | |
| // Created by Chris Eidhof on 29/08/15. | |
| // Copyright © 2015 Chris Eidhof. All rights reserved. | |
| // | |
| import Foundation | |
| import Quartz |
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
| // | |
| // main.swift | |
| // Accelerate | |
| // | |
| // Created by Chris Eidhof on 17/08/14. | |
| // Copyright (c) 2014 Chris Eidhof. All rights reserved. | |
| // Updated for your convenience to Swift 4 by Gjermund G Thorsen in 18/01/30 | |
| // | |
| import Accelerate |