Skip to content

Instantly share code, notes, and snippets.

View dom111's full-sized avatar
⌨️

Dom Hastings dom111

⌨️
View GitHub Profile
#!/usr/bin/perl
use strict;
use Getopt::Long;
my $size = 48;
my $dict = 'dict';
my ($name, $board_file, $reprocess_frequencies, $print_board, $print_html, $print_help);
my $help = qq{Hexiled word-tile simulator
This file has been truncated, but you can view the full file.
aal
aalii
aam
aani
aardvark
aardwolf
aaron
aaronic
aaronical
aaronite
javascript:(function(){var a={},b=null,c=null,d=null,e=null,f={},g={color:"#f08",background:"#bbb",shadow:"#fff",fallback:!1},h=window.devicePixelRatio>1,i=function(){var a=navigator.userAgent.toLowerCase();return function(b){return-1!==a.indexOf(b)}}(),j={ie:i("msie"),chrome:i("chrome"),webkit:i("chrome")||i("safari"),safari:i("safari")&&!i("chrome"),mozilla:i("mozilla")&&!i("chrome")&&!i("safari")},k=function(){for(var a=document.getElementsByTagName("link"),b=0;a.length>b;b++)if("icon"===a[b].getAttribute("rel")||"shortcut icon"===a[b].getAttribute("rel"))return a[b];return!1},l=function(){for(var a=document.getElementsByTagName("link"),b=document.getElementsByTagName("head")[0],c=0;a.length>c;c++)("icon"===a[c].getAttribute("rel")||"shortcut icon"===a[c].getAttribute("rel"))&&b.removeChild(a[c])},m=function(a){l();var b=document.createElement("link");b.type="image/x-icon",b.rel="icon",b.href=a,document.getElementsByTagName("head")[0].appendChild(b)},n=function(){return e||(e=document.createElement("canvas
$_=lc<>;die" -
"x3if/[kmvwx]/i;y/chiou/kmvwx/;$i.=(/[acefgopqsz\?0235-9]/?' _ ':$"x3),$m.=(/[abce-hlmopqstuy045689]/?'!':$").(/[abdefhkmnp-twyz\-\?2-689]/?'_':$").(/[adhijopquyz\?0-4789]/?'!':$"),$p.=(/[a-hj-prtuwxz\?0268]/?'!':$").(/[b-egjklostuw-z0235689]/?'_':$").(/[abdg-jmnoqsu-y013-9]/?'!':$")for/./g;print"$i
$m
$p
"
@dom111
dom111 / terminal-colour-data.txt
Created August 21, 2015 11:39
Bash terminal data
0 = #000000 = 0 0 0
1 = #800000 = 0 100 25
2 = #008000 = 120 100 25
3 = #808000 = 60 100 25
4 = #000080 = 240 100 25
5 = #800080 = 300 100 25
6 = #008080 = 180 100 25
7 = #c0c0c0 = 0 0 75
8 = #808080 = 0 0 50
9 = #ff0000 = 0 100 50
@dom111
dom111 / detail.txt
Last active September 25, 2015 17:50
n=1
(Just a space, starting square, never expect this!)
n=4
VNZNT
IFOSN
# Change settings here - colour assumes Bash-like ANSI supported terminal
$colour = 1;
$testing = 0;
$n=<>;
$n+=!($n%2);
@l=split//,'??EEEEEEEEEEEEAAAAAAAAAIIIIIIIIIOOOOOOOONNNNNNRRRRRRTTTTTTLLLLSSSSUUUUDDDDGGGBBCCMMPPFFHHVVWWYYKJXQZ';
if($testing){
map{$m=$_-1;$r[$m]=[map'.',1..$n]}1..$n;
}
santa([['Alice', 'Bob'], ['Carla', 'Dan', 'Erin'], ['Frank'], ['Gary']], {"Bob":["Frank"]});
santa([
[0, 0, 1, 1, 1, 1, 1],
[0, 0, 0, 0, 0, 1, 0],
[1, 1, 0, 0, 0, 1, 1],
[1, 1, 0, 0, 0, 1, 1],
[1, 1, 0, 0, 0, 1, 1],
[1, 1, 1, 1, 1, 0, 1],
[1, 1, 1, 1, 1, 1, 0]
]);
function santa(data) {
// get the names from the first index of the array
var names = data.map(a => a.shift()),
result = {};
// build the data structure as an object of gifter => giftees
names.map((name, i) => result[name] = data[i].map((v, j) => v ? names[j] : false).filter(v => v));
// iterate around each name
while (names.length) {
// make sure we start with the name that has the fewest choices
[
["Aaron",0,0,1,1,0,0,1,1,1,0,1,1,0,1,0,0,0,0,0,0,0,1,0,1,0,1,0,1,1,1,0,1,0,1,1,0,1,0,0,1,1,0,0,0,0,0,0,1,1,1,0,1,1,1,0,1,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,1,0,0,0,0,1,1,0,1,1,1,0,1,1,0,1,0,1,1,0,1,1,0,1,0,1,0,0,0,1,1,0,0,1,0,1,1,1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