Skip to content

Instantly share code, notes, and snippets.

View Bandit's full-sized avatar
🎨
Chief Crayon Officer

James Nisbet Bandit

🎨
Chief Crayon Officer
View GitHub Profile
@Bandit
Bandit / BetterReactRangeSlider.js
Last active September 2, 2025 01:59
A UX-first React range slider implementation. Working demo: https://codesandbox.io/p/sandbox/sharp-cray-zm62vd
/*
So there's a critical UX flaw with most range slider implementations, whereby if
both handles are on top of each other (e.g. to select a single value range like 80-80)
then it's not clear to the user which handle is on top, and so dragging in a certain
direction doesn't work. The user is then either bewildered or forced to drag in the
opposite direction to the one they want in order to reveal the other handle.
This component sets out to solve that problem by allowing the handles to pass each
other, without sacrificing keyboard support (and minimising the mangling of A11y).
@Bandit
Bandit / CreateWSLBackup.bat
Last active December 27, 2024 04:41
Scheduled WSL Backup Batch Script for Windows
REM Requires 7zip or NanaZip to be installed
@echo off
set datestamp=%DATE:~10,4%%DATE:~4,2%%DATE:~7,2%
cd C:\WSL-Backup
echo "Exporting WSL image..."
wsl --export Ubuntu-20.04 .\Ubuntu-20.04.tar
echo "Zipping WSL export..."
@Bandit
Bandit / progress.overrides.import.less
Last active August 23, 2016 01:15
Semantic UI HTML5 Meter Tag Styles
/*******************************
Site Overrides
*******************************/
/* <meter> */
meter {
/* Reset the default appearance */
// -webkit-appearance: none; /* this breaks Chrome v52+ http://blog.chromium.org/2016/06/chrome-52-beta-css-containment-simpler.html */
-moz-appearance: none;
appearance: none;
@Bandit
Bandit / gist:2144859
Created March 21, 2012 05:37
No Social Spam Gmail Filter
Matches:
subject:(-{"Direct Message"})
(
from:facebookmail.com OR
from:linkedin.com OR
from:foursquare.com OR
from:postmaster.twitter.com OR
from:twitter.com OR
from:meetup.com OR
from:friendfeed.com OR
Two guys are sitting at a bar.
"You know why I love this bar?" asks the first one.
"No," says the second guy. "Why do you love this bar?"
The first guy points at the window, which is six stories above the ground. "It has a magic window," he says. "You jump out of that window, and you can fly."
The second guy just shakes his head. "Shut up."
if(window.history && window.history.pushState) window.history.pushState({}, document.title, url);
@Bandit
Bandit / gmail-spam-filter.txt
Created May 9, 2011 04:46
Spam? What spam?
Matches: (india AND (dear OR sir OR madam OR partner) AND (seo OR "web design" OR "web solution" OR "web marketing" OR outsource OR outsourcing))
Do this: Skip Inbox, Apply label "+SPAM", Never mark it as important