Skip to content

Instantly share code, notes, and snippets.

Change src image on hover (without white flash)

The following CSS and HTML will change a src image on hover, without any white flash effect from the next image loading. It does this by loading both images, setting the position to relative so they sit on top of each other, and configuring the z-index to control which image is visible.

// CSS

.product-photo-hover {
  display:block;
 position:relative
@jaredlt
jaredlt / .bashrc_ps1
Created June 17, 2020 13:09
.bashrc PS1 - custom bash prompt
# Format: jaredt:ahk (master)$ (with 'jaredt:' green, 'current working directory' blue, 'branch' green)
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u:\[\033[01;34m\]\W\[\033[00m\] \[\033[01;32m\]\$(__git_ps1 '(%s)')\[\033[00m\]\$ "
@jaredlt
jaredlt / cbr2cbz.sh
Last active April 24, 2023 14:07
Bulk convert cbr files to cbz
#!/bin/bash
#
# Bulk convert cbr files to cbz
# Will recursively convert all cbr files for the provided path
#
# - Maintains exact file structure within archive
# - Defaults compression level to 'store' (no compression) as most compression already done in the images
#
# Requirements: `sudo apt install unar zip`
#
images

Keybase proof

I hereby claim:

  • I am jaredlt on github.
  • I am jaredt (https://keybase.io/jaredt) on keybase.
  • I have a public key ASC2BxtPaBHcBS2cDVpo6LtB0iAv53X5Rh7D4dt8SgHhkQo

To claim this, I am signing this object:

Why classes are cooool!!11

  • In my app I have a lot of objects that represent an album.
  • Until recently, I was using a generic hash for what I needed
  • eg.
album = {
  album_name: "Pure Heroine (Deluxe)",
  artist_name: "Lorde",
# https://www.quantamagazine.org/mathematicians-discover-prime-conspiracy-20160313/
#
# If Alice tosses a coin until she sees a head followed by a tail, and Bob tosses a
# coin until he sees two heads in a row, then on average, Alice will require four tosses
# while Bob will require six tosses (try this at home!), even though head-tail and head-head
# have an equal chance of appearing after two coin tosses.
require 'pry'
def toss_coin
@jaredlt
jaredlt / quotes.md
Last active January 18, 2021 15:06

"The bitterness of poor quality remains long after the sweetness of low price is forgotten."

— Benjamin Franklin

"Alexander the Great and his mule driver both died and the same thing happened to both."

— Marcus Aurelius

"It doesn’t matter if the cat is black or white as long as it can catch mice."

List of Google Analytics referral exclusions for payment gateways & 3D secure domains

You want to add these domains to Analytic's Referral Exclusion List, otherwise your Acquisition and Ecommerce data will be associated to these domain rather than AdWords, Organic etc.

This list is very incomplete and heavily biased towards the United Kingdom. If you're in the UK this probably covers enough to reasonably consider the problem solved.

TODO: Find a better way that doesn't rely on having to add every bank's own 3D secure domain... (possible solution - investigate Fix2 Actually, this looks like the bees knees)

3D Secure domains

Principles, Concepts, and Mental Models

A living list of mental models, biases and other interesting things that help improve how I think.

Decision making & prioritisation

  • Not invented here syndrome: Reinventing the wheel rather than finding and using a pre-existing external solution.
  • YAGNI (You Aren't Going to Need It): Don't waste resources building presumptive features now (because they may never be needed, even if you think they will).
  • Premature optimisation: A type of YAGNI. Don't optimise before you need to. You might waste an extra week on optimisation that is never needed.
  • Bikeshedding (Parkinson’s Law of Triviality): a committee whose job is to approve plans for a nuclear power plant may spend the majority of its time on relatively unimportant but easy-to-grasp issues, such as what materials to use