Skip to content

Instantly share code, notes, and snippets.

@tinotriste
tinotriste / gist:5184243
Last active December 15, 2015 01:59
Terminal: Print Directory Contents
List files in a directory:
ls -l /path/to/folder
List files on a per-subfolder basis:
ls -lR /path/to/folder
List all subfolders with formatted output (go ahead, copy and paste it to the Terminal)
cd /path/to/folder
ls -R | grep ":$" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e 's/^/ /' -e 's/-/|/'
@tinotriste
tinotriste / gist:5328087
Last active December 20, 2018 19:16
Shopify: Theme liquid tags for Facebook Open Graph
<!-- Find Current URL for og:url tag
https://github.com/joshuacc/Shopify-Snippets/blob/master/find-current-url.liquid -->
{% assign current_url = '' %}
{% case template %}
{% when 'page' %}
{% assign current_url = page.url %}
{% when 'blog' %}
{% assign current_url = blog.url %}
{% when 'article' %}
{% assign current_url = blog.url %}
@tinotriste
tinotriste / gist:5328118
Last active December 15, 2015 21:49
Shopify: Find current handle
{% assign current_handle = '' %}
{% case template %}
{% when 'page' %}
{% assign current_handle = page.handle %}
{% when 'blog' %}
{% assign current_handle = blog.handle %}
{% when 'article' %}
{% assign current_handle = blog.handle %}
{% when 'collection' %}
@tinotriste
tinotriste / gist:5328126
Last active May 21, 2019 00:33
Shopify: Find current URL
{% assign current_url = '' %}
{% case template %}
{% when 'page' %}
{% assign current_url = page.url %}
{% when 'blog' %}
{% assign current_url = blog.url %}
{% when 'article' %}
{% assign current_url = blog.url %}
{% when 'collection' %}
@tinotriste
tinotriste / gist:5384910
Last active December 16, 2015 05:29
Sublime Text: Useful Shortcuts
h1. Sublime Text 2 - Useful Shortcuts (PC)
Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.
h2. Editing
| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |
@tinotriste
tinotriste / image-replacement.css
Last active December 16, 2015 05:29 — forked from androide-osorio/gist:4102734
CSS: Image Replacement
.ir {
border: 0;
font: 0/0 a;
text-shadow: none;
color: transparent;
background-color: transparent;
}
@tinotriste
tinotriste / wp_head.php
Last active December 16, 2015 05:29 — forked from envex/head.php
Wordpress: Head functions
<!-- wordpress head functions -->
<?php wp_head(); ?>
<!-- end of wordpress head -->
@tinotriste
tinotriste / wp_footer.php
Last active December 16, 2015 05:29
Wordpress: Footer functions
@tinotriste
tinotriste / get_sidebar.php
Last active December 16, 2015 05:29
Wordpress: Get sidebar
<!-- start sidebar -->
<?php get_sidebar(); ?>
<!-- end sidebar -->
@tinotriste
tinotriste / get_header.php
Created April 15, 2013 01:26
Wordpress: Get header
<?php get_header(); ?>