Skip to content

Instantly share code, notes, and snippets.

@zengadget
zengadget / zshrc-cardano-cli
Created April 10, 2021 22:58
Enable `cardano-cli` from Deadalus Wallet
CARDANO_NODE_SOCKET_PATH="/Users/${username}/Library/Application Support/Daedalus Mainnet/cardano-node.socket"
PATH=${PATH}:"/Applications/Daedalus Mainnet.app/Contents/MacOS"
@zengadget
zengadget / gist:7003cc754fb4b358446528cc15e672c7
Last active October 8, 2017 19:54 — forked from rgcottrell/gist:5b876d9c5eea4c9e411c
An FM Synthesizer in Swift using AVAudioEngine
//Swift 4
import AVFoundation
import Foundation
// The maximum number of audio buffers in flight. Setting to two allows one
// buffer to be played while the next is being written.
private let kInFlightAudioBuffers: Int = 2
// The number of audio samples per buffer. A lower value reduces latency for
// changes but requires more processing but increases the risk of being unable
extension UIColor {
func shadeColor(factor: CGFloat) -> UIColor {
var r: CGFloat = 0
var g: CGFloat = 0
var b: CGFloat = 0
var a: CGFloat = 0
var t: CGFloat = factor < 0 ? 0 : 1