Skip to content

Instantly share code, notes, and snippets.

View adamstac's full-sized avatar

Adam Stacoviak adamstac

View GitHub Profile
@jamesfinley
jamesfinley / Hi-res Graphic Mixin
Created August 10, 2011 13:51
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 + '_2x.' + $type;
@media (-webkit-min-device-pixel-ratio: 2) {
& {
background-image: url('../images/' + $retina_name);
-webkit-background-size: $width $height;
}
}
@adamstac
adamstac / screen.css
Created August 9, 2011 04:54
Faux equal height columns hack using pure CSS / Sass (with jQuery fallback for IE 6 & 7)
.two-columns {
overflow: hidden;
*zoom: 1;
position: relative;
}
.two-columns .column-one, .two-columns .column-two {
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
@adamstac
adamstac / grid-toggle.js
Created June 3, 2011 15:38
Create, show, and hide grid toggle with jQuery
$(document).ready(function() {
// Create, show, and hide grid toggle
$('body').append('<div id="grid"></div>');
$('body').append('<a href="#" class="toggle-grid"><span class="show">Show Grid</span><span class="hide">Hide Grid</span></a>');
$('a.toggle-grid').toggle(function() {
$('#grid').slideDown('fast');
$('.toggle-grid .hide').show();
$('.toggle-grid .show').hide();
}, function() {
@brendanjerwin
brendanjerwin / writer
Created May 28, 2011 00:45
open iA writer from the command line
#! /bin/bash
open $1 -a /Applications/iA\ Writer.app
@adamstac
adamstac / index.mdown
Created May 9, 2011 08:02
Setting up Apache on OSX Snow Leopard (PHP, Virtual Hosts & .htaccess)

Setting up Apache on OSX Snow Leopard (PHP, Virtual Hosts & .htaccess)

After every change you make to the Apache or PHP config files you will need to restart the Apache web server.

PHP

By default PHP is disabled on OSX, so we'll need to turn that on.

mate /etc/apache2/httpd.conf
@nathansmith
nathansmith / moz-webkit.css
Created March 22, 2011 01:51
Target Firefox and WebKit via hacky CSS.
/*
Read more here:
https://developer.mozilla.org/en/CSS/@-moz-document
For more browser-specific hacks:
http://paulirish.com/2009/browser-specific-css-hacks
*/
@-moz-document url-prefix() {
/* Put your Firefox specific code here. */
@adamstac
adamstac / TODO
Created February 11, 2011 18:50
A Rubyist’s guide to setting up a Mac OS X development environment using Homebrew, RVM, Git and Bundler
* Review this article and add new steps as needed: http://blog.therubymug.com/blog/2010/05/20/the-install-osx.html
@adamstac
adamstac / grid-coordinates-1.1.2-example.sass
Created January 23, 2011 11:48
Sample Sass and CSS output from Grid Coordinates 1.1.3
// Configure grid coordinates
$grid-columns: 24
$grid-width: 30px
$grid-gutter-width: 10px
// Set to true by default. Can be set to false to clip content that overflows a grid block
// $overflow: false
@import grid-coordinates
+grid-coordinates
@adamstac
adamstac / social-signin.css
Created December 14, 2010 19:23
An example of using the sprite helper in Compass
li.twitter-signin {
margin-right: 10px;
}
li.facebook-signin a, li.twitter-signin a {
background: url('/images/btn/social-signin-sprite.png?1292353729') no-repeat;
width: 150px;
height: 22px;
overflow: hidden;
text-indent: -99999px;
width: 150px;
@adamstac
adamstac / styles.rake
Created November 20, 2010 03:40
A set of rake tasks for clearing, compiling and generating stats on your Sass stylesheets (Compass required).
namespace :styles do
# STATS
desc "Generate stats"
task :stats => ["stats:default"]
namespace :stats do
task :default do