Skip to content

Instantly share code, notes, and snippets.

// SASS
nav {
a {
color: green;
li.selected & {
color: red;
}
}
}
@Shpigford
Shpigford / variables_example.html
Created May 22, 2013 15:52
Temper Variables Example
<!-- data-variables="email=bob@example.com&user_id=13&last_seen=January 14, 2013" -->
<script
data-id="femybxrj"
data-format="inline"
data-size="medium"
data-variables="email=bob@example.com&user_id=13&last_seen=January 14, 2013"
src="//localhost:3000/d.js"
class="temper"
async>
@Shpigford
Shpigford / cdn_urls
Created March 30, 2013 02:09
My ISP (Charter) is having trouble loading certain CDNs. I'm stumped. They're stumped.
use.typekit.net
passets-ec.pinterest.com
g.virbcdn.com
0.gravatar.com
static3.businessinsider.com
fbstatic-a.akamaihd.net
@Shpigford
Shpigford / awesome.scss
Last active December 12, 2015 00:28
Why SASS + Compass is teh awesome...
// The yummy goodness that made this go REAALLLLY fast
@import "smilies/*.png";
@include all-smilies-sprites;
.smiley {
@include inline-block;
&.large {
height: smilies-sprite-height(red-large);
width: smilies-sprite-height(red-large);
&.red { @include smilies-sprite(red-large); }
@Shpigford
Shpigford / api.rb
Created October 25, 2012 17:19 — forked from gertig/api.rb
Snippets for an API with grape
# Server App
# This file must be in lib/myapp/api.rb
module MyApp
module Entities
class Products < Grape::Entity
expose :id, :code, :name, :short_description
expose :description, :unless => { :collection => true }
expose (:category) { |model, options| model.category.name }
expose (:brand) { |model, options| model.brand.name }
end
@Shpigford
Shpigford / style.css
Created October 24, 2012 13:39
CSS Comment Style
/*-----------------------------------------------------------------------------
HEADER
Some description about the awesomeness of the thing
-----------------------------------------------------------------------------*/
@Shpigford
Shpigford / dabblet.css
Created July 30, 2012 19:31
Break-out elements
/**
* Break-out elements
*/
.wrapper {
width:300px;
margin:0 auto;
background:yellow;
}
.break {
@Shpigford
Shpigford / dabblet.css
Created July 30, 2012 14:11
Break-out elements
/**
* Break-out elements
*/
.wrapper {
width:300px;
margin:0 auto;
background:yellow;
}
.break {
@Shpigford
Shpigford / dabblet.css
Created July 9, 2012 16:41
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
.outter {
background:red;
padding:5px;
position:relative;
}
.middle {
def receive_email
from = find_email(params["from"]).downcase
tracking_number = Tracking::Extractor.extract(params["text"])
if tracking_number.blank?
PostOffice.email_tracking_failure(from, "We could not find a valid tracking number in your email.").deliver
else
tracking_number.each do |tracking|
user = User.first(:conditions => ["email_forwards LIKE ?", "%#{from}%"])