Skip to content

Instantly share code, notes, and snippets.

View straydogstudio's full-sized avatar

Noel Peden straydogstudio

View GitHub Profile
@the55
the55 / raphael.arcs.js
Created February 5, 2011 18:26
2 raphael arc objects
// http://www.w3.org/TR/SVG/paths.html#PathDataEllipticalArcCommands
Raphael.fn.arc = function(startX, startY, endX, endY, radius1, radius2, angle) {
var arcSVG = [radius1, radius2, angle, 0, 1, endX, endY].join(' ');
return this.path('M'+startX+' '+startY + " a " + arcSVG);
};
Raphael.fn.circularArc = function(centerX, centerY, radius, startAngle, endAngle) {
var startX = centerX+radius*Math.cos(startAngle*Math.PI/180);
var startY = centerY+radius*Math.sin(startAngle*Math.PI/180);
var endX = centerX+radius*Math.cos(endAngle*Math.PI/180);
@mbostock
mbostock / .block
Last active February 9, 2016 00:41
Sunburst with Distortion
license: gpl-3.0
@Aeon
Aeon / adapters-application.js
Last active March 21, 2016 18:50
faye adapter for ember-data
require('config/adapters/faye-adapter');
export default DS.FayeAdapter.extend();
@givanse
givanse / after-render.js
Last active May 22, 2016 15:26
afterRenderEvent mixin
import Ember from 'ember';
export default Ember.Mixin.create({
/*
This hook is guaranteed to be executed when the root element of this view has been inserted into the DOM.
*/
didInsertElement : function(){
this._super();
Ember.run.scheduleOnce('afterRender', this, this.afterRenderEvent);
@sheldonbaker
sheldonbaker / 1-policy.coffee
Last active June 24, 2016 02:37
s3 image upload with ember-data - requires a Policy model (required by Amazon for browser uploads) generated by your server
`import DS from 'ember-data'`
# https://aws.amazon.com/articles/1434
Policy = DS.Model.extend
key: DS.attr('string')
bucket: DS.attr('string')
acl: DS.attr('string')
'AWSAccessKeyId': DS.attr('string')
'Content-Type': DS.attr('string')
import Ember from 'ember';
export default Ember.Component.extend({
theme: Ember.inject.service()
// ...
});
@kellec
kellec / examples-and-output.css
Created April 12, 2012 02:10
a LESS mixin for versatile gradients (with IE support)
/* Basic two stop gradient */
.example-gradient {
.linear-gradient(150deg, #eee, #aaa);
}
/* Outputs */
.example-gradient {
background: -webkit-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -moz-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -ms-linear-gradient(150deg, #EEE 0%, #AAA 100%);
background: -o-linear-gradient(150deg, #EEE 0%, #AAA 100%);
@m19
m19 / gist:31606a34f1ac89ed612d
Created May 13, 2014 18:11
Ember Data Sails Adapter
(function() {
/*global Ember*/
/*global DS*/
/*global io*/
/*global _*/
'use strict';
var RSVP = Ember.RSVP;
var get = Ember.get;
@m19
m19 / gist:929475e8d26411abc091
Created May 13, 2014 18:12
Ember Sails Serializer
App.ApplicationSerializer = DS.RESTSerializer.extend({
/**
The current ID index of generated IDs
@property
@private
*/
_generatedIds: 0,
/**
Sideload a JSON object to the payload
@flaviaza
flaviaza / README.txt
Created September 21, 2012 18:08 — forked from i-scorpion/README.txt
Twitter bootstrap fixed table header using jQuery
Here is a simple jQuery plugin to make a table header fixed on top of a div when this is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<div class="row fixed-table">
<div class="table-content">
<table class="table table-striped table-fixed-header" id="mytable">
<thead class="header">
<tr>
<th>Email Address</th>