Skip to content

Instantly share code, notes, and snippets.

View peschee's full-sized avatar
Grabbing another coffee…

Peter Siska peschee

Grabbing another coffee…
View GitHub Profile
blueprint:
name: ZHA - Philips Hue Dimmer Switch (Fixed)
description: 'Control lights with a Philips Hue Dimmer Switch.
The top "on" button will turn the lights on to the last set brightness
(unless the force brightness is toggled on in the blueprint).
Dim up/down buttons will change the brightness smoothly and can be pressed

Shadows in CSS when using Figma + Specify + SD

This is the source (raw token) as delivered by Specify:

{
    "id": "60b553b2-8f57-453a-a461-0a0a7eacf2cb",
    "createdAt": "2023-08-09T14:10:09.213Z",
    "updatedAt": "2023-08-09T14:10:09.213Z",
    "name": "lvl-1",
@peschee
peschee / --Library--LaunchDaemons--co.echo.httpdfwd.plist
Created July 10, 2023 08:35 — forked from rootindex/--Library--LaunchDaemons--co.echo.httpdfwd.plist
Making macos on boot redirect port 80 to 8080 and 443 to 8443 on all interfaces permanently, -- = /
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>co.echo.httpdfwd</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-c</string>
@peschee
peschee / DNS_TO_LOCALHOST.markdown
Created January 7, 2022 14:40 — forked from tinogomes/DNS_TO_LOCALHOST.markdown
Public DNS Pointing to localhost (127.0.0.1)

Available Public Wildcard DNS Domains pointing to localhost (127.0.0.1)

It turns out that some kind hearted people already set up wildcard domains for you already. You can use any domain below and/or any subdomain of these and they currently resolve to 127.0.0.1 but could switch at any time to resolve somewhere else. Here's the list of ones I know about. Let me know if there are more!

  • localhost - It will always works. Do you know why? I hope so.
  • [*.]fuf.me - Managed by @fidian; it will always point to localhost for IPv4 and IPv6
  • [*.]fbi.com - 👏 👏 👏 👏 👏
  • [*.]localtest.me
  • [*.]127-0-0-1.org.uk
  • [*.]vcap.me
@peschee
peschee / esm-package.md
Created July 22, 2021 12:14 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package linked to from here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
class MyElement extends LitElement {
// Promise that will resolve when the entire subtree of the element's `renderRoot` has finished updating/rendering.
get updateSubtreeComplete() {
async function awaitSubtree(el) {
await el.updateComplete;
const clients = el.renderRoot!.querySelectorAll('*');
await Promise.all(Array.from(clients).map((e) =>
e.updateSubtreeComplete || awaitSubtree(e as UpdatingElement)));
}
@peschee
peschee / lit-html-count.js
Last active August 31, 2020 09:01
lit-html Count Example
import { html, render } = from 'lit-html';
// A lit-html template uses the `html` template tag:
const countTemplate = (count) => html`<p>The current count is: ${count}</p>`;
let i = 0;
setInterval(() => {
// Renders with the `render()` function
// + re-renders only update the data that changed, no VDOM diffing!
render(countTemplate(i++), document.body)
@peschee
peschee / tagProps.js
Created August 13, 2020 06:43 — forked from andyvanee/tagProps.js
tagProps lit-element directive
import { directive } from "https://unpkg.com/@polymer/lit-element/lit-element.js?module"
const stateMap = new WeakMap()
export const tagProps = directive((tag, props = {}) => part => {
let state = stateMap.get(part)
const el = () => document.createElement(tag)
if (state === undefined) {
state = { tag, element: el() }
stateMap.set(part, state)
@peschee
peschee / .gitlab-ci.yml
Created December 26, 2019 10:34
Gitlab CI Example
stages:
- build
- deploy
build:
stage: build
image: node:dubnium
variables:
CI: "true"
script: