Skip to content

Instantly share code, notes, and snippets.

View GavinJoyce's full-sized avatar

Gavin Joyce GavinJoyce

View GitHub Profile
@GavinJoyce
GavinJoyce / gist:6403776
Created September 1, 2013 11:06
Run Loop Metrics Bookmarklet
javascript:(function(){
var getTimestamp = function() { return new Date().getTime(); };
if (window.performance.now) {
getTimestamp = function() { return window.performance.now(); };
} else if (window.performance.webkitNow) {
getTimestamp = function() { return window.performance.webkitNow(); };
}
var startTime, endTime, loopCount = 0;
@GavinJoyce
GavinJoyce / pr.md
Created October 5, 2013 08:29 — forked from piscisaureus/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@GavinJoyce
GavinJoyce / application.controller.js
Last active January 21, 2016 20:10
concatenatedProperties
import Ember from 'ember';
//the foods array will concatinate, the colours are replaced
let Animal = Ember.Object.extend({
concatenatedProperties: ['foods'],
colours: ['white'],
foods: ['milk']
});
@GavinJoyce
GavinJoyce / application.controller.js
Created February 1, 2016 21:33 — forked from jakedetels/application.controller.js
Template registration issue
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
myComponentName: null,
actions: {
registerComponent() {
let template = Ember.Handlebars.compile('<b>First x-foo</b>');
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle',
myComponentName: null,
actions: {
registerComponent() {
let template = Ember.Handlebars.compile('<b>First x-foo</b>');
@GavinJoyce
GavinJoyce / application.controller.js
Created February 1, 2016 22:08 — forked from brendan-rius/application.controller.js
intermediateTransitionTo()
import Ember from 'ember';
export default Ember.Controller.extend({
appName:'Ember Twiddle'
});
import Ember from 'ember';
export default Ember.Controller.extend({
enabled: false,
trueValue: 'T',
falseValue: 'F'
});
import Ember from 'ember';
export default Ember.Controller.extend({
enabled: false,
items: ['a'],
isNotEmpty: Ember.computed.notEmpty('items'),
actions: {
addItem: function() {
this.get('items').pushObject('another');
1. Install http://dynamic.telestream.net/downloads/download-desktop-presenter.asp?prodid=desktoppresenter
@GavinJoyce
GavinJoyce / gist:7525dd28efde68ff2a8e
Created February 14, 2016 22:25
ableton push colors
var midi = require('midi');
var input = new midi.input();
for(var i=0; i<input.getPortCount(); i++) {
console.log(`PORT ${i}: ${input.getPortName(i)}`);
}
////