Skip to content

Instantly share code, notes, and snippets.

View neonstalwart's full-sized avatar

Ben Hockey neonstalwart

  • google.com
  • Boulder, CO
View GitHub Profile
@neonstalwart
neonstalwart / imported.less
Created October 15, 2010 17:54
testing less importing
/* empty */
@neonstalwart
neonstalwart / foo.js
Created December 1, 2010 16:19
requirejs build error - ReferenceError: "foo" is not defined.
(function () {
var foo = {
bar: 'baz'
}
define('foo', [], foo);
}());
@neonstalwart
neonstalwart / issue132.diff
Created December 3, 2010 19:55
fix for less.js issue 132
diff --git a/lib/less/tree/url.js b/lib/less/tree/url.js
index 33b05b9..f53f1ea 100644
--- a/lib/less/tree/url.js
+++ b/lib/less/tree/url.js
@@ -14,8 +14,15 @@ tree.URL = function (val, paths) {
};
tree.URL.prototype = {
toCSS: function () {
- return "url(" + (this.attrs ? 'data:' + this.attrs.mime + this.attrs.charset + this.attrs.base64 + this.attrs.data
- : this.value.toCSS()) + ")";
@neonstalwart
neonstalwart / dojo.build.js
Created December 7, 2010 18:52
building dojo with require.js
({
// base url, relative to appDir
baseUrl: './',
// output directory, relative to this file
dir: './build',
// closure, closure.keepLines, none
optimize: 'closure',
define([
'dojo',
'./mustache'
], function (d, mustache) {
var dfe = d.forEach,
empty = {};
return d.declare(null, {
declaredClass: 'mustache_Templated',
@neonstalwart
neonstalwart / requirejs.diff
Created February 1, 2011 21:19
requirejs sync plugin loading support
diff --git a/require.js b/require.js
old mode 100644
new mode 100755
index 9147d58..4341bad
--- a/require.js
+++ b/require.js
@@ -254,7 +254,7 @@ var require, define;
if (prefix) {
prefix = normalize(prefix, parentName);
//Allow simpler mappings for some plugins
Environment:
Request Method: POST
Request URL: http://dev04.cello.com:8000/admin/cms/page/4/?language=en&
Django Version: 1.2.5
Python Version: 2.7.1
Installed Applications:
['django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
@neonstalwart
neonstalwart / define-node.js
Created April 22, 2011 13:46 — forked from kriszyp/define-node.js
Add AMD/define() support to NodeJS
// Credit: this is derived from a combination of
// - https://gist.github.com/650000
// - https://github.com/joyent/node/pull/350
// - https://github.com/ajaxorg/cloud9/blob/master/support/requireJS-node.js
var path = require('path'),
fs = require('fs'),
defaultCompile = module.constructor.prototype._compile,
defaultResolveFilename = module.constructor._resolveFilename,
// this gives the main module a chance to use define iff it does so before any other module
@neonstalwart
neonstalwart / foo_bar_one.js
Created May 20, 2011 13:44
relative module id resolution
// foo/bar/one.js
define(['./two'], function (two) {
return {
two: two
};
});
define([
'dojo',
'dijit/_Widget',
'./_base',
'dojo/query!css3'
], function (d, _Widget, mustache, query) {
//'use strict';
var dfe = d.forEach,
empty = {};