Skip to content

Instantly share code, notes, and snippets.

View adamstac's full-sized avatar

Adam Stacoviak adamstac

View GitHub Profile
@jcroft
jcroft / layout.sass
Created March 1, 2012 04:51
How easy responsive design can be with Sass
#content-wrapper
+container
#about
// Default (smallest screens)
+column(100%)
background-color: #ccc
// Respond to other screen widths
@adamstac
adamstac / disable-time-machine-mobilebackup.mdown
Created November 9, 2011 01:53
Disable Time Machine's MobileBackup

sudo tmutil disablelocal - Turn off local Time Machine snapshots and trigger automatic cleanup of accumulated local snapshot data. Requires root privileges.

sudo tmutil enablelocal - Turn on local Time Machine snapshots. Requires root privileges.

@codingdesigner
codingdesigner / gist:1259587
Created October 3, 2011 16:53
convert px to em in sass
// convert px to em in sass.
// $target-px: the value you want to convert
// $context: the current pixel value of 1em
@function calc-em($target-px, $context) {
@return ($target-px / $context) * 1em;
}
@jhummel
jhummel / gist:1259556
Created October 3, 2011 16:42
Converting Units
@function convert($start, $ratio: 10px/1em) {
@return $start/$ratio;
}
/* image is 50px tall */
convert(image-height('path/to/image.jpg')); => 5em;
@chriseppstein
chriseppstein / injecting_scope.css
Created October 1, 2011 18:56
Cool things you may not know you could do with the & in sass
.tab {
.generatedcontent & {
&:before, &:after {
background-color: red;
}
.before, .after {
display: none;
}
}
}

Disable:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

Enable:

sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.metadata.mds.plist

@adamstac
adamstac / _sass-retina.sass
Created September 17, 2011 14:07 — forked from jamesfinley/Hi-res Graphic Mixin
A simple way to include both low-res and hi-res graphics for iOS/Desktop/etc.
@mixin hires-graphic($file, $type, $width, $height)
$file-name: $file + "." + $type
$retina-name: $file + "-retina." + $type
@media (-webkit-min-device-pixel-ratio: 2)
&
background-image: image-url($retina-name)
-webkit-background-size: $width $height
@adamstac
adamstac / ios-media-queries.sass
Created September 17, 2011 13:58
iOS Media Queries for iPhone/iPod, iPad & Retina and Non-Retina Devices
.ipad-only,
.iphone-only,
.retina-only,
.non-retina-only,
.retina-iphone-only,
.non-retina-iphone-only
display: none
// iPad Only
@media only screen and (device-width: 768px)
@mixin inset-text($color, $amount: 0.7) {
color: $color;
@if lightness($color) < 50% { @include single-text-shadow(rgba(white, $amount), 1px, 1px, 1px); }
@else { @include single-text-shadow(rgba(black, $amount), -1px, -1px, 1px); }
}
@chriseppstein
chriseppstein / readme.md
Created August 31, 2011 21:57 — forked from mislav/Gemfile
How to integrate Compass with Rails 3.1 asset pipeline

This gist is no longer valid. Please see Compass-Rails for instructions on how to install.