Skip to content

Instantly share code, notes, and snippets.

View rodneyrehm's full-sized avatar

Rodney Rehm rodneyrehm

View GitHub Profile
@rodneyrehm
rodneyrehm / gist:6f61a1340a0e27d37859
Created October 14, 2014 00:10
Some Questions regarding WAI ARIA

Question Regarding WAI ARIA

The Enter key should serve as the default submit action.

  • JS-free only possible through <form> and <button type="submit">?

@rodneyrehm
rodneyrehm / bc.function.js
Last active August 29, 2015 14:06
JavaScript: providing a backward compatibility layer for changed function names/signatures
/*
Figuring out how to provide a Backward Compatibility Layer
GOALS:
[aliasing] provide a function (nextGeneration) in another name (previousGeneration)
[parameters] the functions might differ in argument order (or length, …)
[warnings] log each access/mutation to the alias (previousGeneration) so old code bases can be cleaned up
*/
var myObject = {
@rodneyrehm
rodneyrehm / gist:40e7946c0cff68a31cea
Last active November 7, 2022 09:11
Diagrams for Documentation

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

@rodneyrehm
rodneyrehm / gist:760c81da6f0f713444a5
Created July 16, 2014 20:55
QUnit: why can't setup expose data to tests properly?
/*
Am I missing something here or is this really the way to go for a
module's setup function to expose something to the module's tests?
*/
(function() {
var filled_by_setup;
module('dummy module', {
setup: function() {
// prepare some data
filled_by_setup = Math.random();
@rodneyrehm
rodneyrehm / gist:f8a613f137799fb0a18b
Created July 16, 2014 13:43
URI.js jQuery plugin: make $.ajax() accept URI instances
$.ajax = (function(ajax) {
return function(url) {
if (url instanceof URI) {
arguments[0] = arguments[0].toString();
}
return ajax.apply($, arguments);
};
})($.ajax);
@rodneyrehm
rodneyrehm / gist:cccc240e54bdf3304fc5
Last active August 29, 2015 14:02
Question: Promise resolved handling
// Do you prefer alwaysWrapped() or wrappedWhenNeeded() for
// a method that depends on some promise being resolved?
function FooBar() {
this.ready = $.getJSON('something.funky');
}
FooBar.prototype.alwaysWrapped = function() {
return this.ready.then(function(){
// do something that returns a promise
@rodneyrehm
rodneyrehm / feedback.md
Last active August 29, 2015 14:01
WPDS Düsseldorf 2014 - JavaScript Group // http://wpd.mx/dusjs
@rodneyrehm
rodneyrehm / index.html
Last active August 29, 2015 13:56
rawgithub.com gist example - view HEAD at https://rawgithub.com/rodneyrehm/9020346/raw/index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>rawgithub.com gist demo</title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<h1>Hello world</h1>
@rodneyrehm
rodneyrehm / iscroll-docs.md
Last active January 2, 2016 15:39
Feedback on IScroll 5 docs

feedback on iscroll docs:

  • if the docs were a github repo, one could fix typos etc. by sending a PR. github pages are awesome and can be given their own domain. (DalekJS.com is a repo - no effort, no webspace, just DNS)
  • I'm missing an index / table-of-contents for the API (config options and callable methods)
  • I can't link to a config option (e.g. "options.click") directly. This made you put in comments like "see below" instead of a much more convenient link.
  • I generally find "basic features" and "advanced options" to be not very meaningful headlines / groups. If I'm reading the docs, I probably have no idea what is basic and what is advanced.
  • I don't mind multiple documents (one for API, one for concepts, one for suggestions, one for demos, …)
  • the file names in the many faces of iscroll could link to the respective files on github
  • I don't
@rodneyrehm
rodneyrehm / user-interaction-indirection.md
Last active January 2, 2016 15:29
Some notes on making user interaction a describable thing

Proposal for User Interaction Indirection

(formerly "Proposal for Enhanced Keyboard Interaction")

"Abstraction of user interaction by introduction command primitives"

originally I thought this would only mean something to the keyboard. But having an abstract concept of a "command" enables us to access the same actions via keyboard, voice, touch-gesture, etc. Probably the main problem is going to be "context". Which command is applicable to what kind of an element and in which situation is it even possible to execute the action.

TODO