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
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;
@themusicman
themusicman / jquery-proxy-love
Created March 27, 2012 14:20
A little jQuery proxy love
var templateRetrieved = this.getTemplate();
jQuery.when(templateRetrieved).then(jQuery.proxy(function(template){
var html = this.renderTemplate(template, data);
this.$el.html(html);
}, this));
@themusicman
themusicman / Toolbox_Template_Form
Created March 14, 2012 14:38
EE2 Template Form Class
<?php
class Toolbox_Template_Form {
protected $form_html = NULL;
protected $tagdata = '';
protected $options = array();
$ ->
App.start()
App =
start: ->
console.log('test')
window.App = App