Skip to content

Instantly share code, notes, and snippets.

View indreklasn's full-sized avatar
👋

Trevor I. Lasn indreklasn

👋
View GitHub Profile
<aside>
<dark-mode-toggle
id="dark-mode-toggle"
legend="Theme Switcher"
light="Light"
dark="Dark"
appearance="switch"
permanent="false"
></dark-mode-toggle>
</aside>
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="common.css" />
<link
rel="stylesheet"
href="light.css"
media="(prefers-color-scheme: light), (prefers-color-scheme: no-preference)"
/>
<link
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Toggle</title>
</head>
<body>
<div class="ui three buttons">
<button class="ui active button">One</button>
<button class="ui button">Two</button>
<button class="ui button">Three</button>
</div>
const IPFS = require('ipfs')
async function main () {
const node = await IPFS.create({silent: true})
const filesAdded = await node.add({
path: 'hello.txt',
content: Buffer.from('Hello World 101')
})
const IPFS = require('ipfs')
async function main () {
const node = await IPFS.create()
}
main()
const IPFS = require('ipfs')
async function main () {
const node = await IPFS.create()
}
main()
const IPFS = require('ipfs')
const main = async () => {
// place ipfs logic here
}
main()
class Counter extends HTMLElement {
#xValue = 0;
get #x() { return #xValue; }
set #x(value) {
this.#xValue = value;
window.requestAnimationFrame(this.#render.bind(this));
}
#clicked() {
class Counter extends HTMLElement {
#x = 0;
clicked = () => {
this.#x++;
window.requestAnimationFrame(this);
}
constructor() {
super();