Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am rspieker on github.
  • I am foozle (https://keybase.io/foozle) on keybase.
  • I have a public key whose fingerprint is BA0A E6E9 B096 7AF5 852F 59C3 E03C 5301 C333 43B2

To claim this, I am signing this object:

@rspieker
rspieker / App.html
Created March 22, 2018 07:03
Svelte dynamic multiple attribute on two-way binding of select does not work
<h2>Static multiple attribute</h2>
<select bind:value="works" multiple :size>
{{#each options as option}}
<option value="{{ option }}">{{ option }}</option>
{{/each}}
</select>
<h2>Dynamic :multiple attribute ({{ multiple }})</h2>
<select bind:value="broken" :multiple :size>
{{#each options as option}}

Keybase proof

I hereby claim:

  • I am rspieker on github.
  • I am foozle (https://keybase.io/foozle) on keybase.
  • I have a public key whose fingerprint is 5AC4 5A58 F792 01B7 D698 47F4 22EF 8B7B FC42 7CBA

To claim this, I am signing this object:

@rspieker
rspieker / h.children.js
Last active March 5, 2016 16:17
Suggestions on how to improve the helper library at http://blog.wearecolony.com/a-year-without-jquery/
/**
* @param {Element} el
* @param {string} selector
* @return {Element[]}
*/
h.children = function(el, selector) {
var selectors = null,
children = null,
childSelectors = [],
@rspieker
rspieker / dimension.js
Last active March 19, 2016 20:36
Obtain screen/window/document dimensions
/**
* Obtain screen/window/document(.documentElement)/element dimensions
* @param object target
* @param mixed prefix [optional, default false-ish - no prefix, use best for target]
* @note best:
* - window >> outer
* - document >> client|offset|scroll
* - element >> client|offset|scroll
*/
function dimension(target, prefix) {
@rspieker
rspieker / convert-glue-plugin-manifest-es2015.js
Last active January 20, 2016 12:11
Convert glue < 3 manifest to 3+ syntax
// compensate for old Glue configuration syntax
function convertGluePluginManifest(manifest) {
if ('plugins' in manifest) {
if (!manifest.connections || manifest.connections.length !== 1) {
throw new Error('it is probably a Bad Idea™ to bluntly convert the old Glue "plugins" to reside on all connections');
}
if (!('registrations' in manifest)) {
manifest.registrations = [];
}
@rspieker
rspieker / example.js
Created August 24, 2015 08:20
Hapi - allow for the CSP 2.0 'application/csp-report' content-type
'use strict';
var Hapi = require('hapi'),
server = new Hapi.Server();
server.connection({ port: 80 });
// Example #1, simply override the content-type header and trust the input
server.route({
path: '/csp/report/1',
@rspieker
rspieker / color-definitions.css
Created August 5, 2015 09:24
HEX/RGB/HSL/HSV color definitions for use with CSS4 / Myth CSS preprocessor
root: {
/* red tones */
/* White */
--hex-white: #ffffff;
--rgb-white: rgb(255, 255, 255);
--hsl-white: hsl(0, 0, 100);
--hsv-white: hsv(0, 0, 100);
@rspieker
rspieker / color-definitions-hsv.css
Created August 5, 2015 09:23
HSV color definitions for use with CSS4 / Myth CSS preprocessor
root: {
/* red tones */
--hsv-white: hsv(0, 0, 100);
--hsv-snow: hsv(0, 2, 100);
--hsv-seashell: hsv(25, 7, 100);
--hsv-white-smoke: hsv(0, 0, 96);
--hsv-rose-white: hsv(19, 8, 98);
--hsv-hint-of-red: hsv(24, 4, 96);
--hsv-chablis: hsv(19, 11, 99);
@rspieker
rspieker / color-definitions-hsl.css
Created August 5, 2015 09:22
HSL color definitions for use with CSS4 / Myth CSS preprocessor
root: {
/* red tones */
--hsl-white: hsl(0, 0, 100);
--hsl-snow: hsl(0, 100, 99);
--hsl-seashell: hsl(25, 100, 97);
--hsl-white-smoke: hsl(0, 0, 96);
--hsl-rose-white: hsl(19, 70, 95);
--hsl-hint-of-red: hsl(24, 33, 94);
--hsl-chablis: hsl(19, 88, 94);