Represent maps
// rather than
const map: {[ key: string ]: string} = {
foo: 'bar',
}| // gitignore this file | |
| module.exports = { | |
| HASURA_URL: 'https://myapp.herokuapp.com/v1/graphql', | |
| HASURA_ADMIN_SECRET: 'xxx', | |
| }; |
| /** | |
| * useScroll React custom hook | |
| * Usage: | |
| * const { scrollX, scrollY, scrollDirection } = useScroll(); | |
| */ | |
| import { useState, useEffect } from "react"; | |
| export function useScroll() { | |
| const [lastScrollTop, setLastScrollTop] = useState(0); |
| #!/usr/bin/python | |
| import curses, random | |
| screen = curses.initscr() | |
| width = screen.getmaxyx()[1] | |
| height = screen.getmaxyx()[0] | |
| size = width*height | |
| char = [" ", ".", ":", "^", "*", "x", "s", "S", "#", "$"] | |
| b = [] |