This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gistPrefix = 'https://gist.github.com/', | |
// Cache document.write so that it can be restored once all Gists have been | |
// embedded. | |
cachedWrite = document.write, | |
body = $('body'), | |
// Map each p.gist to an object that contains the paragraph to be replaced | |
// and the Gist's identifier. | |
gists = $('a.gist').map(function(n, a) { | |
a = $(a); | |
var href = a.attr('href'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
@mixin item-generator ($n, $i: 1) { | |
@while $i <= $n { | |
.item--block--#{$i} { | |
@extend %item; | |
.item { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.10) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
@mixin item-generator ($n, $i: 1) { | |
@while $i <= $n { | |
.item--block--#{$i} { | |
@extend .item; | |
.item { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0.rc.1) | |
// ---- | |
$text-base: ( | |
font-size: 1.0rem, | |
line-height: 1.8rem, | |
font-weight: normal, | |
text-color: #333 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---- | |
// Sass (v3.3.14) | |
// Compass (v1.0.0.rc.1) | |
// ---- | |
// | |
// Code from http://thesassway.com/intermediate/a-standard-module-definition-for-sass | |
// | |
// # Thoughts | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retina-ready version of this StackOverflow answer | |
// http://stackoverflow.com/a/6672628/123781 | |
#import <UIKit/UIKit.h> | |
@interface UIImage (NegativeImage) | |
- (UIImage *)negativeImage; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <UIKit/UIKit.h> | |
typedef BOOL (^TestViewCallback)(UIView*); | |
@interface UIView (FindSubview) | |
- (UIView*) findSubviewWithTest:(TestViewCallback)callback; | |
- (BOOL) hitByGesture:(UIGestureRecognizer*)recognizer; | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://github.com/smileyborg/TableViewCellWithAutoLayout/blob/master/TableViewCellWithAutoLayout/TableViewController/RJTableViewController.m | |
// http://stackoverflow.com/a/18746930/123781 | |
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ | |
// This project has only one cell identifier, but if you are have more than one, this is the time | |
// to figure out which reuse identifier should be used for the cell at this index path. | |
NSString *reuseIdentifier = CellIdentifier; | |
// Use the dictionary of offscreen cells to get a cell for the reuse identifier, creating a cell and storing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example — say you had some content for a scrollView. | |
// Create a contentView and add each row as a subview. | |
// Then simply call the category method on the subviews array to layout | |
// the subviews as rows. | |
// | |
// This requires that the contentView be setup via autolayout to | |
// properly pin to the scrollView. | |
[contentView addSubviews:@[ | |
viewA, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void logFonts(UIView* view); | |
void logColors(UIView* view); |