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
@Robin-bob
Robin-bob / _gdpr.liquid
Last active March 9, 2023 15:03
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>
@Splode
Splode / Laravel-Scheduler-Windows.md
Last active June 12, 2024 12:11
Laravel Scheduler on Windows

Run Laravel Scheduled Tasks on Windows

The following are instructions for running scheduled tasks defined in a Laravel project on Windows. The Laravel documentation provides instructions for running scheduled tasks using cron jobs on Linux systems. However, cron jobs are not available on Windows. The built-in Windows Task Scheduler can be used to run scheduled tasks instead.

Create a Scheduled Task

  1. Open Task Scheduler
  2. Select Create Task...
  3. Give the task a name and description
  4. To run the task in the background, select Run whether the user is logged on or not and check the Hidden checkbox.
@cuth
cuth / debug-scroll.md
Last active June 28, 2024 19:44
Find the elements that are causing a horizontal scroll. Based on http://css-tricks.com/findingfixing-unintended-body-overflow/

Debug Horizontal Scroll

(function (d) {
    var w = d.documentElement.offsetWidth,
        t = d.createTreeWalker(d.body, NodeFilter.SHOW_ELEMENT),
        b;
    while (t.nextNode()) {
        b = t.currentNode.getBoundingClientRect();
 if (b.right &gt; w || b.left &lt; 0) {
@bcole808
bcole808 / numberAbbreviation.php
Created March 5, 2014 17:18
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 => "");
@loudnarrative
loudnarrative / html5audiofade.js
Created April 16, 2012 03:18
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) {