Skip to content

Instantly share code, notes, and snippets.

@JJediny
JJediny / gist:a466eed62cee30ad45e2
Created October 5, 2015 20:42
Jekyll Liquid Cheatsheet

There are two types of markup in Liquid: Output and Tag.

  • Output markup (which may resolve to text) is surrounded by
{{ matched pairs of curly brackets (ie, braces) }}
  • Tag markup (which cannot resolve to text) is surrounded by
@tomeara
tomeara / inline_svg_helper.rb
Last active October 25, 2019 13:01
Inline SVG for Rails
# Put this method in your helper file to render inline SVG
def inline_svg(path)
file = File.open("app/assets/images/#{path}", "rb")
raw file.read
end
@RyanBrackett
RyanBrackett / jQuery.Responsive.Classes
Last active November 5, 2019 14:16
How About This...
/*
*
* Originally inspired by: http://designedbythomas.co.uk/blog/how-detect-width-web-browser-using-jquery
*
* Original source by https://gist.github.com/highrockmedia/3710930
*
* My contribution: I re-wrote some code it to fire as one function, so you're only editing values in one place.
*
*/
@stickwithjosh
stickwithjosh / gist:2869162
Created June 4, 2012 15:51
New site setup instructions
1. Purchase domain (hover.com)
2. Heroku app for website
* copy existing site
* Make git repo run
$ git init .
$ git add .
$ git commit -a -m "intial commit"
* $ heroku apps:create DOMAIN (https://devcenter.heroku.com/articles/creating-apps)
* $ git push heroku master
* $ heroku domains:add www.DOMAIN.com
@sowenjub
sowenjub / gist:1033876
Created June 19, 2011 07:29
Quickly dump your heroku production database and load it locally
#!/bin/bash
# This script does the following:
# 1/ capture and download the latest backup
# 2/ load it to your local database
# 3/ run your app and open Safari
# Just replace any uppercase string with your own data
#
@sstephenson
sstephenson / back_forward.js
Created December 13, 2010 21:55
How to detect whether a hash change came from the Back or Forward button
var detectBackOrForward = function(onBack, onForward) {
hashHistory = [window.location.hash];
historyLength = window.history.length;
return function() {
var hash = window.location.hash, length = window.history.length;
if (hashHistory.length && historyLength == length) {
if (hashHistory[hashHistory.length - 2] == hash) {
hashHistory = hashHistory.slice(0, -1);
onBack();