Skip to content

Instantly share code, notes, and snippets.

View ajmalafif's full-sized avatar
💻

Ajmal Afif ajmalafif

💻
View GitHub Profile
When logged in, go to "Settings > Checkout > Checkout Language", click the "View and customize this translation" link.
A page with a url like this opens: "https://yourshop.myshopify.com/admin/settings/locales/[locale_id]".
copy [locale_id].
Go Back and choose "create a new one".
Open the Javascript console, paste this (change to your shop/locale_id first):
<snippet>
<content><![CDATA[{% include '__localize' with 'l10n-${SELECTION/([a-zA-Z]+)(?:(\s+?)|\b)/?1:\L$1(?2:-)\E/g}' %}]]></content>
<description>Wrap String in localization helper</description>
</snippet>
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;
<?php
if ( !function_exists('your_pagination')) :
function your_pagination($custom_query) {
if ( !$current_page = get_query_var( 'paged' ) ) $current_page = 1;
$permalinks = get_option( 'permalink_structure' );
if( is_front_page() ) {
$format = empty( $permalinks ) ? '?paged=%#%' : 'page/%#%/';
} else {
First Steps
========================================================================================
# Initialize git in a project
git init
# add and commit any existing files
git add .
git commit -m "Initial commit"
# associate with a remote repository
@ajmalafif
ajmalafif / SassMeister-input.scss
Created December 7, 2013 18:30 — forked from kaelig/SassMeister-input.scss
Generated by SassMeister.com, the Sass playground.
// ----
// Sass (v3.3.0.rc.1)
// Compass (v0.13.alpha.10)
// ----
// To enable support for browsers that do not support @media queries,
// (IE <= 8, Firefox <= 3, Opera <= 9) set $mq-responsive to false
// Create a separate stylesheet served exclusively to these browsers,
// meaning @media queries will be rasterized, relying on the cascade itself
$mq-responsive: true !default;

Use DocPad, GitHub and Prose as a Wiki

This guide will walk you through how you can use a GitHub repository to house your wiki content, have DocPad render it, and automatically update on changes. It's also really nice as we get to benefit from the github project workflow for our wiki, that is issues, pull requests, etc.

We use this workflow heavily by linking the DocPad Website and the DocPad Documentation repositories allowing us to have users edit and submit pull requests for improvements to our documentation, and once merged, the website regenerates automatically.

1. Create a new repository for your Wiki Content

<snippet>
<content><![CDATA[{% include '__localize' with 'l10n-${SELECTION/([a-zA-Z]+)(?:(\s+?)|\b)/?1:\L$1(?2:-)\E/g}' %}]]></content>
<description>Wrap String in localization helper</description>
</snippet>