Skip to content

Instantly share code, notes, and snippets.

View adamstac's full-sized avatar

Adam Stacoviak adamstac

View GitHub Profile
@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
@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 / 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() {
@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;
@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;
}
}
@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.

@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); }
}
@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)
@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

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