Skip to content

Instantly share code, notes, and snippets.

View tim-smart's full-sized avatar

Tim tim-smart

View GitHub Profile
--langdef=js
--langmap=js:.js
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*\{/\1/,object/
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*function[A-Za-z0-9_$ \t]*\(/\1/,function/
--regex-js=/function[ \t]+([A-Za-z0-9_$]+)[ \t]*([^)])/\1/,function/
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*\[/\1/,array/
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*[^"]'[^']*/\1/,string/
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*[^']"[^"]*/\1/,string/
--regex-js=/([A-Za-z0-9_$]+)[ \t]*[:=][ \t]*[0-9]+/\1/,number/
db.get(stuff, function (error, results) {
// Do some stuff
db.get('bacon', getTheBacon);
});
var getTheBacon = function (error, results) {
// Do stuff