Skip to content

Instantly share code, notes, and snippets.

View only-cliches's full-sized avatar

Scott Lott only-cliches

View GitHub Profile
@typpo
typpo / BCP47-locales.md
Last active August 14, 2024 19:58
BCP 47 language tags
Language Tag Language Region Description
ar-SA Arabic Saudi Arabia Arabic (Saudi Arabia)
bn-BD Bangla Bangladesh Bangla (Bangladesh)
bn-IN Bangla India Bangla (India)
cs-CZ Czech Czech Republic Czech (Czech Republic)
da-DK Danish Denmark Danish (Denmark)
de-AT German Austria Austrian German
de-CH German Switzerland "Swiss" German
de-DE German Germany
@kesor
kesor / Dockerfile
Last active September 15, 2024 11:36
Compile DENO on Alpine (w/MUSL C)
FROM rust:alpine
RUN apk add --no-cache \
bash \
binutils-gold \
ca-certificates \
clang \
curl \
g++ \
git \
@bmorelli25
bmorelli25 / binarySearch.js
Created August 1, 2017 17:50
Bitcoin Chart Binary Search
// d=data, t=target, s=start, e=end, m=middle
const binarySearch = (d, t, s, e) => {
const m = Math.floor((s + e)/2);
if (t == d[m].svgX) return d[m];
if (e 1 === s) return Math.abs(d[s].svgX t) > Math.abs(d[e].svgX t) ? d[e] : d[s];
if (t > d[m].svgX) return binarySearch(d,t,m,e);
if (t < d[m].svgX) return binarySearch(d,t,s,m);
}
let closestPoint = binarySearch(data,target, 0, data.length-1)
@only-cliches
only-cliches / pixibackground.js
Last active March 14, 2024 12:07
PixiJS Background Cover & Background Container
/*
* PixiJS Background Cover/Contain Script
* Returns object
* . {
* container: PixiJS Container
* . doResize: Resize callback
* }
* ARGS:
* bgSize: Object with x and y representing the width and height of background. Example: {x:1280,y:720}
* inputSprite: Pixi Sprite containing a loaded image or other asset. Make sure you preload assets into this sprite.
@wesm87
wesm87 / react-router-4.0.0-alpha.5.d.ts
Created November 21, 2016 14:13
TypeScript definitions for React Router v4 Alpha
/**
* Custom typedef for React Router v4 (WIP).
*/
declare module 'react-router' {
export type Action = 'PUSH' | 'REPLACE' | 'POP';
export type Location = {
pathname: string,
search: string,