Skip to content

Instantly share code, notes, and snippets.

@vrana
vrana / script.js
Created May 5, 2020 15:29
Cesium obscured line
const lat = 50.6494;
const lng = 15.74;
const degrees = 195;
const place = {"latitude":50.6341,"longitude":15.7263};
const terrainProvider = Cesium.createWorldTerrain();
const terrainExaggeration = 1.5;
const cesium = new Cesium.Viewer('cesiumContainer', {
terrainProvider,
terrainExaggeration,
<?php
if (X) {
$a = 1;
}
// ...
if (X) {
$a;
}
while (true) {
Ahoj v piškvorkách naslepo.
Povolené příkazy jsou:
new - nová hra
quit - konec
[a-i][0-9] - tah na pole, kde řada je pozice a, b, c, d, e, f, g, h, i. Sloupec je 1 až 9.
Formát zápisu je např. e5.
<?php
class BlindTicTacToe {
protected $field;
protected $x, $y;
Ahoj v piškvorkách naslepo.
Povolené příkazy jsou:
new - nová hra
quit - konec
[a-i][0-9] - tah na pole, kde řada je pozice a, b, c, d, e, f, g, h, i. Sloupec je 1 až 9.
Formát zápisu je např. e5.
<?php
function isWinningInDirection(array $field, $x, $y, $a, $b) {
// průzkum jedním směrem
for ($i = 1; $i < 5; $i++) {
<?php
define('DUMP_FILENAME', 'dump.sql');
define('SERVER', 'localhost');
define('USERNAME', 'ODBC');
define('PASSWORD', '');
define('DB', 'software');
define('ADMINER_ROOT', 'adminer/');
function adminer_object() {
class AdminerDump extends Adminer {
@vrana
vrana / AnyKeyArray.php
Last active December 17, 2015 08:39
Array-like object allowing any serializable keys
<?php
class AnyKeyArray implements ArrayAccess, Iterator, Countable {
private $values = array();
// ArrayAccess
function offsetSet($key, $value) {
$this->values[serialize($key)] = $value;
}
@vrana
vrana / gist:1009999
Created June 6, 2011 09:34 — forked from renestein/gist:1009518
Image_Decorator
interface IImagePersistor
{
void Save(Image image, string name);
}
class FilePersistor : IImagePersistor
{
public void Save(Image image, string name)
{
var stream = File.Open(name);