Skip to content

Instantly share code, notes, and snippets.

<script>
var dojoConfig = {
packages: [
{
name: 'storehouse',
location: '../storehouse'
}
]
};
</script>
@jensarps
jensarps / gplus-comments.html
Created April 24, 2013 17:20
Use this markup to add Google+ comments to your blog/whatever. Oh, and don't forget to put the width and url in there.
<div class="g-comments"
data-href="{put-your-url-here}"
data-width="{put-your-container-width-here}"
data-first_party_property="BLOGGER"
data-view_type="FILTERED_POSTMOD"
></div>
<script type="text/javascript">
(function() {
var gp = document.createElement('script'); gp.type = 'text/javascript'; gp.async = true;
@jensarps
jensarps / closure-compiler-config-2.js
Last active December 20, 2015 03:19
Snippets from my post on creating dynamic/configurable builds with Grunt and Closure Compiler.
//configure closure compiler
var closureFiles = handlerClassNames.map(function (name) {
return 'src/' + name + '.js';
});
closureFiles.unshift('src/InputController.js');
closureFiles.push('build/bundle.js');
/* ... */
grunt.config.set('closure-compiler.bundle', {
closurePath: 'lib/closure',
jsOutputFile: 'build/input-controller.js',
@jensarps
jensarps / reflect.js
Created July 22, 2015 12:10
A reflection function to (recursively) print object members onto the console
var _reflect = function reflect (it, recursive, level) {
level = ~~level;
var indent = (' >').repeat(level),
isObject = function (candidate) { return Object.prototype.toString.call(candidate) == '[object Object]'};
if (level > 1) {
console.log(indent + ' recursion too deep, stopping.');
return;
}
@jensarps
jensarps / detectIDB.js
Last active April 16, 2019 12:35
Script to detect buggy IndexedDB implementations
(function (name, definition, global) {
if (typeof define === 'function') {
define(definition);
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = definition();
} else {
global[name] = definition();
}
})('detectIDB', function () {