Skip to content

Instantly share code, notes, and snippets.

View mrloop's full-sized avatar

Ewan McDougall mrloop

View GitHub Profile
@mrloop
mrloop / enable_custom_http_headers-v3.patch
Created June 6, 2011 09:33
Copy of patch for custom headers in httperf 0.9.0 including setting custom user agent
/* from http://code.google.com/p/httperf/issues/detail?id=1 */
Index: configure.ac
===================================================================
--- configure.ac (revision 132)
+++ configure.ac (working copy)
@@ -83,6 +83,8 @@
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getopt_long])
@mrloop
mrloop / gist:2953982
Created June 19, 2012 12:51
ember data for jsfiddle
// ==========================================================================
// Project: Ember Data
// Copyright: ©2011 Living Social Inc. and contributors.
// License: Licensed under MIT license (see license.js)
// ==========================================================================
(function(a){window.DS=Ember.Namespace.create()})({}),function(a){DS.Adapter=Ember.Object.extend({commit:function(a,b){b.updated.eachType(function(b,c){this.updateRecords(a,b,c.slice())},this),b.created.eachType(function(b,c){this.createRecords(a,b,c.slice())},this),b.deleted.eachType(function(b,c){this.deleteRecords(a,b,c.slice())},this)},createRecords:function(a,b,c){c.forEach(function(c){this.createRecord(a,b,c)},this)},updateRecords:function(a,b,c){c.forEach(function(c){this.updateRecord(a,b,c)},this)},deleteRecords:function(a,b,c){c.forEach(function(c){this.deleteRecord(a,b,c)},this)},findMany:function(a,b,c){c.forEach(function(c){this.find(a,b,c)},this)}})}({}),function(a){DS.fixtureAdapter=DS.Adapter.create({fi
@mrloop
mrloop / gist:2953983
Created June 19, 2012 12:51
ember data for jsfiddle
(function(exports) {
window.DS = Ember.Namespace.create();
})({});
(function(exports) {
DS.Adapter = Ember.Object.extend({
commit: function(store, commitDetails) {
@mrloop
mrloop / temp.json
Created November 22, 2012 18:23
temp
{
"basePath": "http://api-sentiment.3scale.net",
"apiVersion": "v1",
"apis": [
{
"path": "/v1/word/{word}.json",
"operations": [
{
"httpMethod": "GET",
"summary": "Returns the sentiment value of a given word",
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.0'
# Use sqlite3 as the database for Active Record
gem 'sqlite3'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
/*! Video.js v4.3.0 Copyright 2014 Brightcove, Inc. https://github.com/videojs/video.js/blob/master/LICENSE */
(function() {var b=void 0,f=!0,h=null,l=!1;function m(){return function(){}}function p(a){return function(){return this[a]}}function r(a){return function(){return a}}var t;document.createElement("video");document.createElement("audio");document.createElement("track");function u(a,c,d){if("string"===typeof a){0===a.indexOf("#")&&(a=a.slice(1));if(u.va[a])return u.va[a];a=u.u(a)}if(!a||!a.nodeName)throw new TypeError("The element or ID supplied is not valid. (videojs)");return a.player||new u.Player(a,c,d)}
var videojs=u;window.Wd=window.Xd=u;u.Qb="4.3";u.Dc="https:"==document.location.protocol?"https://":"http://";u.options={techOrder:["html5","flash"],html5:{},flash:{},width:300,height:150,defaultVolume:0,children:{mediaLoader:{},posterImage:{},textTrackDisplay:{},loadingSpinner:{},bigPlayButton:{},controlBar:{}},notSupportedMessage:'Sorry, no compatible source and playback technology were found for
@mrloop
mrloop / gist:f0718abf498d4ad627ba
Last active August 29, 2015 14:06
Promises and dragStart options
dragStart: (ev)->
myPromise.then (data)=>
ev.dataTransfer.setData('application/json', data)
#INSTALL node on your system
sudo npm install -g ember-cli
sudo npm install -g bower
ember new my-project
cd my-project
bower install
bower ember-cli-shims#0.0.3 not-cached git://github.com/stefanpenner/ember-cli-shims.git#0.0.3
bower ember-cli-shims#0.0.3 resolve git://github.com/stefanpenner/ember-cli-shims.git#0.0.3
Em.Handlebars.helper 'readable-date', (date, options)->
defaultFormat = "DD MMM YYYY h:mma"
str = moment(date).format(defaultFormat)
new Ember.Handlebars.SafeString(str)