Skip to content

Instantly share code, notes, and snippets.

View ascsystems's full-sized avatar

David ascsystems

View GitHub Profile
def gender
if definable.gender
g = definable.gender[0,1].downcase
"(#{h.content_tag :i, g })"
else
''
end
end
<?php
$cache = $this->sm->get('cache');
$cache->replaceItem('mfgs', array('TYS','TEST','Test2'));
var_dump($cache->getItem('mfgs'));
?>
Gives me string(5) "Array"
I'm using this: http://framework.zend.com/apidoc/2.2/classes/Zend.Cache.Storage.Adapter.Redis.html
@ascsystems
ascsystems / annotations_controller.rb
Last active December 31, 2015 05:39
Can access all json params but "ranges"
class AnnotationsController < ApplicationController
def index
annotations = Annotation.all
render json: annotations
end
def show
annotation = Annotation.find(params[:id])
render json: annotation
class AnnotationsController < ApplicationController
def index
annotations = Annotation.all
render json: annotations
end
def show
annotation = Annotation.find(params[:id])
render json: annotation
class Annotation
include MongoMapper::Document
key :quote, String
key :text, String
key :ranges, Array
timestamps!
end
@ascsystems
ascsystems / gist:6542983
Created September 12, 2013 19:57
line 156 - Application.Section is not a constructor.
Application.Collection = Backbone.Collection.extend(
{
constructor : function () {
this.request = new Application.Request();
Backbone.Collection.apply(this, arguments);
},
responseModel : Application.Response,
responseEvents : {},
requestRoot : '_',
checkDub : false,
var href = $(this).attr('href');
$('.navbar-inner ul').filter(':visible').animate({ width:'0px' }, 1000, function(){
$(this).hide();
$('#' + href).show(function(){
$(this).animate({ width: '100%' }, 1000);
});
});
SELECT *
FROM `customers_master` c
INNER JOIN cust_list_misty cm ON cm.name1 = c.FULL_NAME
(function(Notification) {
var app = k12.app;
Notification.Model = Backbone.Model.extend({ });
Notification.NotificationCollection = Backbone.Collection.extend({
parse: function(response) {
return response;
}
(function(Notification) {
var app = k12.app;
Notification.Model = Backbone.Model.extend({ });
Notification.Collection = Backbone.Collection.extend({
model: Notification.Model,
url: '/api/notifications',
parse: function(response) {