Skip to content

Instantly share code, notes, and snippets.

@skipsleep
skipsleep / useScrollBlock.js
Created November 11, 2022 04:25 — forked from reecelucas/useScrollBlock.js
React hook to enable/disable page scroll
import { useRef } from 'react';
const safeDocument = typeof document !== 'undefined' ? document : {};
/**
* Usage:
* const [blockScroll, allowScroll] = useScrollBlock();
*/
export default () => {
const scrollBlocked = useRef();
@skipsleep
skipsleep / index.html
Created June 6, 2022 17:53
Tomorrow.io rainfall probability on line chart with d3.js
<svg></svg>
<div style="padding: 2rem; text-align: center;">
<p>If you are viewing this example you are viewing the cached version of the rain fall probability of Lagos, Nigeria fetched from <a href="https://www.tomorrow.io/weather-api/">Tomorrow.io weather API on </a> - <small>December 03, 2021</small>
</p>
</div>
import java.util.*;
public class abstr {
//product interface for bgcolor
public static interface BGCOLOUR {
////operations for bgcolour
}
//concrete products
public static class light_bgcolour implements BGCOLOUR {
////implementing operations for light-theme bgcolour