Skip to content

Instantly share code, notes, and snippets.

View okikio's full-sized avatar
🏠
Working from home

Okiki Ojo okikio

🏠
Working from home
View GitHub Profile
@okikio
okikio / basic.css
Last active February 22, 2016 21:52
* {
vertical-align: baseline;
box-sizing: border-box;
line-height: 1.5;
list-style: none;
font-size: 100%;
font: inherit;
padding: 0;
margin: 0;
border: 0;
$(document).ready(function() {});
@okikio
okikio / index.html
Created January 2, 2017 00:45
website 17
<html>
<body>
<header class="navbar-layout">
<header class="navbar-layout__header layout--fixed-header">
<a class="navbar-layout__drawer-button">
<i class="fa fa-bars"></i>
</a>
<nav class="navbar-layout__header-row">
*, *:before, *:after {
box-sizing: border-box;
outline: none;
resize: none;
border: none;
padding: 0;
margin: 0;
}
@media (max-width: 300px) {
@okikio
okikio / README.md
Last active June 25, 2021 20:35
Parallax Template
@okikio
okikio / WebWorker.ts
Created October 13, 2021 14:22
A WebWorker/SharedWorker compatibility class you can use to polyfill/ponyfill the SharedWorker class in unsupported environments. This follows the Web standard, so, it doesn't support Nodejs's WorkerThreads.
// WebWorker/SharedWorker compatability class from https://github.com/okikio/bundle/blob/main/src/ts/util/WebWorker.ts
export class WebWorker implements EventTarget, AbstractWorker {
static SharedWorkerSupported = "SharedWorker" in globalThis;
ActualWorker: SharedWorker | Worker;
constructor(url: string | URL, opts?: WorkerOptions) {
if (WebWorker.SharedWorkerSupported) {
this.ActualWorker = new SharedWorker(url, opts);
} else {
this.ActualWorker = new Worker(url, opts);
}
@okikio
okikio / script.ts
Last active October 19, 2021 15:18
ts-server.js
importScripts("https://unpkg.com/@typescript/vfs@1.3.5/dist/vfs.globals.js");
importScripts(
"https://cdnjs.cloudflare.com/ajax/libs/typescript/4.4.3/typescript.min.js"
);
importScripts("https://unpkg.com/@okikio/emitter@2.1.7/lib/api.js");
export type VFS = typeof import("https://cdn.esm.sh/@typescript/vfs");
export type EVENT_EMITTER = import("https://cdn.esm.sh/@okikio/emitter").EventEmitter;
export type Diagnostic = import("https://cdn.esm.sh/@codemirror/lint").Diagnostic;
@okikio
okikio / bezier-easing.ts
Last active September 25, 2022 15:42
custom-easing.ts - a set of easing functions that generate arrays of tweens/frames; when placed in an animation framework/library they emulate animations using said easing function. Since, the easing frames can be placed are generated on initial run and almost every conventional animation library/framework supports multiple animation frames, you…
/**
* https://github.com/gre/bezier-easing
* BezierEasing - use bezier curve for transition easing function
* by Gaëtan Renaudeau 2014 - 2015 – MIT License
*/
// These values are established by empiricism with tests (tradeoff: performance VS precision)
export const NEWTON_ITERATIONS = 4;
export const NEWTON_MIN_SLOPE = 0.001;
export const SUBDIVISION_PRECISION = 0.0000001;
@okikio
okikio / resolve-imports.js
Last active April 15, 2022 16:43
A fork of resolve.exports but for the imports field of package.json
/** resolve.exports but for imports */
/**
* @param {object} imports
* @param {Set<string>} keys
*/
function loop(imports, keys) {
if (typeof imports === 'string') {
return imports;
}

Pre-compiled Astro SSR templates

To op Generate Partially Static SSR Page for faster compile