Skip to content

Instantly share code, notes, and snippets.

//
// DUXClientsManager.h
//
//
// Created by Kevin Vitale on 3/25/14.
//
//
@class RACSignal;
#!/usr/bin/env python
#
# git-flip-flop: checks out two or more commits in a periodic cycle
#
# Save on your $PATH as git-flip-flop
#
# EXAMPLES
#
# Check out abc1234, then def5678, then abc1234, etc, with
# the default 2s between each checkout
@jmont
jmont / curriedfuncs.m
Last active August 29, 2015 14:02
Curried Functions in Swift
// Curried Functions in Swift
// Juan C. Montemayor (@norsemelon)
// Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l
// Syntax: func name (x1: t1)(x2: t2) -> t { ... }
// Note: it has a paren pair for every variable, as opposed to `(x1: t1, x2: t2)`
func addTwoNumbers(a: Int)(b: Int) -> Int {
return a + b
}
@mattbischoff
mattbischoff / LCKIndexedFetchedResultsController.h
Last active August 29, 2015 14:10
LCKIndexedFetchedResultsController is a NSFetchedResultsController subclass that attempts to solve the problem of sorting a fetched collection into correctly alphabetized sections for every locale. It does things like making sure that the `#` character shows up at the bottom instead of the top of the section index titles.
//
// LCKIndexedFetchedResultsController.h
// Quotebook
//
// Created by Andrew Harrison on 7/26/14.
// Copyright (c) 2014 Lickability. All rights reserved.
//
@import CoreData;
@andyfowler
andyfowler / mixins.css
Created November 16, 2010 17:50
Used in less.js
/* ===================================== */
/* = Some less.js mixins from Nutshell = */
/* ===================================== */
.rounded-corners (@radius: 5px) {
border-radius: @radius;
-moz-border-radius: @radius;
-webkit-border-radius: @radius;
}
.drop-shadow (@x:0, @y:1px, @feather:1px, @color:#fff) {
# need to fix a corrupted repo because I have a local branch I need to recover
# first, backup the corrupted git repo
# get a fresh clone
$ git clone git://mydomain.local/awesomerepo.git; cd awesomerepo
$ mv .git/objects/pack/*.pack /tmp/.
$ git unpack-objects < /tmp/*.pack # unpack all the git objects.
# you need to move the pack file out of the
# git repo. See git-unpack-objects's man page:
@sjl
sjl / gist:1118817
Created August 1, 2011 19:26
OS X Text Editor Waves

Pre- OS X

  • BBEdit
  • Vim
  • Emacs

2003/2004

  • TextMate
  • SubEthaEdit
anonymous
anonymous / git-walk.rb
Created September 13, 2011 18:31
#!/usr/bin/env ruby
# Walks up and down revisions in a git repo.
# Usage:
# git walk next
# git walk prev
case ARGV[0]
when "next"
rev_list = `git rev-list --children --all`
refs = rev_list.scan(/[a-z0-9]{40}(?= )/)
refs.unshift(rev_list[/[a-z0-9]{40}/])
@jonsterling
jonsterling / gist:1541947
Created December 30, 2011 23:09
Configuring UITableViews with C99 array initialization!
// Define your table view's sections
typedef enum {
kTitleSection = 0,
kGoalSection,
kNumberOfSections
} NESTemplateEditTableSections;
// Make configuration arrays indexed against table sections.
// It's safe to reorder the original enum!
static NSString * const kCellIdentifiers[kNumberOfSections] = {
@andrewsardone
andrewsardone / gist:1827605
Created February 14, 2012 15:36
Creating a custom UITableViewCell

[Apple's Documentation][appledoc1]

Option 1: Programmatic Setup and Subview Manipulation

No UITableViewCell subclass

Add subviews to a cell's contentView, or tweak properties of a certain cell style's subviews.

Example: