| Key | Result |
|---|---|
v |
select |
y |
copy (yank) |
c |
change |
d |
delete |
This file contains hidden or 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 { riff, route, html, indexRoute } from "../riff/riff.mjs"; | |
| import { serve } from "../riff/riff-express.mjs"; | |
| import { | |
| deleteTask, | |
| getProjects, | |
| getTasks, | |
| getUser, | |
| sendEmail, | |
| updateTask, | |
| createTask, |
This file contains hidden or 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
| name: Release | |
| on: | |
| push: | |
| tags: | |
| - v* | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest |
This file contains hidden or 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 SwiftUI | |
| import PlaygroundSupport | |
| struct ContentView: View { | |
| var body: some View { | |
| Text("Hello World") | |
| } | |
| } | |
| PlaygroundPage.current.setLiveView(ContentView()) |
This file contains hidden or 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 { writable } from 'svelte/store' | |
| // returns a store with HTTP access functions for get, post, patch, delete | |
| // anytime an HTTP request is made, the store is updated and all subscribers are notified. | |
| export default function(initial) { | |
| // create the underlying store | |
| const store = writable(initial) | |
| // define a request function that will do `fetch` and update store when request finishes | |
| store.request = async (method, url, params=null) => { |
This file contains hidden or 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 { ApolloServer, gql } from 'apollo-server-micro'; | |
| const typeDefs = gql` | |
| type Query { | |
| sayHello: String | |
| } | |
| `; | |
| const resolvers = { | |
| Query: { |
This file contains hidden or 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
| let UserContext = React.createContext(); | |
| class App extends React.Component { | |
| state = { | |
| user: null, | |
| setUser: user => { | |
| this.setState({ user }); | |
| } | |
| }; |
This file contains hidden or 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
| :root { | |
| --ease-in-quad: cubic-bezier(.55, .085, .68, .53); | |
| --ease-in-cubic: cubic-bezier(.550, .055, .675, .19); | |
| --ease-in-quart: cubic-bezier(.895, .03, .685, .22); | |
| --ease-in-quint: cubic-bezier(.755, .05, .855, .06); | |
| --ease-in-expo: cubic-bezier(.95, .05, .795, .035); | |
| --ease-in-circ: cubic-bezier(.6, .04, .98, .335); | |
| --ease-out-quad: cubic-bezier(.25, .46, .45, .94); | |
| --ease-out-cubic: cubic-bezier(.215, .61, .355, 1); |
I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.
I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.
Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.
This file contains hidden or 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
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
NewerOlder