Skip to content

Instantly share code, notes, and snippets.

<?php
// __call() test
// ===========================================================================
class MyBaseClass {
function _call($method, $args)
{
echo($args[0]);
return TRUE;
<?php
// Code trimmed out while porting Playa to a FieldFrame extension
// ===========================================================================
/**
* Extension Constructor
*
* @param array $settings
* @since version 1.0.0
*/
// What I did
$myField.resizable({
handles: ['.ui-resizable-handle'], // I already have this as a jQuery object, but passing it threw an error
alsoResize: '#'+myFieldId+' .scrollPane', // No way to specify the containment, so I had to add prepend the field ID. (allowing a jQuery object would fix that as well)
containment: 'parent', // This keeps the width from getting wider
resize: function() {
$(this).width('100%'); // This keeps the width from getting narrower
$('.scrollPane', this).width('100%'); // This keeps the alsoResize elements from changing widths
}
@brandonkelly
brandonkelly / gist:131005
Created June 17, 2009 00:33
TextMate File Pattern that shows .gitignore files
!(/\.(?!htaccess|gitignore)[^/]*|\.(tmproj|o|pyc)|/Icon\r|/svn-commit(\.[2-9])?\.tmp)$
// P&T link automations
var ee_affiliate_name = 'brandonkelly',
external_re = new RegExp('^https?://(?!'+document.location.hostname+')'),
external_ee_re = new RegExp('^(https?://(secure\\.)?expressionengine.com\\/)([^#]*)(#(\\w+))?$'),
ee_affiliate_re = new RegExp('^index\\.php\\?affiliate='+ee_affiliate_name);
$('a').each(function(){
// is this an external link?
if (this.href.match(external_re)) {
{exp:channel:entries channel="ee" url_title="{segment_3}" limit="1"}
{if no_results}{embed="site/404"}{/if}
{exp:docs:page entry_id="{entry_id}" url_title="{segment_4}"}
{if no_page}{embed="site/404"}{/if}
{embed="site/-header" title="{title} - Docs - {docs_page_title}" id="{url_title}-docs" class="ee docs"}
<header class="clearafter">
<hgroup class="left">
A Guide to Fieldtype Settings in EE2
display_global_settings()
- $this->settings
- fieldtype's global settings
display_settings($data)
- $this->settings
- fieldtype's global settings
/**
* tabfocus event plugin for jQuery
*
* Mimics the focus() event, except it's only
* called when focus wasn't assigned via a click
*
* -------------------------------------------
* Usage
* -------------------------------------------
*
@brandonkelly
brandonkelly / Make 'git difftool' use Changes.app
Created October 30, 2010 13:41
Make 'git difftool' use Changes.app
After clicking Changes > Install Terminal Utility…, add this to ~/.gitconfig:
[diff]
tool = changes-app
[difftool "changes-app"]
cmd = /usr/bin/chdiff $LOCAL $REMOTE
[difftool]
@brandonkelly
brandonkelly / gist:1051722
Created June 28, 2011 17:56
Assets.Sheet usage
// -------------------------------------------
// Include the Sheet resources in PHP
// -------------------------------------------
if (! class_exists('Assets_helper'))
{
require PATH_THIRD.'assets/helper.php';
}
$assets_helper = new Assets_helper;