This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Wavy Clip Mask</title> | |
</head> | |
<body> | |
<input id="karma" type="range" min="0" max="100" value="50" style="width: 500px;"/> | |
<br> | |
<canvas id="canvas"></canvas> | |
<script src="knot.js" type="text/javascript"></script> | |
<script src="wave.js" type="text/javascript"></script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @param arr Array of LineStrings, see: https://tools.ietf.org/html/rfc7946#appendix-A.2 | |
* @returns LineString | |
*/ | |
function mergeLineStrings(arr){ | |
return { | |
type: 'LineString', | |
coordinates: arr.map(ls => ls.coordinates).reduce((acc, cur) => acc.concat(cur.slice(1))) | |
}; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#usage: ./gifenc.sh source.mkv target.gif | |
palette="/tmp/palette.png" | |
filters="fps=10,scale=800:-1:flags=lanczos" | |
ffmpeg -v warning -i $1 -vf "$filters,palettegen" -y $palette | |
ffmpeg -v warning -i $1 -i $palette -lavfi "$filters [x]; [x][1:v] paletteuse" -y $2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const allPrintings = require('./allPrintings') // download from https://mtgjson.com/downloads/all-files/#AllPrintings | |
// takes a while to load | |
const sets = Object.entries(allPrintings.data) | |
const setsToCheck = sets.filter(set => ['core', 'masters', 'expansion'].includes(set[1].type)) | |
let wordiness = setsToCheck.map(set => { | |
let setSize = set[1].baseSetSize | |
let cards = set[1].cards.filter(card => Number.parseInt(card.number) <= setSize) | |
let words = cards.filter(c => typeof c.text !== 'undefined').reduce((acc, curr) => { return acc + curr.text.split(/\s/).length }, 0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Goal is to fill the empty spots in the initial tuple with positive integers | |
in a way that always four consecutive number have a product of 120. | |
""" | |
import numpy | |
initial = (None, None, 2, None, None, 4, None, None, None, None, None, 3, None, None) # tuple is immutable | |
possible_factors = [2, 3, 4, 5, 6, 10, 15] # all possible factors of 120 if there are 4 factors | |
OlderNewer