Skip to content

Instantly share code, notes, and snippets.

Racing through work

Robert DeLuca Robdel12

Racing through work
View GitHub Profile
View clone-with-shadow-roots.js
* cloneNode(true), but also clones shadow roots.
* @param {Element}
* @param {ShadowRoot[]} [shadowRoots] Any closed shadow roots passed here will be included.
function cloneWithShadowRoots(node, shadowRoots) {
function walk(node, clone) {
let shadow = node.shadowRoot || shadowRoots.find(r => === node);
if (shadow) {
clone.attachShadow({ mode: shadow.mode }).append(...[], c => c.cloneNode(true)));
dominictarr /
Created November 26, 2018 22:39
statement on event-stream compromise

Hey everyone - this is not just a one off thing, there are likely to be many other modules in your dependency trees that are now a burden to their authors. I didn't create this code for altruistic motivations, I created it for fun. I was learning, and learning is fun. I gave it away because it was easy to do so, and because sharing helps learning too. I think most of the small modules on npm were created for reasons like this. However, that was a long time ago. I've since moved on from this module and moved on from that thing too and in the process of moving on from that as well. I've written way better modules than this, the internet just hasn't fully caught up.


otherwise why would he hand over a popular package to a stranger?

If it's not fun anymore, you get literally nothing from maintaining a popular package.

One time, I was working as a dishwasher in a restu

hdragomir / sm-annotated.html
Last active April 2, 2023 10:41
The deferred font loading logic for Smashing Magazine.
View sm-annotated.html
<script type="text/javascript">
(function () {
"use strict";
// once cached, the css file is stored on the client forever unless
// the URL below is changed. Any change will invalidate the cache
var css_href = './index_files/web-fonts.css';
// a simple event handler wrapper
function on(el, ev, callback) {
if (el.addEventListener) {
el.addEventListener(ev, callback, false);
oznu / index.js
Last active November 17, 2022 21:52
Homebridge Switch Plugin Example
View index.js
'use strict'
let Service, Characteristic
module.exports = (homebridge) => {
/* this is the starting point for the plugin where we register the accessory */
Service = homebridge.hap.Service
Characteristic = homebridge.hap.Characteristic
homebridge.registerAccessory('homebridge-switch-example', 'SwitchExample', SwitchAccessory)
dschep / raspbian-python3.6.rst
Last active July 12, 2022 09:52 — forked from BMeu/raspbian-python3.5.rst
Installing Python 3.6 on Raspbian
View raspbian-python3.6.rst

Installing Python 3.6 on Raspbian

As of January 2018, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it. There is also an ansible role attached that automates it all for you.

  1. Install the required build-tools (some might already be installed on your system).
matthewcrist / 1-100 Select.html
Created June 10, 2011 12:52
A Select Box With Options From 1 - 100
View 1-100 Select.html
<select><option value="0">0</option><option value="1">1</option><option value="2">2</option><option value="3">3</option><option value="4">4</option><option value="5">5</option><option value="6">6</option><option value="7">7</option><option value="8">8</option><option value="9">9</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="3
jdjkelly / gist:0bddf2e834b6d6bc2174
Last active December 25, 2021 14:30
Making Accessible Ember Components
View gist:0bddf2e834b6d6bc2174

Making Accessible Ember Components

Making the web accessible is important. We have ethical and, in some cases, legal obligations to ensuring access to all of users.

Luckily for us, it's easy to make an accessible Ember Component.

What are components?

To understand the accessibility story around Ember Components, we have to start by talking about Web Components. Ember Components are designed to be interoperable with the final Web Components API.

sir-dunxalot / Ember.js and Disqus Component
Last active December 30, 2017 19:07
An Ember.js Disqus component that loads Disqus comments asyncronously
View Ember.js and Disqus Component
'use strict';
Add your info here to link this blog to your free Disqus account
App.DisqusOptions = Em.Object.create({
shortname: 'someNamehere', // Change this!
lukemelia / note.txt
Created April 8, 2015 04:34
When Error: watch EMFILE strikes (OS X)
View note.txt
This requires `brew install jq` which is a command json query.
I got this from @krisselden