Skip to content

Instantly share code, notes, and snippets.

View byronferguson's full-sized avatar

Byron Ferguson byronferguson

View GitHub Profile
@byronferguson
byronferguson / eventExport
Created October 27, 2015 15:20
#1242 subquery error on second SELECT run
SELECT post_date AS event_post_date,
post_title AS event_title,
fnStripTags(post_content) AS event_content,
CONCAT('http://www.kcstudio.org/event/',post_name) AS event_URL,
(SELECT meta_value FROM wp_postmeta WHERE wp_postmeta.meta_key = 'thumbnailURL' AND wp_postmeta.post_id = wp_posts.ID) AS event_thumbnail_URL,
(SELECT (CASE meta_value WHEN meta_value REGEXP '^[[:digit:]]+$' THEN meta_value ELSE CONCAT('$', meta_value) END ) FROM wp_postmeta WHERE wp_postmeta.meta_key = '_EventCost' AND wp_postmeta.post_id = wp_posts.ID) AS event_cost,
(SELECT DATE_FORMAT(meta_value, '%W') FROM wp_postmeta WHERE wp_postmeta.meta_key = '_EventStartDate' AND wp_postmeta.post_id = wp_posts.ID) AS event_start_day,
(SELECT DATE_FORMAT(meta_value, '%M %D, %Y') FROM wp_postmeta WHERE wp_postmeta.meta_key = '_EventStartDate' AND wp_postmeta.post_id = wp_posts.ID) AS event_start_date,
(SELECT TIME_FORMAT(meta_value, '%r') FROM wp_postmeta WHERE wp_postmeta.meta_key = '_EventStartDate' AND wp_postmeta.post_id = wp_po
'use strict';
angular.module('app.interview').controller('interviewCtrl', function ($scope, $stateParams, $modal) {
var vm = this;
vm.tooltip = '<h1>interviewPageTooltip <code>HTML</code></h1>';
vm.open = function () {
var modelInstance = $modal.open({
animation: true,
<section md-content id="main" role="main" layout="row" layout-align="space-around start" layout-padding>
<article flex="15" ui-view="body" style="background-color:red;" layout="column" layout-align="start center" layout-padding>
<img width="125" height="125">
<h4 class="md-subhead">Byron Ferguson</h4>
Olathe South High School
</article>
<article flex="50" ui-view="body" style="background-color:orange;" layout="column" layout-align="start center" layout-padding>
<section class="md-whiteframe-z1">
<md-toolbar class="md-primary md-default-theme">
{
"prebuild": [
"angular",
"angular-ui-router",
"angular-utf8-base64",
"ng-fastclick"
],
"paths": {
<div ui-view="root">
<nav ui-view="navbar">NAV</nav>
<section ui-view="app">
<main ui-view="content">CONTENT</main>
<aside ui-view="sidebar">SIDEBAR</aside>
</section>
<footer ui-view="footer">FOOTER</footer>
</div>
'use strict';
angular.module('app.student').controller('ccRecommendationsCtrl', function () {
this.showClusters = function() {
return this.recommendations.length;
};
this.showDisciplines = function(cluster) {
return cluster.disciplines.length;
@byronferguson
byronferguson / studentFactory.js
Created September 28, 2015 20:32
factory to generate RESTful API interface for DI into controllers
angular.module('cc.services').factory('studentFactory', function($http) {
var urlBase = '/api/v1/index.cfm/students';
var resourceFactory = {};
resourceFactory.getList = function() {
return $http.get(urlBase);
};
resourceFactory.getStudentByID = function(studentID) {
@byronferguson
byronferguson / Details.cfc
Last active September 28, 2015 19:22
Hiddens not being stripped \r\n
component extends="taffy.core.resource" taffy_uri="/students/{studentID:[0-9]+}/details" {
function get(required numeric studentID) {
try {
var proc = new storedProc();
//proc.setDatasource( "MyCCMajors" );
proc.setProcedure("generateReportDetailsByID");
proc.addParam(value=arguments.studentID, cfsqltype="cf_sql_integer");
@byronferguson
byronferguson / app.js
Last active September 21, 2015 20:00
ui-route oddly misbehaving somewhere
'use strict';
/**
* @ngdoc overview
* @name app [smartadminApp]
* @description
* # app [smartadminApp]
*
* Main module of the application.
*/
submitResponses: function() {
$.ajax({
url : postResponseURL(this.studentID),
method : 'POST',
dataType : 'json',
data : JSON.stringify(this.responseObject),
contentType : "application/json; charset=utf-8",
success : function(data, status) {
this.resetResponsePackage();
},