Skip to content

Instantly share code, notes, and snippets.

View brandoncordell's full-sized avatar

Brandon Cordell brandoncordell

View GitHub Profile
namespace "site" do
match 'branding' => 'account#branding', :as => 'account_branding'
post 'branding' => 'account#save_branding', :as => 'account_branding'
end
@brandoncordell
brandoncordell / gist:1119296
Created August 2, 2011 00:15
Lost of the schema...
Not sure what's the best schema I should use in this situation.
I want:
-------
- Users should be able to register an account, with a subdomain
- Subdomain owners can invite other users to access the account
- Users should be able to own multiple subdomains, and belong to multiple subdomains
- Users will access their account through their subdomain (e.g. cooluser.myapp.com)
%h2 Post Your Job
%ol
%li Listing Details
%li Company Details
%li Preview Your Listing
%li Finish
- form_for :job, :url => { :action => :create } do |f|
/ = f.error_messages
/ = render "jobs/shared/#{@job.current_step}", :f => f
=> Booting WEBrick
=> Rails 3.0.8 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-07-24 21:52:53] INFO WEBrick 1.3.1
[2011-07-24 21:52:53] INFO ruby 1.9.2 (2011-02-18) [x86_64-darwin10.7.0]
[2011-07-24 21:52:53] INFO WEBrick::HTTPServer#start: pid=33000 port=3000
Started GET "/" for 127.0.0.1 at 2011-07-24 21:53:00 -0400
# jobs_controller
class JobsController < ApplicationController
def new
@job = Job.new
end
def create
@job = Job.new(params[:job])
@job.current_step = session[:listing_step]
@brandoncordell
brandoncordell / cakephp component extension
Created June 17, 2011 13:28
Extending components in CakePHP without having to change all the calls to the original component
// controllers/components/custom_acl.php
App::import('Component', 'Acl');
class CustomAclComponent extends AclComponent {
public function example() {
// override the function
}
}
Then in your app_controller
http://maps.google.com/maps/api/staticmap?center=2312+gulf+to+bay+blvd+clearwater+fl&zoom=17&size=400x400&sensor=false
ALTER TABLE `table_name` AUTO_INCREMENT = xxxxx;
@brandoncordell
brandoncordell / gist:799936
Created January 28, 2011 06:55
dZero Image Lib - CodeIgniter Library
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* dZero image library
*
* @package dZero Image Library
* @category Image Manipulation
* @author Daniel Nolan ([email protected]) & Brandon Cordell ([email protected])
* @copyright Copyright (c) 2009 dZero Web Design & Development.
* @link http://dzerodesign.com
* @version 1.0
@brandoncordell
brandoncordell / gist:799934
Created January 28, 2011 06:54
dZero Auth - CodeIgniter library
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* dZero authentication library
*
* @package dZero Auth Library
* @category authentication
* @author Daniel Nolan ([email protected]) & Brandon Cordell ([email protected])
* @copyright Copyright (c) 2009 dZero Web Design & Development.