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
diff --git a/lib/DAV/plugins/codesearch.js b/lib/DAV/plugins/codesearch.js
index 9d3f77b..d961af0 100644
--- a/lib/DAV/plugins/codesearch.js
+++ b/lib/DAV/plugins/codesearch.js
@@ -152,12 +152,12 @@ jsDAV_Codesearch_Plugin.MAXSIZE = 2097152; //2MB
if (!Util.isTrue(options.casesensitive))
cmd += " -i ";
var t,
- include = "*.{" + jsDAV_Codesearch_Plugin.PATTERN_EXT + "}";
+ include = "\\*.{" + jsDAV_Codesearch_Plugin.PATTERN_EXT + "}";
@neonstalwart
neonstalwart / try-catch.html
Created June 13, 2011 14:38
try/catch performance with requirejs
<!DOCTYPE html>
<html>
<head>
<script>
var testIterations = 1e5;
var benchmark = function(hint, m,i) {
var d1 = new Date, d2, r;
while(i--)
r = m();
/**
* @license Copyright (c) 2011 Cello Software, LLC.
* All rights reserved.
* Available via the new BSD License.
*/
/*jshint
bitwise: false, curly: true, eqeqeq: true, forin: true, immed: true, indent: 4, maxlen: 100,
newcap: true, noarg: true, noempty: true, onevar: true, passfail: false, undef: true,
white: true
*/
@neonstalwart
neonstalwart / wrapperStore
Created August 18, 2011 16:48 — forked from dmachi/wrapperStore
getting started with wrapping two stores with one
var store = function(substores,options){
return {
query: function(query, options){
return when(promise.all(substores.map(function (store) {
return when(store.query(query, options));
}), function (results) {
return results.reduce(function (out, arr) {
return out.concat(arr);
}, []);
@neonstalwart
neonstalwart / variables.less
Created September 22, 2011 19:28
claro theme simplified to a few variables (almost perfect match)
@claro-text: #000;
@claro-background: #fff;
// other colors are calculated based on these two
@claro-primary: #cfe5fa;
@claro-error: #d46464;
@neonstalwart
neonstalwart / sample.dojo.html
Created December 9, 2011 03:34
dojo npmish - off the top of my head
<script>
var require = {
// adjust to root of https://github.com/pmuellr/sample-npmish-project
baseUrl: 'npmish',
packages: [
{
name: 'a',
location: 'node_modules/a',
main: 'a.js',
packageMap: {
$ java -jar shrinksafe.jar test.js
define(["dojo/_base/declare","dojo/domReady"],function(_1,_2){
var _3,_4="",_5=function(_6){
_3.innerHTML=(_4+=_6+"<br>");
},A=_1(null,{go:function(){
_5("A");
}}),B=_1([A],{go:function longerName(){
this.inherited(_7,arguments);
_5("B");
}});
@neonstalwart
neonstalwart / test.html
Created April 9, 2012 15:28
dojo/hash in android
<!DOCTYPE html>
<html class="mobile dj_phone android_theme">
<head>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
<title>Populizr Mobile</title>
<link rel="stylesheet" href="populizr.css" type="text/css" />
<link rel="stylesheet" href="js/release/dojo/dojox/mobile/themes/android/android.css" type="text/css" />
</head>
<body>
@neonstalwart
neonstalwart / dylan.profile.js
Created May 30, 2012 21:26 — forked from dylans/dylan.profile.js
Build profile draft
function copyOnly(mid) {
return (/test/.test(mid) && mid !== 'dgrid/test/data/perf') || mid in {
// There are no modules right now in dojo boilerplate that are copy-only. If you have some, though, just add
// them here like this:
// 'app/module': 1
};
}
var profile = {
basePath: './',
@neonstalwart
neonstalwart / test.js
Created August 9, 2012 05:03
separated concerns (presentation model)
define([
'compose/compose',
'dojo/Stateful',
'dojo/on'
], function (compose, Stateful, on) {
// TODO:
// * need a helper like this.own to help manage handles from eg watch and on
// * need a lifecycle - at least destroy/dispose