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 | |
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
#!/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
/** | |
* @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
<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
<html> | |
<head> | |
<title>Canvas 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="main.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
var players = ['A', 'B', 'C', 'D', 'E', 'F', 'G' ]; | |
var generateRounds = function(players, bye){ | |
// add bye to rotation if number of players is odd | |
if(players.length % 2 == 1){ | |
players.push(bye); | |
} | |
// first player does not rotate | |
var first = players.shift(); |
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
/** | |
* Polyomino | |
*/ | |
function Polyomino(){ | |
this.points = []; | |
} | |
Polyomino.prototype.print = function(){ | |
var allX = this.points.map(function(p){ return p.x; }); | |
var allY = this.points.map(function(p){ return p.y; }); |
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
# White (40) | |
Loam Lion | |
Hopeful Eidolon | |
Loyal Cathar | |
Leonin Relic-Warder | |
Knight of Cliffhaven | |
Kor Skyfisher | |
Dauntless River Marshal | |
Hidden Dragonslayer | |
Flickerwisp |
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
# Windows image file caches | |
Thumbs.db | |
ehthumbs.db | |
# Folder config file | |
Desktop.ini | |
# Recycle Bin used on file shares | |
$RECYCLE.BIN/ | |
# Windows Installer files | |
*.cab | |
*.msi |
NewerOlder