Skip to content

Instantly share code, notes, and snippets.

View aperfect's full-sized avatar

Adam Perfect aperfect

View GitHub Profile
@aperfect
aperfect / CloudKit.rb
Created May 26, 2023 09:14
CloudKit server-to-server example in Ruby
#!/usr/bin/env ruby
# CloudKit public database connection with server-to-server
# See https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6
require 'time'
require 'openssl'
require 'digest'
require 'json'
require 'base64'
@aperfect
aperfect / CloudKit.swift
Created April 13, 2023 08:52
CloudKit server-to-server Swift authentication example
// Swift example for Apple CloudKit server-to-server token authentication
// See: https://developer.apple.com/library/archive/documentation/DataManagement/Conceptual/CloudKitWebServicesReference/SettingUpWebServices.html#//apple_ref/doc/uid/TP40015240-CH24-SW6
import Foundation
import CryptoKit
import Network
// Set up your body JSON
@aperfect
aperfect / css-type-scale.rb
Last active February 9, 2023 15:40
Utopia.fyi type scale generator, with intervals. Run in command line or use in your own code
#!/usr/bin/env ruby
# See https://utopia.fyi/type/calculator for the original interactive calculator, without intervals
rem = 16 # px value of 1rem
base_min_size = 18 # minimum font size at min width
base_max_size = 29 # maximum font size at min width
min_width = 320 # minimum viewport width
max_width = 3840 # maximum maximum width
Verifying my Blockstack ID is secured with the address 17XmFFXSWoFsZGUASh7UtzVPa95Hm6P5Wk https://explorer.blockstack.org/address/17XmFFXSWoFsZGUASh7UtzVPa95Hm6P5Wk