Skip to content

Instantly share code, notes, and snippets.

View flightblog's full-sized avatar

Steve Foster flightblog

View GitHub Profile
@pogist
pogist / RSAEncryption.swift
Created December 14, 2018 20:36
Example of RSA encryption on iOS 10+
import Foundation
import Security
struct RSAEncryption {
var publicKey: SecKey!
init(publicKeyString: String) throws {
self.publicKey = try makePublicKey(from: publicKeyString)
}
@enricofoltran
enricofoltran / main.go
Last active December 30, 2025 18:52
A simple golang web server with basic logging, tracing, health check, graceful shutdown and zero dependencies
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
@mikehaytm
mikehaytm / CocoaMethodsRaiseiOS9.txt
Last active January 6, 2016 14:09
Handle With Care: Cocoa methods and properties that may raise exceptions.
CLASS METHODS
+[AVCaptureDevice requestAccessForMediaType:completionHandler:]
+[AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:device:metadata:]
+[HKCategorySample categorySampleWithType:value:startDate:endDate:metadata:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:device:metadata:]
+[HKCorrelation correlationWithType:startDate:endDate:objects:metadata:]
+[HKQuantitySample quantitySampleWithType:quantity:startDate:endDate:]
@17twenty
17twenty / GoWithC.go
Last active July 11, 2016 04:29
Cross Compiling and Language Interop oh my!
package main
import (
"./binding"
"fmt"
)
func main() {
binding.PrintHello()
binding.Seed(1)
fmt.Println(binding.Random())
@mackuba
mackuba / wwdc15.md
Last active October 30, 2025 15:44
New stuff from WWDC 2015

Here's my own list of the interesting stuff announced during this year's WWDC, collected from the keynotes, various Apple docs, blog posts and tweets.

If you're planning to watch the videos, I really recommend this Mac app that helps you download and watch them: https://github.com/insidegui/WWDC.

OS X El Capitan

http://www.apple.com/osx/elcapitan-preview/

  • split view - two apps side by side on full screen
@rbobbins
rbobbins / protocols.md
Last active June 11, 2024 22:11
Notes from "Protocol-Oriented Programming in Swift"

PS: If you liked this talk or like this concept, let's chat about iOS development at Stitch Fix! #shamelessplug

Protocol-Oriented Programming in Swift

Speaker: David Abrahams. (Tech lead for Swift standard library)

  • "Crusty" is an old-school programmer who doesn't trust IDE's, debuggers, programming fads. He's cynical, grumpy.

  • OOP has been around since the 1970's. It's not actually new.

  • Classes are Awesome

    • Encapsulation
    • Access control
@pietbrauer
pietbrauer / Makefile
Created April 26, 2015 10:03
Shutdown and reset all iOS Simulators
erase_sim:
./reset_sim.sh 2>/dev/null; true
@lavalamp
lavalamp / The Three Go Landmines.markdown
Last active December 27, 2025 05:41
Golang landmines

There are three easy to make mistakes in go. I present them here in the way they are often found in the wild, not in the way that is easiest to understand.

All three of these mistakes have been made in Kubernetes code, getting past code review at least once each that I know of.

  1. Loop variables are scoped outside the loop.

What do these lines do? Make predictions and then scroll down.

func print(pi *int) { fmt.Println(*pi) }
@denji
denji / golang-tls.md
Last active February 21, 2026 12:07 — forked from spikebike/client.go
Simple Golang HTTPS/TLS Examples
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048

# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)