Skip to content

Instantly share code, notes, and snippets.

View kfranqueiro's full-sized avatar

Kenneth G. Franqueiro kfranqueiro

View GitHub Profile
@kfranqueiro
kfranqueiro / metalsmith-symbolset.js
Created May 13, 2014 02:13
Code that can be run on metalsmith.io to dump the symbolset icons at the bottom of the page, with title-text indicating what `icon` value to use for each one in `plugins.json`.
[
'ss-cursor',
'ss-crosshair',
'ss-search',
'ss-zoomin',
'ss-zoomout',
'ss-view',
'ss-attach',
'ss-link',
'ss-unlink',
@kfranqueiro
kfranqueiro / store.css
Created November 22, 2014 18:04
Less Annoying Steam Store
/* Discovery Queue should DIAFplzkthx */
.discovery_queue_ctn {
display: none !important;
}
@kfranqueiro
kfranqueiro / forDocument.ts
Last active August 29, 2015 14:18
forDocument example in TypeScript
function forDocument(ownerDocument: Document) {
return lang.partial(this, ownerDocument);
}
var byId:{
(ownerDocument: Document, id: string);
forDocument: (ownerDocument: Document) => (id: string) => Node;
} = <any> function (ownerDocument, id) {
return ownerDocument.getElementById(id);
}
@kfranqueiro
kfranqueiro / test.html
Created June 18, 2015 22:26
Test case for Dojo loader inconsistency issue in IE < 11
<!DOCTYPE html>
<html>
<body>
<script>
var dojoConfig = {
async: true,
baseUrl: "",
tlmSiblingOfDojo: false
};
</script>
// 1: how could you rewrite the following to make it shorter?
if (foo) {
bar.doSomething(el);
} else {
bar.doSomethingElse(el);
}
// 1A:
bar[foo ? 'doSomething' : 'doSomethingElse'](el);
@kfranqueiro
kfranqueiro / ParentHierarchical.js
Created March 29, 2011 12:39
Possibly-naive attempt at a generic dojo.store wrapper supporting getChildren, via parent relationships.
/*
NOTE: This wrapper "works", but is sorta incomplete...
* It does not explicitly support deterministic ordering/rearrangement of children.
* For that matter, the way Tree currently achieves this seems sort of obtuse.
Tree makes a blatant assumption on the existence of a children attribute
(since there is no dedicated method to set them), and reconstructs the array
every time children are reordered...
@kfranqueiro
kfranqueiro / test59.html
Created January 5, 2012 04:59
Test page attempting to reproduce dgrid issue #59
<!DOCTYPE html>
<html>
<head>
<title>Test Issue #59</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="viewport" content="width=570"/>
<style type="text/css">
@import "../../dijit/themes/claro/document.css";
@import "../../dijit/themes/claro/claro.css";
@import "../css/dgrid.css";
@kfranqueiro
kfranqueiro / test.html
Created September 13, 2012 01:01
Test for dgrid #277
<!DOCTYPE html>
<html>
<head>
<style>
#hierarchyTree {
height: 200px;
}
#hierarchyTree .dgrid-cell {
width: 100px;
@kfranqueiro
kfranqueiro / enterUp.js
Created February 22, 2013 21:02
Example of a dojo/on extension event that fires when the enter key is released
function enterUp(node, listener) {
return on(node, "keyup", function(evt) {
if (evt.keyCode === 13) {
listener.call(this, evt);
}
});
}
// Usage with dojo/on: on(element, enterUp, ...)
// Usage with dgrid editor: editor({ editOn: enterUp, ... })
@kfranqueiro
kfranqueiro / MoreMixin.html
Created March 15, 2013 04:22
Example of extending dgrid's `_StoreMixin` to present a list or grid progressively, one page at a time.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../../dojo/resources/dojo.css">
<link rel="stylesheet" href="../../dgrid/css/skins/claro.css">
<style>
#list {
border: none;
height: auto;