Skip to content

Instantly share code, notes, and snippets.

{% for block in section.blocks %}
<!-- Could also work with collections, blogs, articles... -->
{% if product.handle == block.settings.product %}
<!-- Could also be a snippet include -->
{{ block.settings.product['some_value'] }}
{% endif %}
{% endfor %}
#!/usr/bin/env ruby
message_file = ARGV[0]
message = File.read(message_file)
def range_rand(min,max)
min + rand(max-min)
end
bads = [
"Yeah, bitch! Magnets!",
@iamkeir
iamkeir / gist:757913
Created December 28, 2010 23:38
Twitter feed parser
<?php
// TWEED: Twitter feed parser
function Tweed ($user, $limit = NULL) {
$tweedURL = 'http://search.twitter.com/search.atom?q=from:' . $user; // Twitter RSS feed URL
$tweedXML = simplexml_load_file($tweedURL); // Convert RSS to XML
$count = 0; // Set count
@iamkeir
iamkeir / _fraction-grid.scss
Last active August 29, 2015 14:22
Sass Fraction Grid
/*
FRACTION GRID
Fixed gutter, fluid width grid - infinite columns, nesting, overrides, etc.
Inspired by http://builtbyboon.com/blog/proportional-grids
*/
// @OPTIMISE: larger/smaller + fluid gutters...
$w-gutter: 20px !default;
$w-max: 1000px !default;
@iamkeir
iamkeir / _font-face.scss
Created June 19, 2014 12:24
Lazy font-face generator (SCSS)
// Lazy font-face generator
// @TODO: Consider additional mixin parameter to specify which font filetypes to output, e.g. "eot, woff"
@mixin font-face($label,$font) {
@font-face {
font-family: $label;
src: url('#{$font_path}#{$font}.eot');
src: url('#{$font_path}#{$font}.eot?#iefix') format('embedded-opentype'),
url('#{$font_path}#{$font}.woff') format('woff'),
url('#{$font_path}#{$font}.ttf') format('truetype'),
url('#{$font_path}#{$font}##{$label}') format('svg');
@iamkeir
iamkeir / _nav.scss
Last active August 29, 2015 14:02
Nav helper (SCSS)
// NAV HELPER
// Use @extend %nav etc. for leaner CSS
@mixin nav($type:null) {
@if $type == "reset-first" {
margin-left: 0;
padding-left: 0;
border-left: 0;
}
@else {
margin: 0;