Skip to content

Instantly share code, notes, and snippets.

View kdawgwilk's full-sized avatar
🐘
Technical Co-founder @ AskElephant

Kaden Wilkinson kdawgwilk

🐘
Technical Co-founder @ AskElephant
View GitHub Profile
@andyyhope
andyyhope / SwiftEvolution_EnumCaseCountFunctionality_AndyyHope.md
Last active March 12, 2020 13:05
Swift Evolution - Enum Case Count Functionality

Swift Evolution Proposal

Author: Andyy Hope

Enum Values() Functionality (Update)

It has been brought to my attention that there was more use for the unintended values() functionality that I had outline in my "Other Languages" Java example below.

On the Swift Evolution mailing list, one developer outlined their requirement to loop through an array of enum case values to add different states to objects.

Another example where a values array would be useful if the developer wants to do something different for each different case, such as setting an image on a UIButton subclass for each different UIControlState

@codeasaurus
codeasaurus / README.md
Last active December 30, 2015 00:57
Utility Wrapper for managing the unruly javascript interval timer

Synopsis

Anyone that's ever tried to wrangle the native javascript interval timer has thought, "Why does this have to be so ugly and unmanageable?" MorphInterval provides a simple but flexible solution to managing javascript interval timers.

Code Example

This example shows a simple interval that calls the doSomething() function once every 60 seconds

var thisObj = this;

this.refreshInterval = new window.MorphInterval(

/*
ericasadun.com
Super-basic priority-less layout utilities
*/
#if os(iOS)
import UIKit
#else
@burnsra
burnsra / pre-commit
Created March 3, 2016 23:40
Reserved word pre-commit hook
# Instructions:
# Put this file into your ~/.git-templates/hooks folder and set as executable (chmod +x pre-commit)
# If you want to skip the hook just add --no-verify as follows: git commit --no-verify
# ---------------------------------------------
#!/bin/sh
RESERVED_LIST="alert(\|console.log(\|USERNAME"
@JaviSoto
JaviSoto / SampleViewController.swift
Last active January 23, 2020 09:20
Init based Storyboard View Controller Instantiation
final class SampleViewController: StoryboardBackedViewController {
// Unfortunately this must be an IUO var, so that we can set the value after super.init
private var member: Foo!
// Proper dependency injection in a storyboard backed VC!
init(foo: Foo) {
super.init(storyboardIdentifier: "SampleViewControllerIdentifier")
// We have to set the members *after* calling super.init, since it changes the instance of `self`.
self.member = foo
@wess
wess / Makefile
Last active February 24, 2018 03:16
Makefile for Vapor using Watchman to restart on change.
all: build run
clean:
@vapor clean
build:
@vapor build
run:
@harlanhaskins
harlanhaskins / trace.swift
Created October 6, 2016 17:50
Pure Swift stack trace
struct StackFrame {
let symbol: String
let file: String
let address: UInt64
let symbolAddress: UInt64
var demangledSymbol: String {
return _stdlib_demangleName(symbol)
}
}
@skreutzberger
skreutzberger / sen_swiftbe_dev.md
Last active December 2, 2019 15:07
Senior Swift Backend Developer (Freelance, 100% Remote)

Senior Swift Backend Developer (Freelance, 100% Remote)

I am searching experienced backend developers (freelance, remote) with a ❤️ for Swift for Moonshot Energy, the world’s first AI-driven renewable energy company located in Germany. Moonshot Energy is financially backed by Innogy SE, one of Europe's largest energy providers.

At Moonshot you will play a major role in making the world greener, the future brighter and energy distribution smarter by using latest technologies like server-side Swift, microservices, artificial intelligence 🤖 and machine learning and new interfaces like chatbots and dialog-based systems (NLP).

Since our team is working on European timezones it would be good if you would live in the EU or if you are an early bird living in US-East 🇪🇺🇺🇸.

Your job:

  • build our internal microservices
@harlanhaskins
harlanhaskins / Lexer.swift
Last active March 4, 2023 20:10
Building a Compiler in Swift with LLVM, Part 1: Introduction and the Lexer
#if os(macOS)
import Darwin
#elseif os(Linux)
import Glibc
#endif
enum BinaryOperator: Character {
case plus = "+"
case minus = "-"
case times = "*"
@inamiy
inamiy / SwiftElmFrameworkList.md
Last active March 11, 2024 10:20
React & Elm inspired frameworks in Swift