Skip to content

Instantly share code, notes, and snippets.

View danielwolf1's full-sized avatar

Daniel W danielwolf1

View GitHub Profile
@danielwolf1
danielwolf1 / jquery.slider.non-linear-steps.html
Created July 10, 2020 08:44
jQuery UI Slider with custom (non-linear) steps and snapping
<input type="text" data-value value="1">
<div id="slider">
</div>
@danielwolf1
danielwolf1 / gist:cb0516fc6c180c4106c0
Last active October 12, 2015 09:19 — forked from ozh/gist:8169202
Human readable time difference between 2 dates in PHP. Allows to pass translations for intervals.
<?php
/**
* Get human readable time difference between 2 dates
*
* Return difference between 2 dates in year, month, hour, minute or second
* The $precision caps the number of time units used: for instance if
* $time1 - $time2 = 3 days, 4 hours, 12 minutes, 5 seconds
* - with precision = 1 : 3 days
* - with precision = 2 : 3 days, 4 hours