Skip to content

Instantly share code, notes, and snippets.

View kennethdavidbuck's full-sized avatar

Kenneth Buck kennethdavidbuck

  • Prince Edward Island
View GitHub Profile
@kennethdavidbuck
kennethdavidbuck / remember-route.js
Last active December 26, 2015 02:09
An attempt to return to the last route visited within a given resouce.
/**
*
*/
Em.RememberRouteMixin = Em.Mixin.create({
/**
* Whether or not this route should catch
* bubbling transitions and use them as a default
* transition object.
*/
catchTransition:false,
@kennethdavidbuck
kennethdavidbuck / menu-speech-bubble-link-view.js
Created October 6, 2013 19:10
Example extension of Ember LinkView to include animated properties
@kennethdavidbuck
kennethdavidbuck / commands
Created October 1, 2013 20:46
Example applescript to run a sequence of commands in new Terminal tabs. In this case, running grunt js on paths relative to the applescript.
tell application "Finder"
activate
set this_folder to (the target of the front window) as alias
set dev_root to POSIX path of this_folder
set directories to {"directory1", "directory2", "directory3"}
tell application "Terminal"
activate
@kennethdavidbuck
kennethdavidbuck / select2.hbs
Created September 29, 2013 16:38
Example use of select2 with EmberJS.
{{view App.Select2View
class="table-combobox"
prompt="-- Related Database Tables"
contentBinding="table.paceTables"
optionLabelPath="content.label"}}
App.SwagProductDetailsView = App.BaseView.extend({
cssProperties:['width'],
_selectedObserver:function(){
"use strict";
var show = this.get('current.id') === this.get('item.id');
var width = show ? '326px' : '0px';
this.setProperties({ width:width, duration:300 });
}.observes('current.id','item.id').on('didInsertElement')
});
@kennethdavidbuck
kennethdavidbuck / initializers.js
Created September 8, 2013 20:43
dynamic ember app creation
/*
* Application Initialization
*/
App.initializer({
name: 'bootstrap',
initialize: function(container, application) {
"use strict";
App.deferReadiness();
var store = DS.get('defaultStore'),
@kennethdavidbuck
kennethdavidbuck / initializers.js
Created September 8, 2013 20:41
dynamic route created
/**
* Dynamically create routes
*/
App.Router.map(function(){
this.resource('browse',function(){
this.resource(table.plural,function(){
this.route('add');
this.route('query',{ path:'/:query_string' });
});
});
"project":{"id":"1","name_of":"Santa Rosa","code":"SR","leader_id":"3","comments":null,"time_stamp_add":"2013-05-22 00:00:00","time_stamp_edit":"2013-05-25 19:51:14","user_add_edit":"pacelab","parent_id":"1","codes_season_ids":"[1,3,7,2,8,4,5,10,11,6,9,12,13]","age_sex_class_cutoff_ids":"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15]","collar_ids":null,"ethogram_ids":null,"ficus_ids":"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,11","gps_point_ids":"[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,
<?php
namespace Api;
class Metum {
/**
* Table Field metadata
*/
public static function fields($table)
<?php
namespace Api;
class Cinder extends Metum {
/**
*
*/
public static function find($table,$id,$root = false)
{