Skip to content

Instantly share code, notes, and snippets.

View futurefabric's full-sized avatar
👋

Guy Moorhouse futurefabric

👋
View GitHub Profile
@olets
olets / domain-from-url.twig
Last active September 9, 2019 14:38
get the domain from a url
{% set no_protocol = url|split('//')[1] ?: url %}
{% set only_domains = no_protocol|split('/')[0] ?: no_protocol %}
{% set url_domain = '' %}
{% if only_domains|split('.')[2] %}
{% set url_domain = only_domains|split('.')[1] %}
{% else %}
{% set url_domain = only_domains|split('.')[0] %}
{% endif %}
@gre
gre / easing.js
Last active April 23, 2024 04:20
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {