Skip to content

Instantly share code, notes, and snippets.

View nyurik's full-sized avatar

Yuri Astrakhan nyurik

View GitHub Profile

Write a simple game similar to [snake][].

Gameplay

When a user opens the page in their browser, it should display an empty playing field with a board, current score (0), a start button, and a list of top ten past scores.

  • The game field is surrounded by a border
  • The snake starts in a fixed position (e.g. the center or one of the corners of the game field)
  • The snake grows indefinitely, with its tail fixed at the starting position
  • The direction of the snake is controlled with the arrow keys
  • There are no items to "eat" on the field, just an empty space with the growing snake
  • The game ends when the snake hits the field's border or its own tail
@nyurik
nyurik / Importing
Last active August 29, 2015 14:24
DB Imports stats
Generating 1 tiles
DONE: 3min Z=0 0/s {"checked":1,"nosave":0,"ozload":0,"ozloadempty":0,"ozloaderror":0,"ozloadok":0,"save":1,"started":1,"tilegen":1,"tilegenempty":0,"tilegenerr":0,"tilegenok":1,"tilenodata":0,"tilenonsolid":0,"tiletoobig":1,"totalsize":917352,"avgsize":917352}
Generating 4 tiles
DONE: 11min Z=1 0/s {"checked":4,"nosave":0,"ozload":0,"ozloadempty":0,"ozloaderror":0,"ozloadok":0,"save":4,"started":4,"tilegen":4,"tilegenempty":0,"tilegenerr":0,"tilegenok":4,"tilenodata":0,"tilenonsolid":0,"tiletoobig":4,"totalsize":1455039,"avgsize":363759.75}
Generating 16 tiles
DONE: 19min Z=2 0/s {"checked":16,"nosave":0,"ozload":0,"ozloadempty":0,"ozloaderror":0,"ozloadok":0,"save":16,"started":16,"tilegen":16,"tilegenempty":0,"tilegenerr":0,"tilegenok":16,"tilenodata":0,"tilenonsolid":0,"tiletoobig":16,"totalsize":2453543,"avgsize":153346.44}
Generating 64 tiles
DONE: 33min Z=3 0/s {"checked":64,"nosave":0,"ozload":0,"ozloadempty":0,"ozloaderror":0,"ozload
/{module:graphoid}:
x-modules:
- name: simple_service
version: 1.0.0
type: file
options:
paths:
# Do we need those parameters??
/v1/png:
post:
{
"width": 400, "height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"data": [
{
"name": "table",
"values": [
{"x": 1, "y": 28}, {"x": 2, "y": 55},
{"x": 3, "y": 43}, {"x": 4, "y": 91},
{"x": 5, "y": 81}, {"x": 6, "y": 53},
{
"width": 400,
"height": 200,
"padding": {"top": 10, "left": 30, "bottom": 30, "right": 10},
"data": [
{
"name": "table",
"values": [
{"x":1},{"x":2},{"x":3},{"x":4},{"x":5},{"x":6},{"x":7},{"x":8},{"x":9},{"x":10},{"x":11},{"x":12},{"x":13},{"x":14},{"x":15},{"x":16},{"x":17},{"x":18},{"x":19},{"x":20}
],
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
ALTER FUNCTION public.bail_out(msg text, param1 text, param2 text, param3 text) OWNER TO osmimporter;
ALTER FUNCTION public.clean_int(i text) OWNER TO osmimporter;
ALTER FUNCTION public.clean_numeric(i text) OWNER TO osmimporter;
ALTER FUNCTION public.get_label_name(name text) OWNER TO osmimporter;
ALTER FUNCTION public.insert_admin_row(therow admin, geom geometry) OWNER TO osmimporter;
ALTER FUNCTION public.insert_admin_rows(therow admin, geom geometry, maritime boolean) OWNER TO osmimporter;
ALTER FUNCTION public.labelgrid(geometry geometry, grid_width numeric, pixel_width numeric) OWNER TO osmimporter;
ALTER FUNCTION public.linelabel(zoom numeric, label text, geometry geometry) OWNER TO osmimporter;
ALTER FUNCTION public.merc_buffer(geom geometry, distance numeric) OWNER TO osmimporter;
ALTER FUNCTION public.merc_dwithin(geom1 geometry, geom2 geometry, distance numeric) OWNER TO osmimporter;
--
-- PostgreSQL database dump
--
SET statement_timeout = 0;
SET lock_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SET check_function_bodies = false;
SET client_min_messages = warning;
#!/usr/local/bin/python3
# -*- coding: utf-8 -*-
from pywikibot.data.sparql import SparqlQuery
import re
import overpass
import time
import os
import errno
# import csv
{
$schema: https://vega.github.io/schema/vega/v3.0.json
_hostConfig:
{
type: map
delayRepaint: false
latitude: 52
longitude: 0
zoom: 7
}