Skip to content

Instantly share code, notes, and snippets.

View OrderAndCh4oS's full-sized avatar
🕰️
Writing code

Sean Cooper OrderAndCh4oS

🕰️
Writing code
View GitHub Profile
@OrderAndCh4oS
OrderAndCh4oS / index.js
Created May 1, 2021 16:43
hicetnunc update _block_levels lookup obj
import fetch from 'node-fetch';
import fs from 'fs';
const blockLevels = {
0: 1365242
};
let tokenId = 1000;
while(true) {
@OrderAndCh4oS
OrderAndCh4oS / iso-639-2-lookup.json
Last active August 23, 2022 22:48
iso-639-2 language code to iso-639-1 look up json
{
"abk": {
"iso-639-2": "abk",
"iso-639-1": "ab",
"english": "Abkhazian",
"french": "abkhaze",
"german": "Abchasisch"
},
"ace": {
"iso-639-2": "ace",
@OrderAndCh4oS
OrderAndCh4oS / iso-639-1-lookup.json
Last active August 23, 2022 22:47
iso-639-1 language code to iso-639-2 look up json
{
"ab": {
"iso-639-2": [
"abk"
],
"iso-639-1": "ab",
"english": "Abkhazian",
"french": "abkhaze",
"german": "Abchasisch"
},
@OrderAndCh4oS
OrderAndCh4oS / trie.js
Last active March 11, 2021 19:27
Javascript Trie
class CharNode {
_char;
_phonetics = new Set();
_nextCharsLevel = {};
constructor(char) {
this._char = char;
}
get phoneticsLength() {
@OrderAndCh4oS
OrderAndCh4oS / iso-3166-country-codes.ts
Last active August 23, 2022 22:46
ISO 3166 Country Codes Typescript Object JSON
// https://www.iso.org/obp/ui/#search
const isoCountryCodes = [
{name: 'Andorra', alphaTwoCode: 'AD', alphaThreeCode: 'AND', numeric: '020'},
{name: 'United Arab Emirates', alphaTwoCode: 'AE', alphaThreeCode: 'ARE', numeric: '784'},
{name: 'Afghanistan', alphaTwoCode: 'AF', alphaThreeCode: 'AFG', numeric: '004'},
{name: 'Antigua and Barbuda', alphaTwoCode: 'AG', alphaThreeCode: 'ATG', numeric: '028'},
{name: 'Anguilla', alphaTwoCode: 'AI', alphaThreeCode: 'AIA', numeric: '660'},
{name: 'Albania', alphaTwoCode: 'AL', alphaThreeCode: 'ALB', numeric: '008'},
{name: 'Armenia', alphaTwoCode: 'AM', alphaThreeCode: 'ARM', numeric: '051'},
{name: 'Angola', alphaTwoCode: 'AO', alphaThreeCode: 'AGO', numeric: '024'},
@OrderAndCh4oS
OrderAndCh4oS / stripe-test-cards-json.ts
Created July 18, 2020 08:32
Stripe Test Card Data
const randomInteger = (min: number, max: number) =>
Math.floor(Math.random() * (max - min + 1)) + min;
export const getFutureExpiryDate = () => {
const now = new Date();
now.setFullYear(now.getFullYear() + randomInteger(1, 5));
return {month: randomInteger(1, 12), year: now.getFullYear().toString().slice(2)};
}
export const getPastExpiryDate = () => {
@OrderAndCh4oS
OrderAndCh4oS / stripe-test-cards-json.ts
Created July 18, 2020 08:32
Stripe Test Card Data
const randomInteger = (min: number, max: number) =>
Math.floor(Math.random() * (max - min + 1)) + min;
export const getFutureExpiryDate = () => {
const now = new Date();
now.setFullYear(now.getFullYear() + randomInteger(1, 5));
return {month: randomInteger(1, 12), year: now.getFullYear().toString().slice(2)};
}
export const getPastExpiryDate = () => {
<div style="position: relative;height: 245px;overflow: hidden;">
<iframe
style="position: absolute;top:0;left: 0;width: 100%;height: 100%;"
src="https://io-radio-embed.orderandchaoscreative.com/"
frameborder="0" scrolling="no"
onload="this.height=this.contentWindow.document.body.scrollHeight;"
></iframe>
</div>
r = 0xff;
g = 0xff;
b = 0xff;
rgb = (r << 16) | (g << 8) | b;
console.log(rgb);
red = (rgb >> 16) & 0x0ff;
green = (rgb >> 8) & 0x0ff;
blue = (rgb) & 0x0ff;
console.log(red);
console.log(green);
@OrderAndCh4oS
OrderAndCh4oS / .png2mp4
Created February 23, 2020 10:47
png2mp4
function png2mp4() {
ffmpeg -framerate 12 -pattern_type glob -i '*.png' -c:v libx264 -pix_fmt yuv420p "out${1}.mp4";
mkdir "stills${1}";
find ./ -maxdepth 1 -name '*.png' -exec mv {} "./stills${1}" \;
}