Skip to content

Instantly share code, notes, and snippets.

@Sambego
Sambego / Animate.js
Created May 6, 2016 08:55
Animation function
/*
* A simple function to animate a property of an element to a new value.
*/
const animate = function animate(element, property, value, duration) {
const fps = 60;
const timeout = duration / (1000 / fps);
const startTime = new Date();
const startValue = element[property];
const step = function step() {
const currentTime = new Date();
@Sambego
Sambego / le-renew
Last active December 21, 2015 13:21
Check if a Let's Encrypt certificate needs renewal, and renew if possible. This script is an adapted version of the one made by Erika Heidi for Digital Ocean. The only difference is this works on nginx.
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Nginx on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# Edited by Sam Bellen <@sambego>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
@Sambego
Sambego / Pure-css-gauge.markdown
Last active January 2, 2016 15:38
A Pen by Sam.