Skip to content

Instantly share code, notes, and snippets.

View whitmanc's full-sized avatar

Chris Whitman whitmanc

View GitHub Profile
#
# THE HTML
#
<div class="modal in" id="myStorybooksModal">
<div class="modal-header">
<h3 id="modal-title">
Create or Open App...
</h3>
</div>
<div class="modal-body" id="storybooks">
exercise.Activities = Backbone.Collection.extend({
model: exercise.Activity,
url: "exercise.json",
comparator: function(activity){
var date = new Date(activity.get('date'));
return date.getTime();
}
});
exercise.ActivityListView = Backbone.View.extend({
tagName: 'ul',
id: 'activities-list',
attributes: {"data-role": 'listview'},
initialize: function() {
this.collection.bind('add', this.add, this);
this.template = _.template($('#activity-list-item-template').html());
},
exercise.ActivityListView = Backbone.View.extend({
tagName: 'ul',
id: 'activities-list',
attributes: {"data-role": 'listview'},
initialize: function() {
this.collection.bind('add', this.render, this);
this.template = _.template($('#activity-list-item-template').html());
},
var t = $(this);
if (!(t.hasClass("scene") || t.hasClass("keyframe") || t.hasClass("edit-text") || t.hasClass("disabled") || t.hasClass("images"))) {
// codes
}
We couldn’t find that file to show.
@whitmanc
whitmanc / gist:2869427
Created June 4, 2012 16:32
Disable jquery-file-upload
$('#fileupload').fileupload('disable');
$('#fileupload').fileupload('enable');
var strDataURI = oCanvas.toDataURL();
// returns "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAYAAACt..."
view plaincopy to clipboardprint?
var strDataURI = oCanvas.toDataURL("image/jpeg");
// returns "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAA..."
Canvas2Image.saveAsPNG(oCanvas); // will prompt the user to save the image as PNG.
@whitmanc
whitmanc / gist:2973169
Created June 22, 2012 14:43
jQuery force HTTP PUT method
$.ajax({
...
beforeSend: function(xhr)
{
xhr.setRequestHeader("X-Http-Method-Override", "PUT");
}
});
$ cap deploy:cold
* executing `deploy:cold'
* executing `deploy:update'
** transaction: start
* executing `deploy:update_code'
updating the cached checkout on all servers
executing locally: "git ls-remote [email protected]:whitmanc/sisbro.git master"
command finished in 6192ms
* executing "if [ -d /data/spree/shared/cached-copy ]; then cd /data/spree/shared/cached-copy && git fetch -q origin && git fetch --tags -q origin && git reset -q --hard c1ab496b2fd316e1dac3b2f2d08b842fe401a432 && git clean -q -d -x -f; else git clone -q [email protected]:whitmanc/sisbro.git /data/spree/shared/cached-copy && cd /data/spree/shared/cached-copy && git checkout -q -b deploy c1ab496b2fd316e1dac3b2f2d08b842fe401a432; fi"
servers: ["50.116.11.162"]