Skip to content

Instantly share code, notes, and snippets.

View TyrfingMjolnir's full-sized avatar
💭
in my scriptorium whipping up some whoopass

Tyrfing Mjølner TyrfingMjolnir

💭
in my scriptorium whipping up some whoopass
View GitHub Profile
@TyrfingMjolnir
TyrfingMjolnir / downloaadXML.swift
Created January 20, 2019 21:27 — forked from Alicelovecode/downloaadXML.swift
downloaadXML.swift
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)
}
@TyrfingMjolnir
TyrfingMjolnir / swift_soap_api.swift
Created January 20, 2019 21:26 — forked from izzuddin91/swift_soap_api.swift
swift xcode xml parser soap ui
//
// TestViewController.swift
// etiqa-autoclaim
//
// Created by izzuddin on 25/10/2017.
// Copyright © 2017 etiqa. All rights reserved.
//
import UIKit
import Foundation
// See: https://devforums.apple.com/message/1000934#1000934
import Foundation
// Logic
operator prefix ¬ {}
@prefix func ¬ (value: Bool) -> Bool {
return !value
}
struct CurrencyResult: Codable {
let success: Bool
let name: String
let date: String
let rawCurrencies: [String: Float]
var currencies: [Currency] {
var currencies = [Currency]()
@TyrfingMjolnir
TyrfingMjolnir / City.swift
Created October 17, 2018 08:25 — forked from hubertcross/City.swift
City codable class - How can I make RestArguments take City (or any Codable) as a property so it can be carried when passed to wc.makeHTTPPOSTRequest() ???
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
@TyrfingMjolnir
TyrfingMjolnir / paste-log.swift
Last active October 16, 2018 15:08 — forked from maxchuquimia/paste-log.swift
Clipboard Content Tracker. It's that simple.
/**
* 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
@TyrfingMjolnir
TyrfingMjolnir / app.js
Last active April 21, 2018 14:26 — forked from yoitsro/gist:8693021
Node + Restify + Passport + Sessions + WebSockets
#!/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();
@TyrfingMjolnir
TyrfingMjolnir / auth.pl
Created March 14, 2018 06:47 — forked from mmriis/auth.pl
IMAP/POP3 proxy authentication script for nginx. See http://www.whatastruggle.com/nginx-as-an-imappop3-proxy-part-2.
#!/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;
//
// main.swift
// Test
//
// Created by Chris Eidhof on 29/08/15.
// Copyright © 2015 Chris Eidhof. All rights reserved.
//
import Foundation
import Quartz
@TyrfingMjolnir
TyrfingMjolnir / main.swift
Last active January 31, 2018 08:38 — forked from chriseidhof/main.swift
Accelerate-wrapper
//
// 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