Mapping | Action |
---|---|
<C-n>/<Down> |
Next item |
<C-p>/<Up> |
Previous item |
j/k |
Next/previous (in normal mode) |
H/M/L |
Select High/Middle/Low (in normal mode) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<am-yisrael-hai> | |
<template shadowrootmode="open"> | |
<!-- @license public domain --> | |
<!-- @author bennypowers.dev --> | |
<style> | |
:host { | |
display: contents; | |
text-align: center; | |
font-size: 150%; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import postcss from 'postcss'; | |
import { readFile } from 'node:fs/promises'; | |
// load up the shadow dom css sheet, | |
// taken from the rhds git repo | |
const content = await readFile(new URL('./rh-cta.css', import.meta.url), 'utf-8'); | |
const HOST_ARGS = /:host\((?<hostArg>[^)]*)\)/g; | |
const SLOTTED_ARGS = /::slotted\((?<slottedArg>[^)]*)\)/gm; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setScoreTo(num: number) { | |
serial.writeValue("score", num) | |
if (num >= 4) { | |
win() | |
} else if (num < 0) { | |
lose() | |
} else { | |
last = rounded | |
rope = num | |
rounded = Math.round(rope) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Main where | |
import Data.Sort | |
import Test.Hspec | |
import Test.QuickCheck | |
prop_abs :: Int -> Bool | |
prop_abs n = abs n == n || 0 - abs n == n | |
prop_min :: [Int] -> Bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.IO | |
import System.Random | |
-- The game | |
check :: String -> String -> Char -> (Bool,String) | |
check word display c = | |
(c `elem` word, | |
[if x == c then c else y | (x, y) <- zip word display]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getParentPiercingShadowRoots(node: Node): Node { | |
return ( | |
node instanceof ShadowRoot ? node.host | |
: (node instanceof Element && node.assignedSlot || node)?.parentNode | |
); | |
} | |
@customElement('elevated-card') | |
export class ElevatedCard extends LitElement { | |
static readonly styles = [style]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloQuery, html, customElement } from '@apollo-elements/lit-apollo'; | |
import query from './awesome-rob.graphql'; //use a build transform | |
import getPathOr from 'crocks/helpers/getPathOr'; | |
const getUserBestFriend = getPathOr({}, ['me', 'friends', 0]); | |
@customElement('awesome-rob) | |
class AwesomeRob extends ApolloQuery { | |
query = query; | |
render() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
async _registerServiceWorker() { | |
// Instructions on how to toast the user when necessary. 🍾 | |
const toast = () => this.$.swtoast.open(); | |
// Listen for changes on a new worker, toast when installed. 🍞 | |
const track = (sw) => sw.onstatechange = () => (sw.state === 'installed') && toast(); | |
// Register the service worker | |
const scope = Polymer.rootPath; | |
let reg; | |
try { | |
reg = await navigator.serviceWorker.register('/service-worker.js', {scope}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="import" href="../../bower_components/polymer/polymer-element.html"> | |
<script> | |
/** | |
* @polymer | |
* @mixinFunction | |
* @param {class} superClass | |
* @return {class} | |
* | |
* Polymer.SingletonMixin consumers must be defined with a constructor which |
NewerOlder