Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

thednp

🏠
Working from home
View GitHub Profile
@thednp
thednp / quadratic-bezier.js
Created Sep 12, 2020 — forked from tunght13488/quadratic-bezier.js
quadratic bezier curve length in javascript
View quadratic-bezier.js
/*
* 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 Aug 17, 2020 — forked from timo22345/flatten.js
Flatten.js, general SVG flattener. Flattens transformations of SVG shapes and paths. All shapes and path commands are supported.
View flatten.js
<!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/
View decompose.js
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 Feb 6, 2020 — forked from joelambert/morf.js
Morf v0.1.5 Pre Release
View morf.js
/**
* @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) {
View templates\protostar\html\layouts\com_content\article\image.php
<?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 — forked from dongilbert/namespace.php
Joomla Namespace Compatibility Layer
View namespace.php
<?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',
View index.html
<!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">
View classList.js
// 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 Sep 13, 2016 — forked from SleepWalker/swipe.js
A simple swipe detection on vanilla js
View swipe.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 Sep 6, 2016 — forked from andredublin/timezones.txt
list of gmt timezones in different languages
View timezones.txt
/*
|--------------------------------------------------------------------------
| GMT Timezones
|--------------------------------------------------------------------------
|
| List GMT Timezones
*/
************ PHP ************
$timezones = array(