Skip to content

Instantly share code, notes, and snippets.

View balupton's full-sized avatar
:bowtie:
Back to work from backpacking, give me a few weeks to catch up

Benjamin Lupton balupton

:bowtie:
Back to work from backpacking, give me a few weeks to catch up
View GitHub Profile
@balupton
balupton / danwiersema-ajaxy-bookmark.js
Created August 6, 2010 15:31
Dan Wiersema Ajaxy Upgrade
javascript:var%20e=document.createElement('script');e.setAttribute('language','javascript');e.setAttribute('src','http://gist.github.com/raw/511491/b4f033402d200486aceab558c819a91f615856b3/danwiersema-ajaxy.js');document.body.appendChild(e);void(0);
@balupton
balupton / README.md
Last active September 5, 2015 15:54
Answer: How to bind jQuery History state dynamically in .click()
@balupton
balupton / 0-readme.txt
Created August 14, 2010 09:06
Different ways to include scripts and styles with Ajaxy.
This gist documents the ways you can include scripts and styles into your page using ajaxy.
But the most recommended way is to include all your scripts and styles in your initial pages header. You get a big initial load, but all future loads are quick and fast.
The other ways are documented below with the apricots-body and apricots-head examples. The apricots-body would then be the second recommended, and the apricots-head example is not recommended.
@balupton
balupton / bal-zend-view-helper-headlink.patch
Created August 19, 2010 22:57
HeadLink View Helper does not allow "id" attribute
@balupton
balupton / bal-zend-view-helper-navigation-menu.patch
Created August 19, 2010 22:59
Navigation Menu View Helper does not support templates.
--- zend-1.10.3-lib/Zend/View/Helper/Navigation/Menu.php 2010-04-02 17:08:46.000000000 +0800
+++ balphp-lib/Zend/View/Helper/Navigation/Menu.php 2010-04-29 23:32:42.000000000 +0800
@@ -198,6 +198,31 @@ class Zend_View_Helper_Navigation_Menu
// Public methods:
/**
+ * Simple template to use in the htmlify process if specified
+ *
+ * @var string
+ */
@balupton
balupton / README.md
Created September 6, 2015 18:54
Tinkle / Brainstorming for a new introspection and extrospection API and UI / Stuff from Feb 11 2015, originally at bevry/tinkle

Welcome to Tinkle

Tinkle is an introspection saving library and an extrospection rendering library.

Example

Run the following:

mkdir tinkle-example
@balupton
balupton / ajaxy-beginner-interface.js
Created September 21, 2010 19:25
Ajaxy Beginner Interface
// Option 1 - Good solution, can create a controller from this
$('.ajaxy-page').ajaxify({
controller: 'page',
request: function(){
$('#content').fadeOut();
},
response: function(){
$('#content').html(this.Response.data.content).fadeIn();
}
});
@balupton
balupton / registerplugin-impl.js
Created October 16, 2010 16:13
Proposal for the usage of a new Aloha.registerPlugin function.
/*
Demo of proposed registerPlugin function
*/
(function(window,undefined){
// Extract
var GENETICS = window.GENTICS,
jQuery = window.jQuery;
// Prototypes
@balupton
balupton / README.md
Last active September 23, 2015 23:27
Aloha Editor Plugin Migrator

Aloha Editor Plugin Migrator

Used to port over plugins to their new repos

@balupton
balupton / bind.trigger.prototype.js
Created January 26, 2011 15:42
Bind and Trigger Custom and Native Events in Prototype
/**
* Bind and Trigger custom and native events in Prototype
* @author Juriy Zaytsev (kangax)
* @author Benjamin Lupton (balupton)
* @copyright MIT license
**/
(function(){
var eventMatchers = {
'HTMLEvents': /^(?:load|unload|abort|error|select|hashchange|popstate|change|submit|reset|focus|blur|resize|scroll)$/,