Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Single File Web Component</title>
<style>
body {
background-color: #eee;
font-family: Helvetica, sans-serif;
}
@kristoferjoseph
kristoferjoseph / single-file-web-component.html
Last active November 22, 2023 01:17
Single file Web Component
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Single File Web Component</title>
</head>
<body>
<template id=single-file>
<style>
h1 {
@bioshazard
bioshazard / gun-service.sh
Created July 27, 2021 16:20
Automation for installing GunDB as a service (tested on Pi)
#!/bin/bash
## Usage: GUN_USER=gun GUN_ROOT=~gun/gun-pi-custom GUN_BRACH=master gun-service.sh
# Should be run as root (with sudo or directly)
[[ "$(whoami)" == "root" ]] || { echo "Must be run as root"; exit 1; }
# Setup default environment
[ -z "${GUN_USER}" ] && GUN_USER="pi"
GUN_DETECTED_USER_HOME=$(getent passwd ${GUN_USER} | cut -d: -f6)
@WebReflection
WebReflection / uce-vs-lit-element.md
Last active January 8, 2024 07:16
A very simple comparison table between uce and lit-element.

A very simple comparison table between these two libraries.

uce lit-element
version 1.11.9 2.4.0
license ISC (simplified MIT) BSD-3-Clause License
language JS w/ TS definition TS w/ JS transpilation
size ( brotli ) 9437b ES5 / 6811b ES2015+ 8634b ES5 / 6708b ES2015+
@tbjgolden
tbjgolden / css-shorthand-map.json
Created March 21, 2020 16:17
JSON map from CSS shorthand properties to their sub-properties
{
"animation": [
"animation-name",
"animation-duration",
"animation-timing-function",
"animation-delay",
"animation-iteration-count",
"animation-direction",
"animation-fill-mode",
"animation-play-state"
@cblanquera
cblanquera / css-properties.json
Last active October 9, 2024 03:05
CSS properties via JSON
{
"align-content": {
"moz": false,
"webkit": true,
"syntax": "(stretch)|(center)|(flex-start)|(flex-end)|(space-between)|(space-around)|(initial)|(inherit)",
"initial": "stretch",
"values": [
"stretch",
"center",
"flex-start",
@maxjing
maxjing / time.js
Created January 23, 2019 19:28
timestamp
Date.prototype.customFormat = function(formatString) {
var YYYY,
YY,
MMMM,
MMM,
MM,
M,
DDDD,
DDD,
DD,
@sarahdayan
sarahdayan / modifiers.scss
Last active November 15, 2024 15:56
Sass Modifiers Mixin
// ----
// Sass (v3.4.21)
// Compass (v1.0.3)
// ----
// Sass modifiers mixin by Sarah Dayan
// Generate All Your Utility Classes with Sass Maps: frontstuff.io/generate-all-your-utility-classes-with-sass-maps
// http://frontstuff.io
// https://github.com/sarahdayan
@remi
remi / crypto-ticker-html.sh
Last active January 20, 2018 18:43
Bitcoin + Ethereum shell ticker to use with GeekTool on macOS
#!/usr/bin/env bash
# This script requires `curl`, `jq`, `xargs` `bc` and `awk`
add_arrows() {
foo=$(echo $1 | sed -e 's/^\([0-9]\)/▲ \1/g')
foo=$(echo $foo | sed -e 's/^-/▼ /g')
echo $foo
}
'use strict';
class Abstract {
// A static abstract method.
static foo() {
if (this === Abstract) {
// Error Type 2. Abstract methods can not be called directly.
throw new TypeError("Can not call static abstract method foo.");
} else if (this.foo === Abstract.foo) {
// Error Type 3. The child has not implemented this method.
throw new TypeError("Please implement static abstract method foo.");