Skip to content

Instantly share code, notes, and snippets.

View Aaronius's full-sized avatar

Aaron Hardy Aaronius

View GitHub Profile
@squeedee
squeedee / LoggingCommandMap.as
Created August 1, 2010 20:58
Really Helpful commandMap logging for your Robotlegs apps
package com.visfleet.robotlegs {
import com.visfleet.core.isNotNull;
import flash.events.Event;
import flash.events.IEventDispatcher;
import mx.logging.ILogger;
import mx.logging.Log;
@jrburke
jrburke / apiexamples.js
Created April 7, 2011 05:50
Description of browser-friendly module APIs: AMD and Loader Plugins
//*******************************************
// Level 1, basic API, minimum support
//*******************************************
/*
Modules IDs are strings that follow CommonJS
module names.
*/
//To load code at the top level JS file,
//or inside a module to dynamically fetch
@jed
jed / LICENSE.txt
Created May 20, 2011 13:27 — forked from 140bytes/LICENSE.txt
generate random UUIDs
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Jed Schmidt <http://jed.is>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@Mithrandir0x
Mithrandir0x / gist:3639232
Created September 5, 2012 16:15
Difference between Service, Factory and Provider in AngularJS
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@mxriverlynn
mxriverlynn / createObject.js
Created October 26, 2012 14:30
An Object.create wrapper / shim for MarionetteJS
// Helpers
// -------
// For slicing `arguments` in functions
var slice = Array.prototype.slice;
// Borrow the Backbone `extend` method so we can use it as needed
Marionette.extend = Backbone.Model.extend;
// A wrapper / shim for `Object.create`. Uses native `Object.create`
@shogun70
shogun70 / gist:5388420
Last active November 6, 2017 20:02
Log `document.readyState` for various stages of markup parsing and events.
<!DOCTYPE html>
<script type="text/javascript">
var addEvent = document.addEventListener ?
function(node, name, fn) { node.addEventListener(name, fn, false); } :
function(node, name, fn) { node.attachEvent('on' + name, fn); }
var begin = +new Date;
var log = [];
log.push('Event, Time: readyState, EOF');
function logEvent(name) {
@iammerrick
iammerrick / Result
Created May 4, 2013 22:10
Angular.js + MessageFormat.js
-----------
Hello!
-----------
You have 5 messages.
-----------
*******
@staltz
staltz / introrx.md
Last active November 14, 2024 11:27
The introduction to Reactive Programming you've been missing
@sebmarkbage
sebmarkbage / lower-case-convention.md
Last active October 8, 2024 14:30
React JSX - Lower Case

Lower Case JSX Convention

All lower case JSX tags will now be treated as HTML/SVG elements. They will no longer be treated as custom components in scope.

The React element produced by JSX can be either a React class that exists in the local scope or a global scope HTML/SVG element depending on a convention.

Previous Behavior

Currently, when you use React JSX to define a HTML element you can use any known HTML tag. E.g:

@SimplGy
SimplGy / anchorize-jekyll-headings.js
Last active October 31, 2022 17:20
For every heading in your page, this adds a little anchor link `#` that you can click to get a permalink to the heading. No dependency on jQuery or anything else. Requires that your headings already have an `id` attribute set (because that's what jekyll does)To use it, just drop it in the layout you use for your blog pages. You can style `.deepL…
(function(){
'use strict';
/*
Create intra-page links
Requires that your headings already have an `id` attribute set (because that's what jekyll does)
For every heading in your page, this adds a little anchor link `#` that you can click to get a permalink to the heading.
Ignores `h1`, because you should only have one per page.
The text content of the tag is used to generate the link, so it will fail "gracefully-ish" if you have duplicate heading text.
*/