Skip to content

Instantly share code, notes, and snippets.

$.getJSON "data/stores.json", (data) ->
_.each data, (val) ->
_.each val.products, (products) ->
console.log _.findWhere(products, {size: "5 Gallon Jug", name: "Mobil Super"})
@procload
procload / data.json
Last active December 30, 2015 22:08
[
'{{repeat(25)}}',
{
id: "{{index}}",
type: function(idx) {
return ['retailer', 'service'][this.numeric(0, 1)];
},
name: function(idx) {
var names = [
// *************************************
//
// Product
// -> Module for individual products
//
// *************************************
.product {
@extend %panel;
@extend %group;
# Works
<% data.vehicles.type.each do |vehicle| %>
<%= content_tag :option, vehicle, value: vehicle, class: (vehicle == data.page.selected_vehicle ? " " : "disabled") %>
<% end %>
#Doesn't Work
<% data.vehicles.type.each do |vehicle| %>
<%= content_tag :option, vehicle, value: vehicle, disabled: (vehicle == data.page.selected_vehicle ? " " : "disabled") %>
<% end %>
.site-search {
@include respond-to(48em) {
@extend .col-md-4;
}
}
@procload
procload / sprites.scss
Created November 6, 2013 15:47
Compass Sprites
@import "logos/large/*.png";
@include all-large-sprites;
@import "logos/small/*.png";
@include all-small-sprites;
@import "logos/retina/*.png";
@include all-retina-sprites;
@each $company in xom, xon, mobil, esso, xto {
.my-selector {
background: #000;
@include respond-to(45em, 'lt-ie8') {
background: #FFF;
}
}
.my-selector {
background: #000;
@include respond-to(45em) {
background: #FFF;
}
}
@mixin respond-to($viewport-width, $ie-version: 'lt-ie9') {
@media only screen and (min-width: $viewport-width) {
@content;
}
@if $ie-version == 'lt-ie9' {
html.lt-ie9 & { // Using Paul Irish's conditional comments
@content;
}
}
@else if $ie-version == 'lt-ie8' {
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if IE 9]> <html class="no-js lt-ie10" lang="en"> <![endif]-->
<!--[if gt IE 9]><!--> <html class="no-js" lang="en"> <!--<![endif]-->