Skip to content

Instantly share code, notes, and snippets.

View themusicman's full-sized avatar
🏠
Working from home

Thomas Brewer themusicman

🏠
Working from home
View GitHub Profile
{exp:houdini:store key="categories"}
{categories backspace="2"}{category_name}, {categories}
{/exp:houdini:store}
<title>{exp:houdini:get key="page_title"} - Site Name</title>
{exp:houdini:set key="page_title" value="{title}"}
url /people/?name=Tom&gender=male
{exp:sherlock:get}
<p>{get:name} - {get:gender}</p>
{/exp:sherlock:get}
{exp:sherlock:page_type}
{if is_pagination}
There are a lot of these.
{/if}
{if is_pagination && is_category}
There are a lot of these to filter.
{/if}
{exp:sherlock:category_id category_url_title="{segment_4}"}
{exp:weblog:entries weblog="news" category="{category_id}"}
<ul>
<li><a href="{url_title_path=" news"}">{title}</a></li>
</ul>
{/exp:weblog:entries}
{if no_results}
@themusicman
themusicman / simple-observer.js
Created July 12, 2012 16:48
Simple Observer Thing
function Search() {
this.isSearching = false;
this.searchingObservers = [];
}
Search.prototype = {
search: function(term) {
@themusicman
themusicman / include-experiments.rb
Created July 5, 2012 23:35
Experiments with Module Includes in Ruby
# I created a generic Rails like ApplicationController so that you can just
# run this code via a command line prompt without the need for Rails
module Recorder
def self.included(base)
base.send(:before_filter, :some_method)
base.send(:after_filter, :another_method)
end
@themusicman
themusicman / Gemfile
Created July 3, 2012 13:44
Checks a site for links that lead to 404 pages
source "http://rubygems.org"
gem 'anemone'
@themusicman
themusicman / collider
Created July 3, 2012 01:38
Breaks apart things
var collider = function(string) {
var arr = [],
parts = string.split('[');
for (index in parts) {
arr.push(parts[index].replace(']', ''))
}
return arr;