Skip to content

Instantly share code, notes, and snippets.

@tobins
tobins / MP4View.swift
Created March 31, 2016 01:47
MP4 loading & playing
//
// MP4View.swift
//
// Created by Tobin Schwaiger-Hastanan on 3/25/16.
// Copyright © 2016 Tobin Schwaiger-Hastanan. All rights reserved.
//
import UIKit
import AVFoundation
@tobins
tobins / Graph.playground
Created August 13, 2018 22:27
CAShapeLayer as a Graphy (playgrounds)
//: A UIKit based Playground for presenting user interface
import UIKit
import PlaygroundSupport
protocol GraphViewDataSource {
func numberOfGraphs(in graphView:GraphView) -> Int
func graphView(_ graphView:GraphView, numberOfValuesForGraph graph:Int) -> Int
func graphView(_ graphView:GraphView, valueForGraphAt indexPath:IndexPath) -> Float
}
@tobins
tobins / Array+Diff.swift
Created February 13, 2019 19:32
Diff two arrays in swift
import UIKit
var left:[Int] = [1,1,1,1,1]
var right:[Int] = [1,2,2,2,2,2,2,1]
enum Difference {
case insert(Int, Any)
case delete(Int, Any)
}
@tobins
tobins / good-verification-moderator-attack.MD
Last active May 3, 2020 14:40
Good Verification via Moderator Attack - Ajay Fun

Moderator Attack Verification (Good)

Overview

The method described in this document is to help the good team verify other good players via attacking the moderator on the same night. When using this method players NEVER have to reveal the information received from the moderator to verify them as good.

As per the rules, when a good player attacks the moderator they learn of a random character that is in play. All good players who attack this character on the same night will receive the same information.

NOTE: If fake news is played, then good players may receive different information and no one will be able to be verified, however it will be known that fake news was used.

How it works

This verification method uses a one way cryptographic hash function to verify the integrity of the information received by the moderator amongst participating parties WITHOUT having to share the information with anyone else.