Skip to content

Instantly share code, notes, and snippets.

@scottmessinger
scottmessinger / 1.router.js
Created September 21, 2011 22:29
Routing in KO with Backbone.js
App.Router = Backbone.Router.extend({
routes : {
"" : "home"
,"/" : "home"
,"!" : "home"
,"!/" : "home"
,"!/:username" : "show_user"
,":username" : "show_user"
,":username/" : "show_user"
@airways
airways / mod.extendedchannel.php
Created October 28, 2011 15:52
ExpressionEngine: Extending a core or third party module or plugin
<?php
class ExtendedChannel {
public __construct()
{
$this->EE = &get_instance();
}
public function extended_entries()
{
@ckimrie
ckimrie / .htaccess
Created November 10, 2011 12:18
ExpressionEngine index.php removal with Google Analytics Compatibility
#################################################################################
#
# - ExpressionEngine index.php ModRewrite Removal -
# compatible with Google Analytics Tracking
#
##################################################################################
RewriteEngine on
@low
low / gist:1391783
Created November 24, 2011 16:49
Simple EE conditionals turning advanced -- an example
// This will execute the exp:tag if first segment is empty
{if segment_1 != ''}
{exp:class:method}
{if var == "foo"}
Lorem
{if:else}
Ipsum
{/if}
{/exp:class:method}
@objectivehtml
objectivehtml / gist:1478635
Created December 14, 2011 21:29
A better way to fetch EE parameters
private function param($param, $default = FALSE, $boolean = FALSE, $required = FALSE)
{
$name = $param;
$param = $this->EE->TMPL->fetch_param($param);
if($required && !$param) show_error('You must define a "'.$name.'" parameter in the '.__CLASS__.' tag.');
if($param === FALSE && $default !== FALSE)
{
$param = $default;
@bryantAXS
bryantAXS / gist:1481442
Created December 15, 2011 15:15
eecms:page_speed_stats
{!-- page load stats, for debugging --}
{if logged_in && member_group == "1"}
<div style="overflow:visible;position: absolute; top:0; left: 0; position: fixed; background-color: #000; color: #fff; font-size: 16px; padding: 5px; font-family:Arial, Helvetica, sans-serif;">
{elapsed_time} seconds / {total_queries} queries
<a href='javascript:;' onclick="$(this).parent().fadeOut(200);" style='position:absolute; bottom:-18px; right:0px;height:10px;background-color:#282828;color:#fff;display:block;font-size:11px;text-decoration:none;padding:3px;'>Close</a>
</div>
{/if}
@objectivehtml
objectivehtml / gist:1534699
Created December 29, 2011 15:56
Simple EE Class interacting with Channel Data
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Email_Template {
public $to,
$from,
$cc,
$bcc,
$channel_id,
$categories,
@chrislkeller
chrislkeller / README.md
Last active September 30, 2015 03:08
This has been updated here to reflect the coming changes to the Fusion Tables API.

SpreadSheet to Fusion Tables

This has been updated here to reflect the coming changes to the Fusion Tables API.

@bliswebagency
bliswebagency / cat_tackon
Created February 2, 2012 01:17
Add Categories to Structure Navigation (#eecms)
{!-- MAKE SURE UNIQUE IDs = YES --}
{exp:structure:nav add_level_classes="yes" add_span="yes" add_unique_ids="yes" css_class="nav" css_id="nav_full" current_class="active" include_ul="yes" max_depth="5" mode="full" status="Open"}
{!-- This technique uses GWCODE Cats but you could do it the normal way --}
{!-- we're hiding the div that contains the stuff we want --}
<div style="display:none" id="prod_cats">
{!-- This technique uses GWCODE Cats but you could do it the normal way --}
@jackmcdade
jackmcdade / twitter-bootstrap2-with-structure.js
Created March 19, 2012 21:50
Twitter Bootstrap2 with Structure
{exp:structure:nav max_depth="2" show_depth="2" current_class="active" css_class="nav" has_children_class="dropdown"}
<script>
$(function() {
$('ul li.dropdown').each(function() {
$(this).children('ul').addClass("dropdown-menu"); // add children dropdown menu class
$(this).children('a').append('<b class="caret"></b>') // add caret icon
$(this).clone().prependTo($(this).find('ul')).removeClass('dropdown active').children('ul').remove(); // clone parent link into child menu
$(this).children('a').attr('data-toggle', 'dropdown').attr('href', '#').addClass("dropdown-toggle"); // add data attributes to hook up Bootstrap
});