Skip to content

Instantly share code, notes, and snippets.

View mathewsanders's full-sized avatar

Mathew Sanders mathewsanders

View GitHub Profile
import UIKit
protocol SegueHandlerType {
typealias SegueIdentifier: RawRepresentable
}
extension SegueHandlerType where
Self: UIViewController,
SegueIdentifier.RawValue == String
{
<!doctype html>
<html lang="en" class="breakpoint-medium">
<head>
<meta charset="utf-8">
<title>Metaquery Boilerplate</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<meta name="breakpoint" content="small" media="(max-width: 480px)">
<meta name="breakpoint" content="medium" media="(min-width: 481px) and (768px)">
@daaain
daaain / prototype.html
Last active August 13, 2016 18:21
Quick prototyping boilerplate: React + Babel + Foundation + Sheetrock. See it running here: http://www.danieldemmel.me/in-browser-prototype-boilerplate/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Prototype</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/foundation/6.2.3/foundation-flex.css">
<script src="https://fb.me/react-with-addons-15.3.0.js" type="text/javascript"></script>
<script src="https://fb.me/react-dom-15.3.0.js" type="text/javascript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.24/browser.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/chriszarate/sheetrock/master/dist/sheetrock.min.js"></script>
@MrAlek
MrAlek / HairlineView
Last active December 8, 2016 16:55
A simple, @IBDesignable view which draws a pixel wide hairline of chosen color in chosen direction
import Foundation
import UIKit
import QuartzCore
enum HairlineDirection: Int {
case Left, Right, Top, Bottom, None
init(point: CGPoint) {
if point.x < 0 {
self = Left
anonymous
anonymous / definitions.units
Created April 8, 2015 06:26
#
# This file is the units database for use with GNU units, a units conversion
# program by Adrian Mariano adrianm@gnu.org
#
# March 2014 Version 2.10
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006
# 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014
# Free Software Foundation, Inc
#
@aparrish
aparrish / tarot_stuff.md
Created October 15, 2016 13:56
some notes and cool stuff for digital tarot/generative text
@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):
@alonecuzzo
alonecuzzo / ithunk.swift
Created February 2, 2016 20:14
Thunk Presentation
import UIKit
//POP is great, but there are some gotchas when dealing with protocols that have a Self requirement.
// Self
protocol OwlType {
func hootWithOwlType(owl: Self)
}
class GreatHornedOwl: OwlType {
@Revolucent
Revolucent / BitwiseOptions.swift
Last active September 22, 2018 12:46
BitwiseOptions implementation for Swift
//
// BitwiseOptions.swift
//
// Created by Gregory Higley on 11/24/14.
// Copyright (c) 2014 Prosumma LLC. All rights reserved.
//
// 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
@FlorianMielke
FlorianMielke / FMInfoPanelViewController.h
Created December 6, 2011 06:58
Info Panel attached to a UIScrollViewIndicator like in the Path 2 app. More information: http://cl.ly/CN2p
//
// FMInfoPanelViewController.h
// Created by Florian Mielke (@FlorianMielke) on 06.12.11.
//
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
@interface FMInfoPanelViewController : UIViewController <UIScrollViewDelegate>