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
@themusicman
themusicman / spec_helper.rb
Last active December 13, 2015 22:49
spec_helper for Padrino that adds support for assigns(:model_name) in controller specs.
PADRINO_ENV = 'test' unless defined?(PADRINO_ENV)
require File.expand_path(File.dirname(__FILE__) + "/../config/boot")
module Padrino
module RspecHelpers
def self.registered(app)
app.set :delivery_method, :test
@themusicman
themusicman / pi.rangee.php
Created November 29, 2012 15:34
Simple Little Date Range Plugin
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* ExpressionEngine - by EllisLab
*
* @package ExpressionEngine
* @author ExpressionEngine Dev Team
* @copyright Copyright (c) 2003 - 2011, EllisLab, Inc.
* @license http://expressionengine.com/user_guide/license.html
* @link http://expressionengine.com
@themusicman
themusicman / add-states.html
Created November 7, 2012 14:24
Generate State Categories
<?php
$category_group = 9;
$site_id = 1;
$state_list = array(
'AL'=>"Alabama",
'AK'=>"Alaska",
'AZ'=>"Arizona",
'AR'=>"Arkansas",
@themusicman
themusicman / gist:3797006
Created September 27, 2012 23:10
Run the erd rake task
padrino rake erd
gem 'rails-erd', :group => 'development'
@themusicman
themusicman / erd.rake
Created September 27, 2012 22:56
Rake task for Padrino and Rails-erd
task :erd do
require "rails_erd/diagram/graphviz"
RailsERD::Diagram::Graphviz.create(
filename: Padrino.root('docs/erd'),
attributes: [:foreign_keys, :primary_keys, :content, :timestamps, :inheritance]
)
end
class Houdini {
//precious! my precious....
protected static $data = array();
// other super awesome code ...
}
class Houdini {
// other super awesome code ...
}
$instance = new Houdini;
class MyClass {
public static my_var;
}
{exp:houdini:fetch key="categories"}