Skip to content

Instantly share code, notes, and snippets.

Avatar

Magnus Jensen magnuskahr

View GitHub Profile
View AirQualityUCI.csv
We can't make this file beautiful and searchable because it's too large.
"Date","Time","CO(GT)","PT08.S1(CO)","NMHC(GT)","C6H6(GT)","PT08.S2(NMHC)","NOx(GT)","PT08.S3(NOx)","NO2(GT)","PT08.S4(NO2)","PT08.S5(O3)","T","RH","AH","",""
"10/03/2004","18.00.00","2,6","1360","150","11,9","1046","166","1056","113","1692","1268","13,6","48,9","0,7578","",""
"10/03/2004","19.00.00","2","1292","112","9,4","955","103","1174","92","1559","972","13,3","47,7","0,7255","",""
"10/03/2004","20.00.00","2,2","1402","88","9","939","131","1140","114","1555","1074","11,9","54","0,7502","",""
"10/03/2004","21.00.00","2,2","1376","80","9,2","948","172","1092","122","1584","1203","11","60","0,7867","",""
"10/03/2004","22.00.00","1,6","1272","51","6,5","836","131","1205","116","1490","1110","11,2","59,6","0,7888","",""
"10/03/2004","23.00.00","1,2","1197","38","4,7","750","89","1337","96","1393","949","11,2","59,2","0,7848","",""
"11/03/2004","00.00.00","1,2","1185","31","3,6","690","62","1462","77","1333","733","11,3","56,8","0,7603","",""
@magnuskahr
magnuskahr / EnumPicker.swift
Last active Jul 25, 2020
A simple picker to pick a enum.
View EnumPicker.swift
import SwiftUI
struct EnumPicker<T: Hashable & CaseIterable, V: View>: View {
@Binding var selected: T
var title: String? = nil
let mapping: (T) -> V
var body: some View {
@magnuskahr
magnuskahr / bingo-python.ipynb
Created Dec 13, 2019
Bingo Ticket Isolation
View bingo-python.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View untitled8.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magnuskahr
magnuskahr / projectbook.ipynb
Last active Nov 25, 2019
projectbook_v6 UNET.ipynb
View projectbook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@magnuskahr
magnuskahr / AlertActivityIndicator.swift
Created May 29, 2019
Showing an ActivityIndicator in a Alert
View AlertActivityIndicator.swift
let alert = UIAlertController(title: "Sender ...", message: nil, preferredStyle: .alert)
let activityIndicator = UIActivityIndicatorView(style: .gray)
activityIndicator.translatesAutoresizingMaskIntoConstraints = false
activityIndicator.isUserInteractionEnabled = false
activityIndicator.startAnimating()
alert.view.addSubview(activityIndicator)
alert.view.heightAnchor.constraint(equalToConstant: 95).isActive = true
activityIndicator.centerXAnchor.constraint(equalTo: alert.view.centerXAnchor, constant: 0).isActive = true
View failableDecoableExample.swift
import Foundation
// We provide some json and transform it to Data-type
let json = """
[{
"name": "John",
"startingTime": 581167640.06502903
}, {
"name": "Mark",
"startingTime": 582031640.06502903
View ConfettiView.swift
import UIKit
import QuartzCore
class ConfettiView: UIView {
public var colors: [UIColor]!
public var intensity: Float!
private(set) var active: Bool!
override public class var layerClass: Swift.AnyClass {
You can’t perform that action at this time.