Skip to content

Instantly share code, notes, and snippets.

View cdzombak's full-sized avatar

Chris Dzombak cdzombak

View GitHub Profile
@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}/])
@max-mapper
max-mapper / readme.md
Created September 28, 2011 02:01
SLEEP - syncable.org

Your API does REST, but can it SLEEP?

SLEEP (Syncable Lightweight Event Emitting Persistence) is an emerging standard for distributed data sync using HTTP and JSON. A generalized version of CouchDB's much lauded built-in replication, SLEEP extends the REST architecture to define a way in which databases can offer syncable JSON APIs that foster open data innovation by allowing developers to replicate entire databases over the net.


SLEEP comes from the Apache CouchDB project which is now widely known for it's multi-master streaming HTTP + JSON replication. This is possible in part because of the CouchDB _changes feed, which is a particular API that lets you see if there have been any changes made to the database since last time you synchronized. CouchDB can efficiently implement the _changes feed because of one subtle difference between it and most other databases: it stores a history of all changes that happen to the database, including deletes.

If you synchronize data from a remote source and then the

@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:

@andrewsardone
andrewsardone / gist:1935008
Created February 28, 2012 20:46
I'm finally making two-stage object creation work for me ;-)
#import <SenTestingKit/SenTestingKit.h>
#import "OCMock.h"
#import "NLPageControlScrollViewHelper.h"
#pragma mark - Tests
@interface NLPageControlScrollViewHelperTests : SenTestCase
@end
@erikh
erikh / hack.sh
Created March 31, 2012 07:02 — forked from DAddYE/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jessedearing
jessedearing / gist:2351836
Created April 10, 2012 14:44 — forked from twoism-dev/gist:1183437
Create self-signed SSL certificate for Nginx
#!/bin/bash
echo "Generating an SSL private key to sign your certificate..."
openssl genrsa -des3 -out myssl.key 1024
echo "Generating a Certificate Signing Request..."
openssl req -new -key myssl.key -out myssl.csr
echo "Removing passphrase from key (for nginx)..."
cp myssl.key myssl.key.org
openssl rsa -in myssl.key.org -out myssl.key