Skip to content

Instantly share code, notes, and snippets.

def redeem
# Lookup invitation, 404 if not found
# Build new user.
# If user is valid
# If existing subscription, add user to subscription
# If adding to plan, create new subscription w/ as group leader
# If successful
# Create invitation redeemed event
# Delete invitation
# Force the latest IE version, in various cases when it may fall back to IE7 mode
# github.com/rails/rails/commit/123eb25#commitcomment-118920
# Use ChromeFrame if it's installed for a better experience for the poor IE folk
<IfModule mod_setenvif.c>
<IfModule mod_headers.c>
BrowserMatch MSIE ie
Header set X-UA-Compatible "IE=Edge" env=ie
BrowserMatch chromeframe gcf
Header append X-UA-Compatible "chrome=1" env=gcf
</IfModule>
# allow access from all domains for webfonts
# alternatively you could only whitelist
# your subdomains like "sub.domain.com"
<FilesMatch "\.(ttf|otf|eot|woff|font.css)$">
<IfModule mod_headers.c>
Header set Access-Control-Allow-Origin "*"
</IfModule>
</FilesMatch>
# Proper svg serving. Required for svg webfonts on iPad
# twitter.com/FontSquirrel/status/14855840545
AddType image/svg+xml svg svgz
# webfonts
AddType application/vnd.ms-fontobject eot
AddType font/ttf ttf
AddType font/otf otf
AddType font/x-woff woff
# video
AddType video/ogg ogg ogv
AddType video/mp4 mp4
# gzip compression.
<IfModule mod_deflate.c>
# webfonts and svg:
<FilesMatch "\.(ttf|otf|woff|eot|svg|svgz)$" >
SetOutputFilter DEFLATE
</FilesMatch>
</IfModule>
.grid_1 { width: 120px; margin-left: 20px; }
.another-section { .grid_1; }
/* lessc turns this into: */
.grid_1, .another-section {
width: 120px;
margin-left: 20px;
}
@rickharris
rickharris / .bash_profile
Created June 14, 2011 23:04
Two-line bash prompt
PS1='\r\n\[\033[0;35m\]\u@\H\[\033[0m\] in \[\033[34m\]\w\[\033[37m\]\r\n∴ \[\033[0m\]'
/**
* @file _grid.scss
*
* This file contains the grid definitions for MUSC.
*/
$num_columns: 12;
$column_width: 60px;
$gutter_width: 20px;
@rickharris
rickharris / htaccess-robots-custom-d7.patch
Created August 8, 2011 02:49
Patch for customizations of .htaccess and robots.txt for Drupal 7
diff --git a/.htaccess b/.htaccess
index 9494b53..bb88992 100644
--- a/.htaccess
+++ b/.htaccess
@@ -84,8 +84,9 @@ DirectoryIndex index.php index.html index.htm
# To redirect all users to access the site WITH the 'www.' prefix,
# (http://example.com/... will be redirected to http://www.example.com/...)
# uncomment the following:
- # RewriteCond %{HTTP_HOST} !^www\. [NC]
- # RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]