Skip to content

Instantly share code, notes, and snippets.

View davidmurdoch's full-sized avatar
💭
Building

David Murdoch davidmurdoch

💭
Building
View GitHub Profile
<?xml version="1.0" encoding="utf-8" ?>
<cssmd:cssmd xmlns:cssmd="http://schemas.microsoft.com/Visual-Studio-Intellisense/css" version="VS8" description="CSS3 validation data">
<cssmd:property-set>
<!-- Based on the original css21.xml from Visual Studio 2010 -->
<!-- Font Properties -->
<cssmd:property-def _locID="color" _locAttrData="description,syntax" type="color"
description="Color of an element's text"
syntax="#RRGGBB | Named Color | rgb(R, G, B) | rgba(R, G, B, A) | inherit"
enum="inherit Aqua Black Blue Fuchsia Gray Green Lime Maroon Navy Olive Orange Purple Red Silver Teal White Yellow ActiveBorder ActiveCaption AppWorkspace Background ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLighShadow ThreeDShadow Window WindowFrame WindowText"/>
@davidmurdoch
davidmurdoch / css30.xml
Created March 24, 2011 19:30 — forked from KrofDrakula/css30.xml
CSS 3 validation for Visual Studio 20(08|10)
<?xml version="1.0" encoding="utf-8" ?>
<cssmd:cssmd xmlns:cssmd="http://schemas.microsoft.com/Visual-Studio-Intellisense/css" version="VS8" description="CSS3 validation data">
<cssmd:property-set>
<!-- Based on the original css21.xml from Visual Studio 2010 -->
<!-- Font Properties -->
<cssmd:property-def _locID="color" _locAttrData="description,syntax" type="color"
description="Color of an element's text"
syntax="#RRGGBB | Named Color | rgb(R, G, B) | rgba(R, G, B, A) | inherit"
enum="inherit Aqua Black Blue Fuchsia Gray Green Lime Maroon Navy Olive Orange Purple Red Silver Teal White Yellow ActiveBorder ActiveCaption AppWorkspace Background ButtonFace ButtonHighlight ButtonShadow ButtonText CaptionText GrayText Highlight HighlightText InactiveBorder InactiveCaption InactiveCaptionText InfoBackground InfoText Menu MenuText Scrollbar ThreeDDarkShadow ThreeDFace ThreeDHighlight ThreeDLighShadow ThreeDShadow Window WindowFrame WindowText"/>
@leibovic
leibovic / dominant-color.js
Created June 9, 2011 16:27
Dominant Color
function getDominantColor(aImg) {
let canvas = document.createElement("canvas");
canvas.height = aImg.height;
canvas.width = aImg.width;
let context = canvas.getContext("2d");
context.drawImage(aImg, 0, 0);
// keep track of how many times a color appears in the image
let colorCount = {};
@jinxidoru
jinxidoru / closeable_http_server.ts
Last active January 24, 2022 19:31
Closeable http server
import * as http from 'http'
import * as _ from 'lodash'
//! In the standard implementation of http server, calling close is not guaranteed to close the
//! server. Any idle connections being kept alive by clients will stay open until their timeout
//! is reached. This is problematic for gracefully shutting down a process with an http server.
//! This function will create an http server that tracks the open connections. On close, idle
//! connections are closed and any newly idled connection is immediately closed as well. When there
//! are no more connections on the server, the 'empty' event is raised.
@joepie91
joepie91 / es-modules-are-terrible-actually.md
Last active March 25, 2024 12:17
ES Modules are terrible, actually

ES Modules are terrible, actually

This post was adapted from an earlier Twitter thread.

It's incredible how many collective developer hours have been wasted on pushing through the turd that is ES Modules (often mistakenly called "ES6 Modules"). Causing a big ecosystem divide and massive tooling support issues, for... well, no reason, really. There are no actual advantages to it. At all.

It looks shiny and new and some libraries use it in their documentation without any explanation, so people assume that it's the new thing that must be used. And then I end up having to explain to them why, unlike CommonJS, it doesn't actually work everywhere yet, and may never do so. For example, you can't import ESM modules from a CommonJS file! (Update: I've released a module that works around this issue.)

And then there's Rollup, which apparently requires ESM to be u