Skip to content

Instantly share code, notes, and snippets.

View BigAB's full-sized avatar
🇨🇦
JavaScript Loving Canadian

Adam L Barrett BigAB

🇨🇦
JavaScript Loving Canadian
View GitHub Profile
@BigAB
BigAB / gist:501124
Created July 30, 2010 19:01 — forked from remy/gist:330318
Clunky Edit for IE
/**
* Add this script to the end of your document that use <input autofocus type="text" />
* or <input type="text" placeholder="username" /> and it'll plug support for browser
* without these attributes
* Minified version at the bottom
*/
(function () {
function each(list, fn) {
var l = list.length;
@BigAB
BigAB / dabblet.css
Last active July 12, 2016 01:32
Body 100% height when content has margin problem
/**
* Body 100% height when content has margin problem
*/
html, body {
position: relative;
min-height: 100%;
background: yellow;
margin: 0;
padding: 0.1px; /* needed to prevent the margin problem */
box-sizing: border-box;
@BigAB
BigAB / dabblet.css
Created March 2, 2012 06:30
Cool Boxes
/**
* Cool Boxes
*/
body {
background: #fff;
}
.pic {
display: inline-block;
padding: 3.5em 1em 0.5em 1em;
margin: 0.3em;
/**
* Cool boxes
*/
body {
background: #fff;
}
.pic {
display: block;
padding: 3.5em 1em 0.5em 1em;
margin: 0.3em;
@BigAB
BigAB / dabblet.css
Created August 20, 2012 17:56
New syntax of Flexible box layout module (flexbox)
/**
* New syntax of Flexible box layout module (flexbox)
* Send in the bugs
*/
.flexbox {
display: flex; /* Further values: -webkit-inline-flex, then it's an inline element */
flex-direction: row; /* Alignment (in this case from left to right). Further values: column (top to bottom), row-reverse (right to left), column-reverse (bottom to top) */
/* -webkit-flex-flow: row; */ /* Same as -webkit-flex-direction, but it's a shorthand for both -webkit-flex-direction und -webkit-flex-wrap (see .flexbox6) */
height: 100px;
background: lightgrey;
@BigAB
BigAB / dabblet.css
Created November 22, 2012 23:04
Body With Padding
/**
* Body With Padding
* Can't do body with padding (to solve earlier problem)
* has to be a inner wrapper div. Change '.demo' to
* 'body' to see what I mean.
*/
html, body {
position: relative;
height: 100%;
margin: 0;
@BigAB
BigAB / dabblet.css
Created November 22, 2012 23:37
Centered but up a bit
/**
* Centered but up a bit
* For like pages that are just sentences and such
*/
html, body {
position: relative;
height: 100%;
margin: 0;
padding: 0;
border: 0 none;
@BigAB
BigAB / dabblet.css
Created November 27, 2012 22:25
Touch screen inline column scroll
/**
* Touch screen inline column scroll
*/
.container {
position: absolute;
top: 0; bottom: 0; left: 0; right: 0;
font-size: 63.5%;
word-spacing: -0.43em;
letter-spacing: -0.31em;
@BigAB
BigAB / dabblet.css
Created December 5, 2012 04:54
16:9 Asect ratio responsive
/**
* 16:9 Asect ratio responsive
* I want the "view screen" to have a somewhat standard
* aspect ration regardless of device/window size
*/
:root, html, body {
font-size: 16px;
padding: 0;
margin: 0;
border: 0;
@BigAB
BigAB / README.md
Last active December 16, 2015 21:09
A category for UIView that takes the tedium out of manipulating frames (and bounds)

A category for UIView that takes the tedium out of manipulating frames (and bounds)

Plucked from this project http://nfarina.com/post/29883229869/callout-view

Use it like now you can just go

myView$.height = 44.0f;
myView.$y = (myView.$y - myView.$height);

or whatever.