Skip to content

Instantly share code, notes, and snippets.

0 0
0 0
1 0
1 1
2 1
2 2
2 2
$i = 0;
$j = 0;
$k = 0
for i in 0..19
$i +=1;
until $j == ($i - 1)
$j +=1;
@procload
procload / Grid Backgrounds in Twitter Bootstrap
Created March 6, 2012 18:52
Custom mixin to show grid backgrounds in Twitter Bootstrap
// Show a Grid Background
// **************************************************
// **************************************************
@function build-grid( $total-columns: 19,
$page-width: 930px,
$column-width-percent: 30px,
$gutter-width-percent: 20px,
$column-color: rgba(255,0,255,.05)) {
@mixin col-border-right($border-width, $border-color) {
border-right: $border-width solid $border-color;
@if $border-width == 1px {
$marginRight: ($gridColumnWidth / 2);
$paddingRight: (($gridColumnWidth + ($gridGutterWidth * 2)) / 2) - $border-width;
padding-right: calc-em($paddingRight, $baseFontSize);
margin-right: calc-em($marginRight, $baseFontSize);
} @else {
$paddingRight: (($gridColumnWidth + ($gridGutterWidth * 2)) / 2) - ($border-width / 2);
$marginRight: ($gridColumnWidth / 2) - ($border-width / 2);
<section class="success-stories row">
<div class="story span17">
<div class="row">
<div class="span4">
<div class="thumbnail video-small">
<%= image_tag 'tmp/img-vids1.png', :alt => 'Video Title' %>
</div>
</div>
<div class="span12 offset1">
<h5><%= link_to 'Video Title', '#' %></h5>
@procload
procload / TM2 Properties File
Created March 21, 2012 15:16
TextMate2 Properties File
# Basic Settings
#
fontName = "Menlo"
fontSize = 13
# Extra files to include
#
myExtraIncludes = ".tm_properties,.htaccess,.gitignore"
fileBrowserGlob = "{*,$myExtraIncludes}"
include = "{$include,$myExtraIncludes}"
@procload
procload / gist:2421232
Created April 19, 2012 14:16
Media Queries in SASS 3.2
// ------------------------------------------- //
// MEDIA QUERIES //
// ------------------------------------------- //
$breakSmall: 320px;
$breakMedium: 560px;
$breakLarge: 1024px;
@mixin respond-to($media) {
@if $media == tiny-screens {
#From Application Controller
unless Rails.env.development? || Rails.env.test?
rescue_from Exception, :with => :error_message
rescue_from ActiveRecord::RecordNotFound, :with => :file_not_found
rescue_from ActionController::RoutingError, :with => :file_not_found
rescue_from ActionController::UnknownController, :with => :file_not_found
rescue_from ActionController::UnknownAction, :with => :file_not_found
end
def error_message(e)
$('.marker').bind 'click', (e) ->
e.preventDefault
$('.marker .testimonial').fadeOut 100, ->
$(this).parent('.marker').css
"z-index": 1
$(this).children('.testimonial').fadeIn 100, ->
$(this).parent('.marker').css
"z-index": 5
$('.testimonial .close').bind 'click', (e) ->
class window.Multiselect extends CoffeeCup
default_options:
debug: true
init: ->
@create()
@events()
create: ->