Skip to content

Instantly share code, notes, and snippets.

View meub's full-sized avatar

Alex Meub meub

View GitHub Profile
@meub
meub / gist:6314276
Created August 23, 2013 00:19
CSS Transform, with Transform Origin
.rotate {
-webkit-transform: rotate(90deg);
-webkit-transform-origin: left top;
-moz-transform: rotate(90deg);
-moz-transform-origin: left top;
-ms-transform: rotate(90deg);
-ms-transform-origin: left top;
-o-transform: rotate(90deg);
-o-transform-origin: left top;
@meub
meub / gist:6201298
Created August 10, 2013 17:28
Absolute Centering
/* Must have a declared height */
.Absolute-Center {
margin: auto;
position: absolute;
top: 0; left: 0; bottom: 0; right: 0;
}
@meub
meub / gist:6091400
Created July 26, 2013 19:04
Prevent parseJSON from barfing on line breaks.
function parse(text) {
text = str_replace("\r\n", "\n", text);
text = str_replace("\r", "\n", text);
text = str_replace("\n", "\\n", text);
return text;
}
@meub
meub / gist:6050618
Last active December 20, 2015 01:39
Vendor prefixes
/*Border Radius*/
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
-ms-border-radius: 4px;
-o-border-radius: 4px;
border-radius: 4px;
/*Box Shadow*/
@meub
meub / gist:5936187
Created July 5, 2013 18:02
Wrap around a fixed element
div {
border:4px solid black;
height:100px;
position:fixed;
left:250px;
right: 0;
}
A fixed position happens relative to the viewport, so that the positioning properties left, right, top, and bottom, as well as width and height will position and size the element based on the size and boundaries of the viewport.
@meub
meub / gist:5864429
Created June 26, 2013 02:58
Semantic Div with Anchor
.container{
width:200px;
height:200px;
background-color:black;
color:white;
/*Important:*/
position:relative;
}
/*Important:*/
@meub
meub / gist:5828616
Last active December 18, 2015 18:49
Mac Setup ProTips™

##Mac Setup

####1. Disable Mouse acceleration permanently (must reboot)

defaults write .GlobalPreferences com.apple.mouse.scaling -1

####2. Install TotalTerminal Run this command to fix duplicate terminal windows:

defaults write com.apple.Terminal TotalTerminalCloseWindowsOnStart -bool YES

@meub
meub / gist:5818904
Created June 19, 2013 23:03
Sticky Footer CSS
html {
position: relative;
min-height: 100%;
}
body {
margin: 0 0 100px; /* bottom = footer height */
}
.footer {
position: absolute;
left: 0;
@meub
meub / gist:5807911
Created June 18, 2013 18:21
Cross Browser Inline Block CSS
/* Inline Block X-Browser Hack */
display:-moz-inline-stack;
display:inline-block;
zoom:1;
*display:inline;