View useHasLoader.ts
// Testable Custom Hooks | |
import { useEffect } from "react"; | |
// Function that can be tested with clear API, easily unit-testable | |
const handleHasLoader = ({ isLoading, hasFocus, setHasLoader }) => { | |
if (isLoading && !hasFocus) { | |
return setHasLoader(true); | |
} | |
return setHasLoader(false); |
View Card.jsx
// This is an exisiting React Component written as a Function Component using JavaScript. | |
import React from "react"; | |
import { string, any } from "prop-types"; | |
const Card = ({ | |
headline, | |
createdAt, | |
children, | |
}) => { |
View tsconfig.json
{ | |
"compilerOptions": { | |
"target": "es5", | |
"lib": [ | |
"dom", | |
"dom.iterable", | |
"esnext" | |
], | |
"allowJs": true, | |
"noImplicitAny": false, |
View mute.automator
on run {input, parameters} | |
set inputVolume to input volume of (get volume settings) | |
if inputVolume = 0 then | |
set inputVolume to 35 | |
set displayNotification to "Microphone Unmuted" | |
else | |
set inputVolume to 0 | |
set displayNotification to "Microphone Muted" | |
end if |
View .hyper.js
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 12, | |
// font family with optional fallbacks | |
fontFamily: 'Consolas, Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color and opacity (hex, rgb, hsl, hsv, hwb or cmyk) | |
cursorColor: 'rgba(248,28,229,0.8)', |
View module.js
/** | |
* Module | |
*/ | |
// External Library | |
import _ from '../node_modules/lodash/dist/lodash.js'; | |
// Private variables | |
let _eventName = '_test'; |
View notes.txt
Donations for beer | |
View dabblet.css
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
div { | |
border-radius: 50%; | |
height: 200px; | |
background: #ddd; | |
width: 200px; | |
} |
NewerOlder