Skip to content

Instantly share code, notes, and snippets.

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
@samuelbeek
samuelbeek / playground.swift
Created November 16, 2016 16:21
Enums with Associated Values that conform to NSCoding
// Inspiration: https://gist.github.com/NinoScript/47819cf6fe36d6845aee32d19b423e9b
//: Playground - noun: a place where people can play
import UIKit
enum SavableEnum {
case simpleCase
case associatedValue(String)
case anotherAssociated(Int)
}
extension SavableEnum {
/*
Erica Sadun, http://ericasadun.com
Cross Platform Defines
Apple Platforms Only
Will update to #if canImport() when available
*/
@verebes1
verebes1 / RealmCascadeDeletion.swift
Last active March 6, 2024 19:47
Realm Cascade Deletion in Swift
import RealmSwift
import Realm
protocol CascadeDeleting {
func delete<S: Sequence>(_ objects: S, cascading: Bool) where S.Iterator.Element: Object
func delete<Entity: Object>(_ entity: Entity, cascading: Bool)
}
extension Realm: CascadeDeleting {
func delete<S: Sequence>(_ objects: S, cascading: Bool) where S.Iterator.Element: Object {
@fewlinesofcode
fewlinesofcode / AugmentedIntevalTree.swift
Last active February 15, 2023 14:18
Augmented Interval Search tree
//
// Created by @fewlinesofcode on 9/6/18.
// Copyright (c) 2018 Oleksandr Glagoliev. All rights reserved.
//
public class Interval<T: Comparable> {
private (set) var start: T
private (set) var end: T
var max: T

Set Up a Haskell Development Environment in Three Steps

a Haskell Development Environment consist in a compiler (ghc), a language server (hls), a building tool (cabal or stack), and an editor compatible with the language server protocol.

The best way to have a coherent installation of these components is with the ghcup tool.

  • Step 1: Install GHCup. You'll be prompted to install some tools. Say yes to hls. Do not install stack yet (see below).
  • Step 2: Install vscode
  • Step 3: Open vscode and install the haskell extension either using the extension panel or pressing CTRL+P and ext install haskell.haskell.