Skip to content

Instantly share code, notes, and snippets.

View shepazu's full-sized avatar

Doug Schepers shepazu

View GitHub Profile
@svallory
svallory / colors.ts
Created December 28, 2024 04:39
Typescript type definitions for CSS Colors
/** RGB color in functional notation (e.g. rgb(255, 0, 0)) */
export type RGB = `rgb(${number}, ${number}, ${number})`;
/** RGBA color in functional notation (e.g. rgba(255, 0, 0, 0.5)) */
export type RGBA = `rgba(${number}, ${number}, ${number}, ${number})`;
/** HSL color in functional notation (e.g. hsl(0, 100%, 50%)) */
export type HSL = `hsl(${number}, ${number}%, ${number}%)`;
/** HSLA color in functional notation (e.g. hsla(0, 100%, 50%, 0.5)) */
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Jigsaw puzzle</title>
<script type="text/javascript">
function save(filename, data)
{
var blob = new Blob([data], {type: "text/csv"});
@mshafrir
mshafrir / states_hash.json
Created May 9, 2012 17:05
US states in JSON form
{
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
@conorbuck
conorbuck / angle-between-points.js
Created May 5, 2012 22:51
JavaScript: Find the angle between two points
var p1 = {
x: 20,
y: 20
};
var p2 = {
x: 40,
y: 40
};