Skip to content

Instantly share code, notes, and snippets.

View simonseyer's full-sized avatar

Simon Seyer simonseyer

View GitHub Profile
typedef enum {
PROTO_UPLOAD_IN_PROGRESS = 0,
PROTO_UPLOAD_DONE,
PROTO_UPLOAD_FAILED,
PROTO_UPLOAD_NO_CONNECTION
} proto_upload_status_t;
typedef struct {
uint8_t data_id;
proto_upload_status_t status;
@simonseyer
simonseyer / op_download_documents.sh
Created December 16, 2018 17:32
Download all documents from a 1Password vault (macOS)
#!/bin/bash
# Dependencies:
# 1Password cli tool: https://support.1password.com/command-line/
# jq
#
# Usage:
# ./op_download_documents.sh <op_subdomain> <vault_uuid>
#
# op_subdomain: 1Password subdomain (login once via `op signin <signinaddress> <emailaddress> <secretkey>`)
@simonseyer
simonseyer / WeakSet.swift
Created February 27, 2018 15:37
Typesafe implementation of a weak set in Swift 4
import Foundation
public class WeakSet<T: AnyObject>: Sequence, ExpressibleByArrayLiteral, CustomStringConvertible, CustomDebugStringConvertible {
private var objects = NSHashTable<T>.weakObjects()
public init(_ objects: [T]) {
for object in objects {
insert(object)
}
@simonseyer
simonseyer / bower.json
Last active August 29, 2015 14:13
Polymer/core-list issue
{
"name": "core-list Issue",
"version": "0.0.0",
"authors": [
"Simon Seyer <[email protected]>"
],
"main": "index.html",
"license": "MIT",
"ignore": [
"**/.*",