Skip to content

Instantly share code, notes, and snippets.

View drufball's full-sized avatar

Dru Knox drufball

View GitHub Profile
import { App, Modal, Notice, Plugin, PluginSettingTab, Setting } from 'obsidian';
import * as React from 'react';
import { render } from 'react-dom';
function DiceRoller() {
const [numDice, setNumDice] = React.useState(1);
const [diceSides, setDiceSides] = React.useState(20);
const [modifier, setModifier] = React.useState(0);
return (<>
@drufball
drufball / high-level-features.md
Last active December 1, 2017 06:59
Short descriptions for the "what high-level features do you want to see in browsers?" survey

Infinite list: Automatically lazy-loads content from a data source as the user scrolls, view-recycling as necessary.

Lazy-load image: Won't load the resource until it is on or near the screen.

Pull to refresh: Recreate the "pull down to refresh" UI from iOS and Android.

Carousel: Side scroller that handles lazy-loading and optionally snaps to elements.

Multi-line ellipsis: Automatically hide text and replace with a fade/ellipsis after a specified number of lines.

@drufball
drufball / lit-mixin.js
Created August 28, 2017 21:53
Combining lit-html with Polymer3
import { render as litRender } from 'lit-html/lit-html.js'
export const LitMixin = (superClass) => class extends superClass{
static get properties() { return {} }
static get observers() {
const props = Object.keys(this.properties)
if( props.length == 0 ) { return [] }
return [`_litUpdate(${props.join(",")})`]