Skip to content

Instantly share code, notes, and snippets.

View adamstac's full-sized avatar

Adam Stacoviak adamstac

View GitHub Profile
@adamstac
adamstac / id_rsa.pub - iMac-i7-adam@adamstacoviak.com
Created March 30, 2010 20:46
SSH key for adam@adamstacoviak.com
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwbL4TrsWIMvdsp5alLc1fRzOc3dk/4+4AnTlCPQBphftLjP8eOZsqQRiumzcs3EUjvj6g9+fLXBtBJUMPfVvVtU4h0MpElRNuSlrUoWvbgJ+swH4ysMrn/KTqOSEtg/Fis6BFEdclVqsN/C81LB71ipg+HMJu/U0WOjt59lrBcqjJCNIZJlj4tpH4YH1jNwXwF0z5FxaCdjABLN8MVFUa7gdBvLJ9KtVTf03839MyD2pNIFjOHmSq/egGb2p5wy3roiotdeWbxlGMa2B9P5/HHFhlT53WN/Opb2p7k2uX+Tm/6BKvjYpALlEnqnzhI3djBvajCL8RLostGQkg+FsDw== adam@adamstacoviak.com
## throw this at the top of your .bash_profile
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
@imathis
imathis / _extensions.sass
Created November 5, 2010 18:58
Creates a nice 3D ribbon effect with CSS only
=gradient-bg($color, $top: 5, $bottom: $top)
@if $top < 0 and $bottom < 0
$color1: darken($color, abs($top))
$color2: lighten($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
@else
$color1: lighten($color, abs($top))
$color2: darken($color, abs($bottom))
+linear-gradient(color-stops($color1, $color2))
background-color: $color
@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
@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 / 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 / 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
@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() {
@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;
}
}
@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); }
}