Skip to content

Instantly share code, notes, and snippets.

@danielctull
danielctull / UICollectionViewFlowLayout+DelegateAccess.swift
Last active May 16, 2019 14:00
Wraps the six UICollectionViewFlowLayout delegate methods and their equivalent properties using functional programming techniques, so that values are easier to retrieve. Full details at: http://danieltull.co.uk/blog/2018/04/13/simplifying-uicollectionviewflowlayout-delegate-method-usage-with-functional-programming/
extension UICollectionViewFlowLayout {
typealias DelegateMethod<Key, Value> = ((UICollectionView, UICollectionViewLayout, Key) -> Value)
private var delegate: UICollectionViewDelegateFlowLayout? {
return collectionView?.delegate as? UICollectionViewDelegateFlowLayout
}
func retrieve<Key, Value>(
// Scanner+Swift.swift
//
// A set of idiomatic swift extensions to Scanner
//
// Based on https://gist.github.com/natecook1000/59bb0c9117b555f5d40d
// Converted to Swift 3
//
import Foundation
@krzysztofzablocki
krzysztofzablocki / gist:8913213
Last active January 25, 2018 22:06
Diet setup for cutting, paste into calca.io and modify stats.
# For training rest 5 min on compounds, 3-5 minutes on smaller ones
# Training A (first set to failure, second set -10% weight + 1 rep):
# Deadlift - 2x4-5
# Overhead Press - 1x6-8
# Weighted Chinup - 2x4-6
# Chest-Supported Rows - 2x6-8
# Close-grip chinup - 1x6-10
# Training B (first set to failure, second set -10% weight + 1 rep):
@bomberstudios
bomberstudios / sketch-plugins.md
Last active February 26, 2024 07:02
A list of Sketch plugins hosted at GitHub, in no particular order.
@marcboquet
marcboquet / Variables.plist
Created July 16, 2013 15:50
Soulver variables useful for iOS design. Based on ‏@marcedwards post: http://bjango.com/articles/soulver/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>SKVariables</key>
<array>
<dict>
<key>enabled</key>
<true/>
<key>name</key>
@dypsilon
dypsilon / frontendDevlopmentBookmarks.md
Last active April 30, 2024 04:42
A badass list of frontend development resources I collected over time.
@ole
ole / update_storyboard_strings.sh
Last active April 4, 2022 06:11
Automatically extract translatable strings from Xcode storyboards and update .strings files. Original version by MacRumors forum user mikezang (http://forums.macrumors.com/showpost.php?p=16060008&postcount=4). Slightly updated by Ole Begemann. NOTE: this Gist moved to a regular repo at https://github.com/ole/Storyboard-Strings-Extraction.
# (File moved to https://github.com/ole/Storyboard-Strings-Extraction)
@malarkey
malarkey / Three Wise Monkeys.md
Created December 2, 2012 14:26
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?

@malarkey
malarkey / Contract Killer 3.md
Last active April 16, 2024 21:44
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008

…………………………

@addyosmani
addyosmani / visibly.js
Created August 3, 2011 12:44
Cross-browser Page Visibility API polyfill
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,