Skip to content

Instantly share code, notes, and snippets.

@ifranseda
ifranseda / gen-payload.swift
Created April 17, 2026 02:33
Generate Encrypted Payload
import Foundation
import Security
enum LockerPayloadError: Error {
case invalidPublicKey
case encryptionFailed
}
/// Generate RSA-OAEP SHA-256 encrypted payload for verify-payload endpoint.
/// - Parameters:
@ifranseda
ifranseda / channel-example.swift
Created December 22, 2019 08:14 — forked from kainosnoema/channel-example.swift
Golang-like concurrency semantics in Swift
import Foundation
go(println("in a thread"))
// buffered channel
var c = Chan(buffer:20)
// sending routing
go {
while(true) {
@ifranseda
ifranseda / assets-exporter
Last active June 15, 2021 13:04
Export all slices from Sketch file into ready-to-use asset files for Android & iOS.
#!/bin/bash
# assets-exporter
# Author: Isnan Franseda
# HappyFresh 2017
# sketchtool installed may used different version with sketchtool provided by Sketch.app version installed
# if you find error "Failed to open document", you may need to re-install sketchtool based on Sketch.app version installed
# For example: /Application/Sketch.app/Contents/Resources/sketchtool/install.sh
#