Skip to content

Instantly share code, notes, and snippets.

import firebase from 'firebase';
import produce from 'immer';
import { useEffect, useReducer, useRef, useCallback } from 'react';
type IAction<K, V = void> = V extends void ? { type: K } : { type: K } & V;
export type IActionType =
| IAction<'LOAD_REQUEST'>
| IAction<
'LOAD_SUCCESS',
@DavidKuennen
DavidKuennen / minimal-analytics-snippet.js
Last active March 28, 2024 01:45
Minimal Analytics Snippet
(function (context, trackingId, options) {
const history = context.history;
const doc = document;
const nav = navigator || {};
const storage = localStorage;
const encode = encodeURIComponent;
const pushState = history.pushState;
const typeException = 'exception';
const generateId = () => Math.random().toString(36);
const getId = () => {
@ocean90
ocean90 / box-shadow.html
Last active April 11, 2024 13:54
CSS3 Box Shadow, only top/right/bottom/left and all
<!DOCTYPE html>
<html>
<head>
<title>Box Shadow</title>
<style>
.box {
height: 150px;
width: 300px;
margin: 20px;