Skip to content

Instantly share code, notes, and snippets.

View annevk's full-sized avatar

Anne van Kesteren annevk

View GitHub Profile
@annevk
annevk / gist:7f83773f82d52c721664
Created September 16, 2014 16:49
Anne's email problem

I have annevk@annevk.nl which forwards to annevankesteren@gmail.com. I can email as annevk@annevk.nl but this sometimes causes issues and it is clear Gmail is spoofing the From header.

annevankesteren@gmail.com is my Hangouts and Google+ account ID. I do not want to lose my friends and history there.

I want annevk@annevk.nl to be my actual email address and either delete annevankesteren@gmail.com or make it Gmail-only and forward the email to annevk@annevk.nl. I also want annevk@annevk.nl to replace annevankesteren@gmail.com as my Hangouts and Google+ account ID, not losing any of the friends and history associated with it.

As far as I can tell there is no way I can get this. 😟

To be crystal clear, this is an idea, not a proposal.

The motivation is solving the custom element upgrade step through JavaScript, while also allowing other syntaxes to be mixed with HTML if so desired. The macro element generates a sequence of tokens that can be processed by JavaScript.

document.getMacro().then(function(macro) {
  // This should probably be asynchronous so large macros can be done incrementally
  for(let token of macro.tokens) {
    // Let's build a tree, or reparse tokens Markdown-style...
    ...

}

@annevk
annevk / gist:cd58b3e45f399672004a
Last active August 29, 2015 14:13
Custom elements: "Jonas" vs "Dmitry"

The Jonas proposal is to have a normal JavaScript subclass:

class MyElement extends HTMLElement {
  constructor(htmlElementConstructorOptions, ...extraArgs) {
    super(htmlElementConstructorOptions);
    // initialization code here, potentially using extraArgs for non-parser cases
  }
}

The catch is that while parsing you need to do bookkeeping when you encounter custom elements (those with a dash) and then construct and insert them at a later point. This does not quite explain the platform:

@annevk
annevk / gist:56e97115f2c9c2e90c23
Last active August 29, 2015 14:15
Controlling a fetch

A Request object is needed to fetch. A Response object is the result. fetch() starts the process. How do we control it?

  1. fetch(req); req.abort()
  2. var f = fetch(req); f.abort() (subclassing promises seems to clash with upcoming async/await syntax)
  3. fetch(req, handle(a) { a() })
  4. fetch(req, { control:true }).then(con) { con.abort() } (fetch() would resolve immediately; control object would also have con.response or some such returning a promise)
  5. var c = req.send(); c.abort() } (get the control object synchronously)
  6. fetchRegistry.last.abort() (have some kind of global registry for all fetches made within the environment)
@annevk
annevk / credit.md
Last active August 29, 2015 14:19
Imperative Distribution

After Ryosuke, Travis, Wilson, William, and I discussed the problem for an hour over a burrito, William came up with this approach. All hail William.

{
"BOOKS": {
"authors": ["Håkon Wium Lie"],
"href": "https://books.spec.whatwg.org/",
"title": "CSS Books"
},
"DIFFERENCES": {
"authors": ["Simon Pieters"],
"href": "https://html-differences.whatwg.org/",
"title": "Differences from HTML4"
@annevk
annevk / relativeurltestdata.txt
Created June 16, 2015 15:03
relative URL tests
# a set of tests designed by zcorpan for relative URLs
i sc:sd
i sc:sd/sd
i sc:/pa/pa s:sc p:/pa/i
i sc://ho/pa s:sc h:ho p:/i
i sc:///pa/pa s:sc h: p:/pa/i
../i sc:sd
../i sc:sd/sd
../i sc:/pa/pa s:sc p:/i
../i sc://ho/pa s:sc h:ho p:/i
@annevk
annevk / gist:722491359ba366dd81aa
Created June 29, 2015 08:37
Basic fetch flow
Drastic simplification of the browser networking model.
API (<img>, <script>, XMLHttpRequest, fetch(), etc.)
Creates a request with various settings
Invokes Fetch with that request
Uses the returned response in various ways.
Fetch (takes a request, returns a response)
If scheme is not http/https, follow scheme-specific rules to create a response.
If there's a service worker (and this invocation of Fetch did not come from a service worker), invoke Service worker.
@annevk
annevk / sole.txt
Created July 28, 2015 16:53
Ideas on collaboration in standards
<sole_> so essentially - unless you're paid to read email (e.g. as anne is) email lists are super time consuming and very few people can spend the time on doing that
<sole_> can/want
<sole_> so yeah email can be very exclusionary :)
<jgraham> My experience is that putting the same volume of discussion on a forum or bugtracker doesn't magically reduce the amount of work you have to do to pay attention to the bits you care about
<annevk> sole_: I think it's about being paid to work on this stuff in general
<annevk> sole_: standards is actually a lot of work, so expecting people to work on it in their free time is like expecting people to work on open source in their free time
<sole_> yes!
<annevk> sole_: it's not really about communication medium, although some people like to invoke that distraction
<annevk> (I mean, I do think that GitHub over W3C Bugzilla is more new-folks-friendly, but it's peanuts compared to the overall cost.)
<annevk> sole_: I'd be interested in learning how you folks communicate though a
@annevk
annevk / formatting.md
Last active April 15, 2016 08:45
Formatting conventions for standards

Use a column width of 100 characters.

Do not use newlines inside "inline" elements, even if that means exceeding the column width requirement.

<p>The
<dfn method for=DOMTokenList lt=remove(tokens)|remove()><code>remove(<var>tokens</var>&hellip;)</code></dfn>
method, when invoked, must run these steps:

is okay and