Skip to content

Instantly share code, notes, and snippets.

// jest tests
describe("getTickValues method", () => {
const dispformat = "DD-MMM-YYYY hh:mm";
beforeAll(() => {
moment.tz.setDefault("Europe/London");
});
it("generates tick values with DST", () => {
@dp21g
dp21g / pinch.js
Created May 1, 2019 09:34
Track pinch gestures in browser using only touch events (attempt to not use HammerJS)
// 1. Track the touches
let touches = {
start: [],
end: [],
};
// 2. When the touch events end, calculate if its pinching inwards or outwards
const handleTouchEnd = () => {
if (touches.start.length === 0 || touches.end.length === 0) {
return;
@dp21g
dp21g / Macro Manager.ahk
Created August 12, 2024 22:50
Macro Manager with UI(Auto Hotkey v2) similar to Keyboard Maestro on Mac (Ctrl+Alt+T to launch macro search)
#Requires AutoHotkey v2.0
^!t::ShowMacroSearch()
MacroFilePath := A_ScriptDir . "\macros.txt"
global MacroTypeMap := Map()
MacroTypeMap["1"] := "Send"
MacroTypeMap["2"] := "Run"

How to Fix the Bootloader on the EFI System Partition in Windows causing Blue screen of death(BSOD) and infinite boot loop.

Step 1: Access the Windows Repair Menu

  1. Use a USB bootable Windows drive to access the repair menu.
  2. Open the Command Prompt from the repair menu.

Step 2: Assign a Drive Letter to the EFI Partition

  1. In the Command Prompt, type diskpart and press Enter.
  2. List the volumes by typing list volume and press Enter.
  3. Identify the EFI System Partition, then type select volume X (replace X with the volume number of the EFI partition) and press Enter.
@dp21g
dp21g / gist:46f20ee46e68c393e4a7c09aa5ea8df6
Created October 13, 2025 18:31
fvg between specific hours
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
//FVG indicator: Paints FVGs and their midlines (CEs). Stops painting when CE is hit, or when fully filled; user choice of threshold. This threshold is also used in the Alert conditions.
//Big thank you to @Bjorgum for his fantastic extendAndRemove method. Modified here for use with boxes and to integrate Alerts
//Modified to include time range filtering
// © twingall
//@version=5
indicator("DP - FVGs & CEs + Alerts: Time Filtered", overlay = true, max_boxes_count = 500, max_lines_count = 500)
// Time Range Settings
//@version=5
indicator("Hourly Open Untouched Zones", overlay=true, max_boxes_count=500, max_lines_count=500, max_labels_count=500)
// —————————————————————————————————————————————————————————————————————————————
// Part 3: User Customization (Inputs)
// —————————————————————————————————————————————————————————————————————————————
var string G_COLORS = "Colors & Transparency"
c_box_a_base = input.color(color.blue, "Box A Color", group=G_COLORS, inline="box_a")
c_box_a_transp = input.int(80, "Transparency", minval=0, maxval=100, group=G_COLORS, inline="box_a")