Skip to content

Instantly share code, notes, and snippets.

@brianjmiller
brianjmiller / gist:909833
Created April 8, 2011 13:31
Use of RDBO query builder
my $st = Rose::DB::Object::QueryBuilder::build_select(
query_is_sql => 1,
db => $self->db,
select => 'status_code, COUNT(*) AS tally',
tables => [ Bikes::M::Inventory->meta->table ],
columns => { Bikes::M::Inventory->meta->table => [ qw( variant_id status_code ) ] },
group_by => 'status_code',
query => [
variant_id => $self->id,
],
@brianjmiller
brianjmiller / gist:932342
Created April 20, 2011 19:02
JSON from app
{ "IC::Manage::_class_ui_meta_struct_config" : 1,
"IC::Manage::class_ui_meta_struct_config" : 1,
"actions" : {
"Create" : { "Bikes::Manage::Orders::Create::ui_meta_struct(augment)" : 1,
"IC::Manage::ui_meta_struct" : 1,
"label" : "Create",
"renderer" : { "config" : { "action" : "/manage/Orders/action/Create/save",
"content" : { "config" : { },
"type" : "Bikes.Manage.Orders.Create"
}
@brianjmiller
brianjmiller / gist:934486
Created April 21, 2011 13:38
Blog: YUI3 Locally Served - Configuration
<script type="text/javascript">
YUI_config = {
filter: "raw",
comboBase: "/combo?",
root: "vendor/yui3/build/",
base: "/vendor/yui3/build/",
combine: true,
insertBefore: "styleoverrides",
groups: {
// set up for locally served gallery
@brianjmiller
brianjmiller / gist:967082
Created May 11, 2011 19:05
dumb version of Y.Sortable with drop handling
YUI.add(
"custom-manage-parcel_manager",
function(Y) {
var PACKAGE_TEMPLATE = '<li>{variant_sku} ({label})<input type="hidden" name="package-{id}" value="{parcel_id}" /></li>';
var Clazz = Y.namespace("Bikes.Manage").ParcelManager = Y.Base.create(
"custom_manage_parcel_manager",
Y.IC.RendererBase,
[],
{
YUI.add(
...
function (Y) {
Y.AMS.MyPlugin = Y.Base.create(
....
);
Y.AMS.MyPlugin.plugAllCalendars = function () {
....
};
Y.namespace('tnsg5').Tile = Y.Base.create("tile", Y.Widget,[], {
initializer: function () {
this.dataSource = this.getDataSourceInstance();
var dsCfg = {
request: "cb={}",
callback: {
//HERE IS WHERE THE FUNCTION IS ADDED
success: Y.bind(this.onSuccessfulLoad, this)
@brianjmiller
brianjmiller / gist:1014561
Created June 8, 2011 14:45
YUI3 panelesque
YUI.add(
"ui-window-tile",
function(Y) {
var Tile = Y.Base.create(
"ui_window_tile",
Y.Overlay,
[],
{
// TODO: make this a child of the window parent
_window: null,
@brianjmiller
brianjmiller / gist:1017449
Created June 9, 2011 18:59
YUI AC with function as requestTemplate
// Y.IC.AutoComplete source: https://github.com/Wiggins/interchange_mvc/blob/master/share/ic/js/autocomplete.js
return new Y.IC.AutoComplete (
{
inputNode: input_node,
queryDelay: 300,
minQueryLength: 6,
resultListLocator: "results",
source: "/manage/LogisticsZoneServiceMaps/ac?_format=json&service_kind=delivery&",
requestTemplate: function (query) {
@brianjmiller
brianjmiller / gist:1027681
Created June 15, 2011 18:00
Y.io with JSON parse
Y.io(
"/manage/Countries/options?_format=json",
{
on: {
success: Y.bind(
function (txnId, response) {
var new_data;
try {
new_data = Y.JSON.parse(response.responseText);
}
" include other paths to look for config files
:set runtimepath=~/.vim,$VIMRUNTIME
" some basic options
:set nocompatible
:set showmatch
:set nowrap
:set ruler
:set showmode
:set backspace=2