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 / form.html.rb
Created August 16, 2012 15:00
Example of a premade form in RoR3.
<%= form_for(@user) do |f| %>
<% if @user.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
<ul>
<% @user.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
</ul>
@kennethdavidbuck
kennethdavidbuck / convolve_isa.c
Created November 30, 2012 02:53
convolve_isa.h
/*
* convolve_isa.c
*
*
* Created by Kenneth Buck on 12-11-27.
* Copyright 2012 University of Calgary. All rights reserved.
*
*/
/* Include Files */
/*
* convolve.c
*
*
* Created by Kenneth Buck on 12-11-27.
* Copyright 2012 University of Calgary. All rights reserved.
*
*/
/* Include Files */
<?php
namespace Api;
class Cinder extends Metum {
/**
*
*/
public static function find($table,$id,$root = false)
{
<?php
namespace Api;
class Metum {
/**
* Table Field metadata
*/
public static function fields($table)
"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,
@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' });
});
});
@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'),
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 / 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"}}