Skip to content

Instantly share code, notes, and snippets.

@DigiTec
DigiTec / theme_incompatible_properties.css
Created December 23, 2015 02:52
List of properties which are theme incompatible for EdgeHTML. When setting these properties you will fall back from the Web Ruleset (read it as the modern control styling ruleset) to a much more basic set called the Base Ruleset with IE 11 mode specific overrides (Base+IE11) was our last set of updates, the two will be merged once a new update n…
/* At the time of first commit, each of thse properties was not immediately tested.
and each of the values using default is just to avoid typing a real value */
input {
/* pretty much any background change */
background: default;
background-color: default;
background-repeat: default;
background-position: default;
background-position-x: default;
background-position-y: default;
@DigiTec
DigiTec / webvr.Navigator.webidl
Last active December 20, 2015 23:13
Breakouts of the WebVR specification for embedding
partial interface Navigator
{
Promise<sequence<VRDevice>> getVRDevices();
}
@DigiTec
DigiTec / Flat_Data.json
Last active August 29, 2015 14:26
3 Days of Data Science Blog Entry Snippets
[
{ "iface" : "HTMLElement", "member": "className", "owner": "Jim" },
{ "iface" : "SVGElement", "member": "className", "owner": "Joe" },
{ "iface" : "SVGElement", "member": "style", "owner": "Jim" },
]
@DigiTec
DigiTec / readme.md
Last active August 29, 2015 14:23
FindNearbyWords Spoilers

Spoiler pages for the FindNearbyWords challenge

The goal of the exercise is to find an efficient way to take an existing word and lookup all words in a dictionary that differ from the original by only a single character. This is the kernel function for larger algorithmic problems like the Word Ladder, where you try to find the shortest route between two words, by changing one character at a time, and where each intermediate step must be in an intial dictionary of words.

Bruce Force

The simplest algorithm possible will take the input word and then compare it against every word in the dictionary, character by character, and count the differences. If the character differences between the word are just 1, then we add it to our list, otherwise we reject it. JavaScript has the Array.filter method which does precisely what we want and we just supply a function which returns true or false depending on if our criterion are met.

It is possible to optimize differsByOne further to get more benefits, but given t

@DigiTec
DigiTec / boilerplate.js
Last active August 29, 2015 14:23
Description of the FindNearbyWords Javascript Challenge
// @initialWord = DOMString
// @dictionary = sequence<DOMString>
// @@returns = sequence<DOMString>
var findNearbyWords = function (initialWord, dictionary) {
}
@DigiTec
DigiTec / event_init_dictionaries.webidl
Last active August 29, 2015 14:23
Samples for my event constructor series article at www.justrog.com
dictionary EventInit
{
boolean bubbles = false;
boolean cancelable = false;
};
dictionary UIEventInit : EventInit
{
Window? view = null;
long detail = 0;
@DigiTec
DigiTec / error_recovery.cpp
Last active August 29, 2015 14:23
Code Snippets for a short article or series on error recovery models and reliability
typedef unsigned long ErrorCode;
typedef void* MemoryHandle;
ErrorCode OutOfMemory = 0x1;
ErrorCode Success = 0x2;
ErrorCode TerribleFailure = 0x3;
void FreeHandle(MemoryHandle handle)
{
}
@DigiTec
DigiTec / Readme.md
Last active August 29, 2015 14:21
Browser Lexical Scope Functions created using inline event handlers.

Some additional JSFiddle links that I produced afterwards to experiment with timing around when the browser would create its scope chains. It turns out browsers don't tend to create scope chains until the first time the event is fired.

In this example we have a button in a form. We can check its scope first, then change it, then check it again to see one behavior. We can then change scope and execute it to see a different behavior. http://jsfiddle.net/oko08kaw/

This example switches us from one form to another, which is a slightly more complicated behavior but achieves similar results. http://jsfiddle.net/p7bu92jw/2/

@DigiTec
DigiTec / test_edgehtml_webkitprefixes.html
Last active August 29, 2015 14:21
This is a quick gist for examining the list of EdgeHTML supported webkit properties that can be run on any device. This helps to narrow down why certain properties were added since not all WebKit browsers support all of the properties. This list tends to be a union of Chrome 42+ and iOS 8 Safari.
<div id="log" style="whitespace: pre"></div>
@DigiTec
DigiTec / chrome_xhtml.js
Last active August 29, 2015 14:20
A gist of results mapping all known elements to prototypes for some set of browsers. To be updated periodically. Example fiddle. http://jsfiddle.net/sqmqzjjv/3/
var xhtml_tags_chrome_prototypes = {
"DOCTYPE": "HTMLUnknownElement",
"a": "HTMLAnchorElement",
"abbr": "HTMLElement",
"acronym": "HTMLElement",
"address": "HTMLElement",
"applet": "HTMLAppletElement",
"area": "HTMLAreaElement",
"article": "HTMLElement",
"aside": "HTMLElement",