Skip to content

Instantly share code, notes, and snippets.

View callionica's full-sized avatar
🏠
Working from home

Callionica callionica

🏠
Working from home
View GitHub Profile
let t = (1, 2, 3) // Anonymous tuple
let n = (x: 1, y: 2, z: 3) // Named tuple
func fn(_ a : Int, _ b : Int, _ c : Int) { // Separate params
print(a, b, c)
}
func tfn(_ t: (a : Int, b : Int, c : Int)) { // Single param
print(t.a, t.b, t.c)
}
[
[10, "en-US", "F", "" , "Ava" , "com.apple.ttsbundle.Ava-premium"],
[10, "en-US", "F", "Siri", "Nicky" , "com.apple.ttsbundle.siri_female_en-US_premium"],
[10, "en-US", "F", "" , "Allison" , "com.apple.ttsbundle.Allison-premium"],
[10, "en-US", "F", "" , "Susan" , "com.apple.ttsbundle.Susan-premium"],
[10, "en-US", "F", "" , "Samantha" , "com.apple.ttsbundle.Samantha-premium"],
[10, "en-US", "M", "Siri", "Aaron" , "com.apple.ttsbundle.siri_male_en-US_premium"],
[10, "en-US", "M", "" , "Tom" , "com.apple.ttsbundle.Tom-premium"],
[10, "en-GB", "F", "" , "Serena" , "com.apple.ttsbundle.Serena-premium"],
[10, "en-GB", "F", "" , "Kate" , "com.apple.ttsbundle.Kate-premium"],
@callionica
callionica / optional-call-avoidance.swift
Created December 13, 2016 19:18
let result = fn<-?(a, b)
// Swift Ver. 3.0.1 (Release)
// Platform: Linux (x86_64)
// Noodling with syntax for call avoidance with optional arguments
// Just to get a sense of what it could look like
// Given a function "fn" that takes 2 non-optional arguments
// We can enable this syntax:
// let result = fn<-?(a, b)
// where a and b are optionals
@callionica
callionica / cpp.json
Last active February 14, 2017 19:29
VSCode Snippets for C++ from Callionica --- Visual Studio Code - VS Code - VSCode
{
"include": {
"prefix": "#inc",
"body": [
"#include \"$1\"",
"$0"
],
"description": "#include \"\""
}
,"include-system": {
// Server-Sent Events
type RequestEvent = Deno.RequestEvent;
type Connection = Deno.Conn;
type StreamController = ReadableStreamDefaultController<Uint8Array>;
const encoder = new TextEncoder();
export class EventConnection {
request: RequestEvent;
controller: StreamController | undefined;