Skip to content

Instantly share code, notes, and snippets.

View witekbobrowski's full-sized avatar
🥽
#if os(visionOS)

Witek Bobrowski witekbobrowski

🥽
#if os(visionOS)
View GitHub Profile
@Flaque
Flaque / howdy.png
Last active January 31, 2023 18:54
howdy.png
@mathdroid
mathdroid / up.gif
Last active June 10, 2022 09:04
Up
up.gif
@mathdroid
mathdroid / you.gif
Last active June 10, 2022 09:05
You
you.gif
@mathdroid
mathdroid / give.gif
Last active June 10, 2022 09:05
Give
give.gif
@mathdroid
mathdroid / gonna.gif
Last active June 10, 2022 09:05
Gonna
gonna.gif
@mathdroid
mathdroid / never.gif
Last active February 11, 2024 22:25
Never
never.gif
@fay59
fay59 / Quirks of C.md
Last active September 4, 2024 23:07
Quirks of C

Here's a list of mildly interesting things about the C language that I learned mostly by consuming Clang's ASTs. Although surprises are getting sparser, I might continue to update this document over time.

There are many more mildly interesting features of C++, but the language is literally known for being weird, whereas C is usually considered smaller and simpler, so this is (almost) only about C.

1. Combined type and variable/field declaration, inside a struct scope [https://godbolt.org/g/Rh94Go]

struct foo {
   struct bar {
 int x;
@lattner
lattner / async_swift_proposal.md
Last active October 29, 2024 18:53 — forked from oleganza/async_swift_proposal.md
Concrete proposal for async semantics in Swift

Async/Await for Swift

Introduction

Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.

This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.

@mwaterfall
mwaterfall / StringExtensionHTML.swift
Last active May 27, 2024 04:36
Decoding HTML Entities in Swift
// Very slightly adapted from http://stackoverflow.com/a/30141700/106244
// 99.99% Credit to Martin R!
// Mapping from XML/HTML character entity reference to character
// From http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references
private let characterEntities : [String: Character] = [
// XML predefined entities:
""" : "\"",
"&" : "&",