Skip to content

Instantly share code, notes, and snippets.

View remarkablemark's full-sized avatar

Mark remarkablemark

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remarkablemark
remarkablemark / spinner-full-screen.html
Last active March 7, 2026 01:42
Loading spinner using HTML + CSS
<div id="spinner" role="progressbar" aria-label="Loading"></div>
<style>
#spinner {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
border: 4px solid #ddd;
@remarkablemark
remarkablemark / novu-signature.py
Created January 22, 2026 03:30
Generate Novu HMAC header signature for bridge endpoint: https://docs.novu.co/framework/endpoint
import hashlib
import hmac
import json
import time
from os import getenv
from typing import Any
def generate_novu_signature(secret_key: str, payload: Any) -> str:
"""
@remarkablemark
remarkablemark / useFadeIn.ts
Created December 5, 2025 00:49
React hook useFadeIn
import { useEffect, useState } from "react";
/**
* Trigger animation after component mounts with a slight delay for dramatic effect
*
* @param delay - The delay in milliseconds
* @returns A boolean indicating whether the element is visible
*/
function useFadeIn(delay) {
const [isVisible, setIsVisible] = useState(false);
/**
* Formats a number using compact notation with at most one decimal place (e.g., 1.2M or 123K).
*
* @param amount - The number to format.
* @returns The formatted number as a string.
*/
function formatNumber(amount) {
return new Intl.NumberFormat('en-US', {
notation: 'compact',
maximumFractionDigits: 1,
@remarkablemark
remarkablemark / vim-cterm-colors.md
Created November 20, 2025 22:58
Vim :h cterm-colors

Vim cterm-colors

NR-16 NR-8 COLOR NAME
0 0 Black
1 4 DarkBlue
2 2 DarkGreen
3 6 DarkCyan
4 1 DarkRed
5 5 DarkMagenta
@remarkablemark
remarkablemark / useScrollDirection.ts
Created November 13, 2025 22:15
React hook useScrollDirection
import { useCallback, useEffect, useRef, useState } from "react";
export enum ScrollDirection {
"up" = "up",
"down" = "down",
}
export function useScrollDirection() {
const scrollYRef = useRef(0);
const [direction, setDirection] = useState(ScrollDirection.up);
@remarkablemark
remarkablemark / bash-increment-number-in-files.sh
Created October 29, 2025 04:46
Bash increment number in files
#!/bin/bash
echo "Release incrementer start..."
echo
ROOT_DIRECTORY=$(git rev-parse --show-toplevel)
PATTERN='x-release-increment'
INDENT=' '
grep -rl $PATTERN $ROOT_DIRECTORY/{android,ios} | while read file; do
@remarkablemark
remarkablemark / transparent.png
Last active October 10, 2025 03:43
transparent and white png 200x200
transparent.png
const REGEX = /\(\)|\{\}|\[\]/g;
/**
* Given a string s containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.
*
* An input string is valid if:
* 1. Open brackets must be closed by the same type of brackets.
* 2. Open brackets must be closed in the correct order.
* 3. Every close bracket has a corresponding open bracket of the same type.
*