Skip to content

Instantly share code, notes, and snippets.

View warmwhisky's full-sized avatar
💭
Never judge a tune by its' waveform

Ben Taylor warmwhisky

💭
Never judge a tune by its' waveform
View GitHub Profile
@warmwhisky
warmwhisky / _gdpr.liquid
Created March 9, 2023 15:03 — forked from Robin-bob/_gdpr.liquid
GDPR/cookies popup
<section class="gdpr">
<p>
WE VALUE YOUR PRIVACY KOTV Limited uses cookies to help us deliver our services and improve your user experience. Click “Agree” to accept our use of cookies or you can choose to opt out of our use of cookies by following the instructions in our Privacy Policy and Cookie Notice.
</p>
<div class="gdpr--actions">
<button class="gdpr--button js-gdpr-ok">Agree</button>
<a href="https://kotvboxing.uscreen.io/pages/privacy-policy" target="_blank" class="gdpr--button">Read More</a>
</div>
</section>
@warmwhisky
warmwhisky / meilie_search_centos_7.sh
Last active October 1, 2022 16:56
Install MeiliSearch 0.27.1 from source on Centos 7 and set up a service that starts with boot
# Install meilisearch to usr/bin/meilisearch/target/release/meilisearch to use with
#
# Laravel 9.x
# PHP 8.1
# Meilisearch 0.27.1
# meilisearch/meilisearch-php 0.23.3
#
# Using Meilisearch 0.27.1 does not require `GLIBC_2.xx' not found
# as root or sudo
@warmwhisky
warmwhisky / html5audiofade.js
Created February 5, 2021 14:58 — forked from loudnarrative/html5audiofade.js
Fade out HTML5 audio
// every second your audio element is playing
$(audioElement).on('timeupdate', function() {
var vol = 1,
interval = 200; // 200ms interval
if (Math.floor(audioElement.currentTime) == 15) {
if (audioElement.volume == 1) {
var intervalID = setInterval(function() {
// Reduce volume by 0.05 as long as it is above 0
// This works as long as you start with a multiple of 0.05!
if (vol > 0) {
@warmwhisky
warmwhisky / numberAbbreviation.php
Created February 2, 2021 12:22 — forked from bcole808/numberAbbreviation.php
Shorten large numbers into abbreviations (i.e. 1,500 = 1.5k)
<?php
/**
* Shorten large numbers into abbreviations (i.e. 1,500 = 1.5k)
*
* @param int $number Number to shorten
* @return String A number with a symbol
*/
function numberAbbreviation($number) {
$abbrevs = array(12 => "T", 9 => "B", 6 => "M", 3 => "K", 0 => "");
@warmwhisky
warmwhisky / bootstrap-multi-select-date-picker.markdown
Last active August 19, 2023 20:34
Bootstrap Multi Select Date Picker