Skip to content

Instantly share code, notes, and snippets.

View john555's full-sized avatar
🤖

jp john555

🤖
View GitHub Profile
<?php
$router = new Router(new Request);
$router->get('/', function() {});
<?php
include_once 'IRequest.php';
class Request implements IRequest
{
function __construct()
{
$this->bootstrapSelf();
}
<?php
class Router
{
private $request;
private $supportedHttpMethods = array(
"GET",
"POST"
);
<?php
interface IRequest
{
public function getBody();
}
<?php
class Router
{
private $request;
function __construct(IRequest $request)
{
$this->request = $request;
}
}
<?php
include_once 'Request.php';
include_once 'Router.php';
$router = new Router(new Request);
$router->get('/', function() {
return <<<HTML
<h1>Hello world</h1>
HTML;
const svg = document.querySelector('svg');
const currentTime = new Date();
svg.style.setProperty('--start-seconds', currentTime.getSeconds());
svg.style.setProperty('--start-minutes', currentTime.getMinutes());
svg.style.setProperty('--start-hours', currentTime.getHours() % 12);
<g class="marks">
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
<line x1="15" y1="0" x2="16" y2="0" />
.hour {
...
animation: rotateHourHand calc(12 * 60 * 60s) linear infinite;
animation-delay: calc(calc(var(--start-minutes) * -60 * 1s) + calc(var(--start-seconds) * -1 * 1s));
}
@keyframes rotateHourHand {
from {
transform: translate(20px, 20px) rotate(calc(var(--start-hours) * 30deg));
}
to {