Skip to content

Instantly share code, notes, and snippets.

View Flixbox's full-sized avatar
💭
Probably developing right now

Felix Tietjen Flixbox

💭
Probably developing right now
View GitHub Profile
@dancameron
dancameron / chartjs_responsive_ajax_example.html
Last active May 8, 2018 14:10
Responsive Chart.js Example with AJAX Callback
<canvas id="invoice_status_chart" min-height="300" max-height="500"></canvas>
<script type="text/javascript" charset="utf-8">
var invoice_status_data = {};
function invoice_status_chart() {
var can = jQuery('#invoice_status_chart');
var ctx = can.get(0).getContext("2d");
var container = can.parent().parent(); // get width from proper parent
@desandro
desandro / require-js-discussion.md
Created January 31, 2013 20:26
Can you help me understand the benefit of require.js?

I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.

From Require.js - Why AMD:

The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"

I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.


@andrewdavey
andrewdavey / Object.inherit.js
Created July 3, 2012 14:15
Simple object inheritance in JavaScript
(function () {
"use strict";
var copyOwnProperties = function (from, to) {
for (var propertyName in from) {
if (from.hasOwnProperty(propertyName)) {
to[propertyName] = from[propertyName];
}
}
};