Skip to content

Instantly share code, notes, and snippets.

View Chrisedmo's full-sized avatar

Chris Mousdale Chrisedmo

View GitHub Profile
@Chrisedmo
Chrisedmo / Mountain Lion tweaks
Created July 30, 2012 14:30
Mountain Lion tweaks (under the hood)
# ~/.osx — http://mths.be/osx
###############################################################################
# General UI/UX #
###############################################################################
# Set computer name (as done via System Preferences → Sharing)
scutil --set ComputerName "MathBook Pro"
scutil --set HostName "MathBook Pro"
scutil --set LocalHostName "MathBook-Pro"
@Chrisedmo
Chrisedmo / filter-vendor.liquid
Created July 31, 2012 11:14
Shopify: Filter by Vendor
<!-- add the vendor as product tag to product then use this code in collection.liquid -->
<!-- if we are on a collection page that is either custom or smart -->
{% if collection.url != blank %}
<h4>Shop by vendor:</h4>
<ul>
{% for product_vendor in collection.all_vendors %}
<li>
{% if current_tags contains product_vendor %}
<a class="active" href="{{ collection.url }}">{{ product_vendor }}</a>
{% else %}
@Chrisedmo
Chrisedmo / nav-dropdown.liquid
Created July 31, 2012 11:19
Shopify: 2 Level Dropdown Menu
<ul>
{% for link in linklists.main-menu.links %}
<li class="{% if forloop.first %}first{% elsif forloop.last %}last{%endif%}">
{% assign child_list_handle = link.title | handle %}
{% if linklists[child_list_handle].links != blank %}
<div class="has-dropdown">
<a href="{{ link.url }}" class="clearfix">
<span class="nav-label">{{ link.title }}</span>
<span class="nav-arrow"></span>
</a>
@Chrisedmo
Chrisedmo / shop-by-category-select.liquid
Created July 31, 2012 11:22
Shopify: Drop-down menu - select
<form name="shop-by-category">
<select onchange="if (this.value !== '') window.location = this.value;">
<option value="">Shop by Category</option>
{% for link in linklists[shop-by-category].links %}
<option name="collection" value="{{ link.url }}"{% if link.active %} selected="selected"{% endif %}>{{ link.title }}</option>
{% endfor %}
</select>
</form>
@Chrisedmo
Chrisedmo / latest-blog-posts.css
Created July 31, 2012 11:29
Shopify: Latest Blog Posts
.widget .latest-blog-posts-list {
margin: 0;
list-style: none;
}
.widget .latest-blog-posts-list li {
margin: 0 0 10px 0;
padding: 0 0 10px 0;
border-bottom: dotted 1px #CCC;
background: none;
word-wrap: break-word;
@Chrisedmo
Chrisedmo / sort-collection.css
Created July 31, 2012 11:35
Shopify: Client-side sorting for collections
.reorder-drop-down {
margin-top:10px;
padding:10px;
overflow:hidden
}
.reorder-drop-down label {
display:inline;
}
@Chrisedmo
Chrisedmo / tags.liquid
Created July 31, 2012 11:38
Shopify: Tags
<ul>
<li{% unless current_tags %} class="active"{% endunless %}>
{% if collection.handle %}
<a href="/collections/{{ collection.handle }}">All</a>
{% elsif collection.products.first.type == collection.title %}
<a href="{{ collection.title | url_for_type }}">All</a>
{% elsif collection.products.first.vendor == collection.title %}
<a href="{{ collection.title | url_for_vendor }}">All</a>
{% endif %}
@Chrisedmo
Chrisedmo / product-grid.liquid
Created July 31, 2012 11:45
Shopify: Product Grid Item
<div class="grid-product {% cycle ' alpha', '', ' omega' %}" itemscope itemtype="http://schema.org/Product">
{% if product.compare_at_price_min > 0 %}
<!-- SALE BOX -->
<div class="sale-box">
<p>Sale</p>
</div>
{%endif%}
<div class="product-photo">
<a href="{{ product.url | within: collection }}" title="{{ product.title }}">
@Chrisedmo
Chrisedmo / shopify-variables.less
Created July 31, 2012 13:21
Shopify: LESS Variables for themes.
// COLOURS
@brand-colour: ~"{{ settings.brand_colour }}";
@text-colour: ~"{{ settings.text_colour }}";
@logo-colour: ~"{{ settings.logo_colour }}";
@link-colour: ~"{{ settings.links_colour }}";
@active-colour: ~"{{ settings.active_colour }}";
@Chrisedmo
Chrisedmo / index.html
Created August 14, 2012 23:56
Simple fluid Grids
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->