Skip to content

Instantly share code, notes, and snippets.

@brunokoga
brunokoga / CTExposureDetectionSession+Extensions.swift
Created April 14, 2020 07:51 — forked from mattt/CTExposureDetectionSession+Extensions.swift
Theoretical convenience API for working with Apple's ContactTracing framework
import ContactTracing
extension CTExposureDetectionSession {
func addPositiveDiagnosisKeys(batching keys: [CTDailyTracingKey], completion: CTErrorHandler) {
if keys.isEmpty {
completion(nil)
} else {
let cursor = keys.index(keys.startIndex, offsetBy: maxKeyCount, limitedBy: keys.endIndex) ?? keys.endIndex
let batch = Array(keys.prefix(upTo: cursor))
let remaining = Array(keys.suffix(from: cursor))
@brunokoga
brunokoga / 0_reuse_code.js
Created September 1, 2014 16:55
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
---
layout: nil
---
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
#!/usr/bin/env bash
if [ -z "$1" ]; then
echo "Usage: provide a title argument."
exit -1
else
title="$@"
fi
d=$(date +"%Y-%m-%d")
#!/bin/sh
#
# update_storyboard_strings.sh - automatically extract translatable strings from storyboards and update strings files
# Based on http://forums.macrumors.com/showpost.php?p=16060008&postcount=4 by mikezang
storyboardExt=".storyboard"
stringsExt=".strings"
newStringsExt=".strings.new"
oldStringsExt=".strings.old"
localeDirExt=".lproj"
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
af Afrikaans
af_NA Afrikaans (Namibia)
af_ZA Afrikaans (South Africa)
agq Aghem
agq_CM Aghem (Cameroon)
ak Akan
ak_GH Akan (Ghana)
am Amharic
am_ET Amharic (Ethiopia)
ar Arabic