Skip to content

Instantly share code, notes, and snippets.

View JezDriver's full-sized avatar

Jeremy Driver JezDriver

View GitHub Profile
@JezDriver
JezDriver / prompt-colours.sh
Created January 9, 2026 01:43
Variables for outputting text with nice colours #bash
# Include this in your bash profile with:
# source "/path/prompt-colours.sh"
# -------
# Colours
# -------
# Reset
NC='\033[0m' # Text Reset
@JezDriver
JezDriver / responsive-svg-clip-path.md
Last active October 15, 2025 06:17
Responsively sizing clip-path using SVG #svg #html #css

How to do it

  1. Export your SVG
  2. Chuck it inline on your page somewhere
  3. Add width="0px" height="0px" style="position:absolute;pointer-events:none" to the svg element to make it not visible on the page.
  4. Put the <path> element within a <clipPath> element
  5. Add an ID and clipPathUnits="objectBoundingBox" to the clipPath element.
  6. Convert the path data to 'relative' using this site: https://yoksel.github.io/relative-clip-path/ (when exported, path values will be 'absolute', and reference pixel dimensions essentially, this makes it truly responsive).
  7. Reference the ID you added for the clipPath in your CSS.
@JezDriver
JezDriver / is-new-session.php
Created June 24, 2025 01:47
Check if a session exists and a variable has been set #php
<?
function isNewSession() {
if(session_id() == '' || !isset($_SESSION) || session_status() === PHP_SESSION_NONE) {
// session isn't started
session_set_cookie_params(3600,"/"); // 1 hour
session_start();
}
if (!isset($_SESSION['new_session'])) {
$_SESSION['new_session'] = true;
@JezDriver
JezDriver / export-import-all-databases.sh
Last active March 30, 2025 07:00
Export / import all databases #mysql #bash #terminal
# Export
mysqldump --all-databases > all_databasess.sql
# Import
mysql -u root < all_databasess.sql
@JezDriver
JezDriver / shine-effect.scss
Last active March 26, 2025 01:22
Shine effect #css
body {
background: #222;
}
.btn {
position: relative;
display: inline-block;
background: transparent;
color: gold;
border: 2px solid;
@JezDriver
JezDriver / animations.scss
Last active March 25, 2025 05:44
Peekaboo - animate elements when they enter the viewport #js #css #scss
[data-peekaboo="fadeinup"] {
transition: 1.5s ease;
transition-property: opacity, transform;
// Animations runs automatically if there's no JS
&:not(.visible, html.no-js *) {
opacity: 0;
transform: translateY(1em);
}
}
@JezDriver
JezDriver / nice-eases.css
Last active September 25, 2024 02:39
Collection of nice eases for css anims
:root {
--fast-slow-fast: cubic-bezier(0.25, 1, 0.25, 1); /* https://sandwich.co/ */
--fase-out-slow-in: cubic-bezier(0.4, 0, 0.2, 1); /* 0.5s dur https://debutify.com/blog/building-single-product-shopify-store-from-scratch */
}
@JezDriver
JezDriver / google-sheets-exclude-range-from-other-range.md
Created August 16, 2024 04:56
Exclude a range from another range, returning the initial range without items in the second #gsheets
@JezDriver
JezDriver / dev-tools-broken-link-checker.js
Created August 1, 2024 06:32
Check broken links using dev tools #js
@JezDriver
JezDriver / use-video-as-poster.html
Created August 1, 2024 02:53
Use a video as only a poster without preloading the video itself #html
<!-- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/video#preload -->
<video muted preload="metadata">
<source src="/blah.mp4" type="video/mp4">
</video>