Skip to content

Instantly share code, notes, and snippets.

View cowsrule's full-sized avatar
🌧️
Seattle

Grant Watters cowsrule

🌧️
Seattle
  • Convoy
  • Seattle, WA
View GitHub Profile
var reader = new FileReader();
reader.readAsBinaryString(fileData);
reader.onload = function (e)
{
var contentType = fileData.type || MimeTypes.Unknown;
var runUpload = function (folderID)
{
define(function (require, exports, module)
{
var g = require('globals'),
C = require('Constants'),
goog = require('goog'),
AccountManager = require('AccountManager');
function DriveUploader(file, email, onProgress, onComplete, onError)
{
self.JSONP = function (params)//(url, data, method, callback)
{
self.Assert(params.url, 'Must supply a valid URL to fetch');
self.Assert(params.cb, 'Must supply a valid callback');
var url = params.url;
var data = params.data;
var cb = params.cb;
if (data)
@cowsrule
cowsrule / gist:6348393
Last active December 21, 2015 18:38
Inspect Remote
window.log = console.log.bind(console);
window.inspectRemote = function(input)
{
if (!input)
{
log('Must specify either an item ID or item object to inspect');
return;
}
@cowsrule
cowsrule / KOTemplateCache.js
Last active December 17, 2015 16:59
A simple plugin for knockout.js that caches DOM nodes created for named templates. Knockout JS Template Cache
define(['ko'],
function (ko) {
var self = { };
var cachedTemplatesDomDataKey = "__cached_template__";
//
// When rendering a template, a source is what returns either the text or the already-created DOM
// nodes to clone. The default implementation of a template source in knockout doesn't cache the
// DOM nodes that it creates, and instead requests the text of the <script> tag the template is