Skip to content

Instantly share code, notes, and snippets.

View thednp's full-sized avatar
🚲
No longer working from home

thednp

🚲
No longer working from home
View GitHub Profile
@thednp
thednp / quadratic-bezier.js
Created September 12, 2020 19:24 — forked from tunght13488/quadratic-bezier.js
quadratic bezier curve length in javascript
/*
* http://en.wikipedia.org/wiki/B%C3%A9zier_curve
* http://www.malczak.linuxpl.com/blog/quadratic-bezier-curve-length/g
*/
function Point(x, y) {
this.x = x;
this.y = y;
}
@thednp
thednp / flatten.js
Created August 17, 2020 09:10 — forked from timo22345/flatten.js
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
<!doctype html>
<html>
<title>Flatten.js, General SVG Flattener</title>
<head>
<script>
/*
Random path and shape generator, flattener test base: https://jsfiddle.net/fjm9423q/embedded/result/
Basic usage example: https://jsfiddle.net/nrjvmqur/embedded/result/
const CSS3Matrix = typeof(DOMMatrix) !== 'undefined' ? DOMMatrix
: typeof(WebKitCSSMatrix) !== 'undefined' ? WebKitCSSMatrix
: typeof(CSSMatrix) !== 'undefined' ? CSSMatrix
: typeof(MSCSSMatrix) !== 'undefined' ? MSCSSMatrix
: null
const Vector4 = function(x, y, z, w) {
this.x = x ? x : 0;
@thednp
thednp / morf.js
Created February 6, 2020 15:26 — forked from joelambert/morf.js
Morf v0.1.5 Pre Release
/**
* @preserve Morf v0.1.5 (pre-release)
* http://www.joelambert.co.uk/morf
*
* Copyright 2011, Joe Lambert.
* Free to use under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*/
var Morf = function(elem, css, opts) {
<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright Copyright (C) 2005 - 2015 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
@thednp
thednp / namespace.php
Created May 12, 2019 11:25 — forked from dongilbert/namespace.php
Joomla Namespace Compatibility Layer
<?php
return array(
'JAccess' => 'Joomla\\Access\\Access',
'JAccessRule' => 'Joomla\\Access\\Rule',
'JAccessRules' => 'Joomla\\Access\\Rules',
'JApplicationBase' => 'Joomla\\Application\\Base',
'JApplicationCli' => 'Joomla\\Application\\Cli',
'JApplicationDaemon' => 'Joomla\\Application\\Daemon',
'JRoute' => 'Joomla\\Application\\Route',
@thednp
thednp / index.html
Last active September 20, 2017 15:11
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="styles.css">
</head>
<body>
<nav class="navbar navbar-inverse">
// Element.prototype.classList polyfill
// developed by thednp
// license MIT
if( !('classList' in Element.prototype) ) {
(function(){
var className = 'className', add = 'add', classList = 'classList', remove = 'remove', contains = 'contains',
prototype = 'prototype', element = 'element';
// classList definition
@thednp
thednp / swipe.js
Created September 13, 2016 19:50 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
var touchstartX = 0;
var touchstartY = 0;
var touchendX = 0;
var touchendY = 0;
var gesuredZone = document.getElementById('gesuredZone');
gesuredZone.addEventListener('touchstart', function(event) {
touchstartX = event.screenX;
touchstartY = event.screenY;
@thednp
thednp / timezones.txt
Created September 6, 2016 16:28 — forked from andredublin/timezones.txt
list of gmt timezones in different languages
/*
|--------------------------------------------------------------------------
| GMT Timezones
|--------------------------------------------------------------------------
|
| List GMT Timezones
*/
************ PHP ************
$timezones = array(