Skip to content

Instantly share code, notes, and snippets.

View BryanJBryce's full-sized avatar
🐐

Bryan Bryce BryanJBryce

🐐
View GitHub Profile
@jslinker
jslinker / SampleFlowLayout.swift
Created January 14, 2019 16:45
UICollectionViewControllerFlowLayout boiler plate. Just fill out the `prepare` function with you layout logic and the rest just works.
class SampleFlowLayout: UICollectionViewLayout {
override func prepare() {
guard let collectionView = self.collectionView else { return }
self.itemAttributes.removeAllObjects()
// go through every section..
for section in 0..<collectionView.numberOfSections {
let numberOfItems = collectionView.numberOfItems(inSection: section)
import Foundation
import Actor
import MessageRouter
public final class Core<State, Event, Command> {
public typealias CommandProcessor = (Core<State, Event, Command>, Command) -> Void
public typealias EventHandler = (State, Event) -> CoreUpdate<State, Command>
public let stateChanged = MessageRouter<State>()
@rob-brown
rob-brown / Actor.swift
Last active March 8, 2018 14:15
Elixir-inspired concurrency primitives
//
// Actor.Swift
//
// Copyright (c) 2017 Robert Brown
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@patpohler
patpohler / Big List of Real Estate APIs.md
Last active November 14, 2024 00:20
Evolving list of Real Estate APIs by Category

Big List of Real Estate APIs

Listings / Property Data

####Rets Rabbit http://www.retsrabbit.com

Rets Rabbit removes the nightmare of importing thousands of real estate listings and photos from RETS or ListHub and gives you an easy to use import and Web API server so you can focus on building your listing search powered website or app.

@mcmurrym
mcmurrym / MirrorDebugDecscription.swift
Last active October 3, 2024 14:09
A default protocol implementation for CustomDebugStringConvertible that uses Mirror for introspection
public extension CustomDebugStringConvertible {
var debugDescription: String {
return debugDescription()
}
func debugDescription(_ indentationLevel: Int = 0, includeType: Bool = true) -> String {
let indentString = (0..<indentationLevel).reduce("") { tabs, _ in tabs + "\t" }
var s: String
// Playground - noun: a place where people can play
import UIKit
import CoreGraphics
public enum Result<T> {
case Success(@autoclosure () -> T)
case Failure(String)
init(_ value:T) {
@d-oliveros
d-oliveros / names.json
Created January 9, 2015 23:56
Names List
["aabraham","aaccf","aadolf","aage","aalders","aali","aalis","aaliyah","aamina","aaminah","aamu","aapeli","aapo","aaren","aarika","aarne","aaron","aarón","aart","aartjan","aasen","aatami","aatos","aatto","aatu","aawiya","ab","abacus","abadines","abagael","abagail","abahri","abasolo","abazari","abba","abbai","abbán","abbas","abbatant","abbate","abbe","abbes","abbey","abbi","abbie","abbot","abbott","abby","abbye","abd-al-aziz","abd-al-hamid","abd-al-kader","abd-al-karim","abd-al-latif","abd-al-malik","abd-al-qadir","abd-al-rahman","abd-al-rashid","abd-allah","abdalla","abdallah","abdechahid","abdel","abdel-az","abdel-ma","abdel-ra","abdel-sa","abdelazi","abdelaziz","abdelbassir","abdeldjalil","abdelfattah","abdelghafour","abdelghani","abdelhadi","abdelhak","abdelhakim","abdelkader","abdelkarim","abdellah","abdellatif","abdelmad","abdelmadjid","abdelmalik","abdelmoumen","abdelrah","abdelran","abdelsal","abdenour","abderrahim","abderrao","abderraz","abderrazek","abdessalem","abdessatar","abdi","abdiou","abdo","ab
@kristopherjohnson
kristopherjohnson / KeyboardNotification.swift
Last active October 6, 2023 14:45
Swift convenience wrapper for the userInfo values associated with a UIKeyboard notification
import UIKit
/// Wrapper for the NSNotification userInfo values associated with a keyboard notification.
///
/// It provides properties that retrieve userInfo dictionary values with these keys:
///
/// - UIKeyboardFrameBeginUserInfoKey
/// - UIKeyboardFrameEndUserInfoKey
/// - UIKeyboardAnimationDurationUserInfoKey
/// - UIKeyboardAnimationCurveUserInfoKey
@JamesDullaghan
JamesDullaghan / Bulletproof_foods.md
Created June 15, 2013 22:41
Dave Aspreys bulletproof diet food list

How many servings should I eat per day?

  • Fruit = 1-2 servings
  • Animal protein = 4 - 6 servings
  • Healthy fats = 5 - 9 servings
  • Healthy vegetables = 6 - 11 servings

How should I allocate my calories per day?

  • Healthy fats = 50%
@bwhiteley
bwhiteley / wwdc_alert.sh
Last active December 16, 2015 14:49
My WWDC ticket alert system. Run in screen on linux.
#!/bin/bash
theSite="https://developer.apple.com/wwdc/"
foo=$(curl $theSite)
echo $foo
oldFile=$(date +"%Y-%m-%d-%H_%M_%S").start
echo "$foo" > $oldFile
while true; do