Skip to content

Instantly share code, notes, and snippets.

@zakdances
zakdances / Bootstrap-Lite
Last active August 29, 2015 14:07
An extremely light-weight version of Bootstrap that can be copy-pasted into projects to eliminate a dependency.
$font-size-base: 14px !default;
$line-height-base: 1.428571429 !default; // 20/14
$font-family-sans-serif: "Helvetica Neue", Helvetica, Arial, sans-serif !default;
$font-family-serif: Georgia, "Times New Roman", Times, serif !default;
//** Default monospace fonts for `<code>`, `<kbd>`, and `<pre>`.
$font-family-monospace: Menlo, Monaco, Consolas, "Courier New", monospace !default;
$font-family-base: $font-family-sans-serif !default;
//** Background color for `<body>`.
$body-bg: #fff !default;
@zakdances
zakdances / gist:5158875
Created March 14, 2013 04:46
Pass a selector of elements you want to scrub clean of PyJade bugs.
fixPyJadeBugs = (sels) ->
sels.each () ->
element = $(this)
fix = (attrib) ->
value = attrib.value.replace /_/g, ' '
if value[0] == '"' and ( value[value.length-1] == '"' or ( value[value.length-2] == '"' and value[value.length-1] == '/' ) )
max = if value[value.length-1] == '/' then value.length-2 else value.length-1
element.attr attrib.name, value.substring('1',max)
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];
- (CGSize)sizeThatFits:(CGSize)size
{
NSMutableArray *bottoms = [NSMutableArray array];
for (UIView *view in self.subviews) {
NSNumber *bottom = [NSNumber numberWithFloat:view.center.y + CGRectGetMidY(view.bounds)];
[bottoms addObject:bottom];