Skip to content

Instantly share code, notes, and snippets.

View joehinkle11's full-sized avatar

Joe Hinkle joehinkle11

View GitHub Profile

Objective-C implementations in Swift

  • Proposal: SE-NNNN
  • Authors: Becca Royal-Gordon
  • Review Manager: TBD
  • Status: Awaiting implementation (but only of resilience support)
  • Implementation: In main and release/6.0, behind the ObjCImplementation experimental feature flag
  • Upcoming Feature Flag: ObjCImplementation

Introduction

@algal
algal / Zipping.swift
Created February 17, 2019 01:18
Zip files on iOS, without using external libraries and without interoperating with the low-level Compression framework
// Zipping.swift
// known-good: Swift 4.2
// Alexis Gallagher
import Foundation
public extension URL {
/// Creates a zip archive of the file or folder represented by this URL and returns a references to the zipped file
///
@puf
puf / README.md
Last active March 28, 2023 16:37
Firebase Hosting Deploy Single File

This script may no longer work. Have a look at its (more official) replacement: https://github.com/firebase/firebase-tools/tree/master/scripts/examples/hosting/update-single-file

Firebase Hosting Deploy Single File

This utility script deploy a single local file to an existing Firebase Hosting site. Other files that are already deployed are left unmodified.

The difference with firebase deploy is that this script does not require you to have a local snapshot of all hosted files, you just need the one file that you want to add/update.

@marcrasi
marcrasi / XXXX-constexpr.md
Last active April 19, 2024 21:10
Compile Time Constant Expressions for Swift
@mika76
mika76 / lua.json
Last active March 14, 2020 09:39
Corona SDK snippets for VS Code
{
"audio.dispose": {
"body": "audio.dispose( ${1:audioHandle} )",
"description": "Releases audio memory associated with the handle.",
"prefix": "audio.dispose"
},
"audio.fade": {
"body": "audio.fade( ${1:[ { [channel=c] [, time=t] [, volume=v ] } ]} )",
"description": "This fades a playing sound in a specified amount to a specified volume. The audio will continue playing after the fade completes.",
"prefix": "audio.fade"
@sharplet
sharplet / trap.swift
Created November 23, 2015 03:46
Simple signal handling in Swift
import Darwin
enum Signal: Int32 {
case HUP = 1
case INT = 2
case QUIT = 3
case ABRT = 6
case KILL = 9
case ALRM = 14
case TERM = 15
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active May 7, 2024 16:35
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on

@JadenGeller
JadenGeller / Unsafe Bit Cast.swift
Last active January 26, 2023 22:09
A Quick Overview of Unsafe Bit Cast
// Let's declare two structs that with different variables and different boolean values:
struct A {
let x = true
}
struct B {
let y = false
}
ACTION
AD_HOC_CODE_SIGNING_ALLOWED
ALTERNATE_GROUP
ALTERNATE_MODE
ALTERNATE_OWNER
ALWAYS_SEARCH_USER_PATHS
ALWAYS_USE_SEPARATE_HEADERMAPS
APPLE_INTERNAL_DEVELOPER_DIR
APPLE_INTERNAL_DIR
APPLE_INTERNAL_DOCUMENTATION_DIR