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
// Polymer Starter Kit App | |
// my-app, in `ready` callback | |
if ('serviceWorker' in navigator) { | |
navigator.serviceWorker.register('/service-worker.js') | |
.then((registration) => { | |
registration.onupdatefound = (event) => { | |
let installingWorker = registration.installing; | |
installingWorker.onstatechange = (event) => { |
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
/** | |
* Author: Jason Farrell | |
* Author URI: http://useallfive.com/ | |
* | |
* Description: Checks if a DOM element is truly visible. | |
* Package URL: https://github.com/UseAllFive/true-visibility | |
*/ | |
function isVisible(node) { | |
'use strict'; |
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 |
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
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
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 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
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 |
OlderNewer