Skip to content

Instantly share code, notes, and snippets.

View graphis's full-sized avatar

Zsolt Sándor graphis

View GitHub Profile
@graphis
graphis / router-middleware.php
Created May 26, 2020 19:19 — forked from harikt/router-middleware.php
Conduit router middleware example
<?php
require dirname(__DIR__) . '/vendor/autoload.php';
use Phly\Conduit\Middleware;
use Phly\Http\Server;
$app = new Middleware();
$router = new \Aura\Router\Router(
new \Aura\Router\RouteCollection(new \Aura\Router\RouteFactory),
new \Aura\Router\Generator
@graphis
graphis / README.md
Created June 2, 2020 20:08 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@graphis
graphis / phpbuild.md
Created July 23, 2020 15:20 — forked from rizalp/phpbuild.md
Minimal Build of PHP 7.4.5, linked with sqlite3 from source on Ubuntu 18.04 And Macos
@graphis
graphis / resize-debounce.js
Created August 28, 2020 12:32
JavaScript: window resize debouncing #snippet
/* --------------------------------------------
* Detect device orientation
* and trigger changes based on it
--------------------------------------------*/
function updateOrientation() {
// Detect whether device supports orientationchange event, otherwise fall back to the resize event
// Genius solution from http://stackoverflow.com/a/2307936
var supportsOrientationChange = "onorientationchange" in window,
orientationEvent = supportsOrientationChange ? "orientationchange" : "resize",
newAngle, newOrientation;
@graphis
graphis / .block
Created November 10, 2020 08:05 — forked from gkhays/.block
Oscillating Sine Wave Rendered with JavaScript
license: cc-by-4.0
@graphis
graphis / Math.uuid.js
Created November 23, 2020 15:13 — forked from Wind4/Math.uuid.js
/*!
Math.uuid.js (v1.4)
http://www.broofa.com
mailto:robert@broofa.com
Copyright (c) 2010 Robert Kieffer
Dual licensed under the MIT and GPL licenses.
*/
/*
OpenSimplexNoise noise;
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {