Skip to content

Instantly share code, notes, and snippets.

View norio-nomura's full-sized avatar

Norio Nomura norio-nomura

View GitHub Profile
//
// Collection+movingAverage.swift
//
// inspired by https://gist.github.com/hirohitokato/5bfc5836480d68074135820d73c04794
import Foundation
public protocol ArithmeticType: Comparable, IntegerLiteralConvertible {
func +(lhs: Self, rhs: Self) -> Self
@norio-nomura
norio-nomura / URLCodableTest.playground
Created June 12, 2017 15:08 — forked from ken0nek/URLCodableTest.playground
Can not decode an entity which has Optional<URL> property.
//: Playground - noun: a place where people can play
import UIKit
struct URLCodableTest: Codable {
let ou: URL?
let u: URL
enum CodingKeys: String, CodingKey {
case ou
@norio-nomura
norio-nomura / otpauthFromVIPAccess.exp
Last active September 21, 2016 08:23 — forked from p120ph37/VIPAccess.exp
Generate otpauth URL from Symantec's "VIP Access" on OS X that can be used by TOTP Apps such as 1Password.
#!/usr/bin/expect -f
#
# otpauthFromVIPAccess.exp
#
# Generate otpauth scheme url from Symantec VIP Access.
# Usage:
# ./otpauthFromVIPAccess.exp [v]
# If the "v" argument (or any argument) is specified, verbose output
# will be produced on stderr. The otpauth url will be output on stdout.
#