Discover gists
//If you're running this code using F# REPL then you have to do run this command: | |
//#r "C:\Program Files\Microsoft Visual Studio 10.0\Visual Studio Tools for Office\PIA\Office14\Microsoft.Office.Interop.Excel.dll" | |
//Open up the correct namespace | |
open Microsoft.Office.Interop.Excel | |
//Open Excel | |
let xl = new ApplicationClass(Visible = true) | |
Wave Function Collapse (WFC) by @exutumno is a new algorithm that can generate procedural patterns from a sample image. It's especially exciting for game designers, letting us draw our ideas instead of hand coding them. We'll take a look at the kinds of output WFC can produce and the meaning of the algorithm's parameters. Then we'll walk through setting up WFC in javascript and the Unity game engine.
The traditional approach to this sort of output is to hand code algorithms that generate features, and combine them to alter your game map. For example you could sprinkle some trees at random coordinates, draw roads with a brownian motion, and add rooms with a Binary Space Partition. This is powerful but time consuming, and your original vision can someti
<?php | |
/** | |
* If you need something safer or more complete see https://github.com/lstrojny/functional-php, | |
* in particular, https://github.com/lstrojny/functional-php/blob/master/src/Functional/FlatMap.php | |
* | |
* @param Callable $fn Mapping function that returns an array | |
* @param array $array Data over which $fn will be mapped | |
* @return array | |
*/ |
/* | |
Prints speaker notes for a reveal.js presentation. | |
To print the notes, run the js function PrintRevealNotes() | |
You need to disable the pop-up blocker | |
Copyright 2016 Patrick G | |
http://geek1011.github.io | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: |
Accessing a subnet that is behind a WireGuard client using a site-to-site setup
We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.
# implementation of Telegram site authorization checking algorithm | |
# for more information https://core.telegram.org/widgets/login#checking-authorization | |
import collections | |
import hmac | |
import hashlib | |
def check_string(d, token): | |
secret = hashlib.sha256() | |
secret.update(token.encode('utf-8')) |