Skip to content

Instantly share code, notes, and snippets.

View Zverik's full-sized avatar

Ilya Zverev Zverik

View GitHub Profile
@Zverik
Zverik / recursive_index.pl
Created August 31, 2012 16:14
Create index.html with a list of all files
#!/usr/bin/perl
# Create index.html with a list of all files.
# Written by Ilya Zverev, licensed WTFPL.
use strict;
use POSIX qw(strftime);
use HTML::Template;
use File::Basename;
use Getopt::Long;
@Zverik
Zverik / osmradio.sh
Created September 17, 2014 19:41
PulseAudio setup for recording osm radio from skype and mic
#!/usr/bin/sh
# PulseAudio setup for recording osm radio from skype and mic
function rec_start() {
IP=127.0.0.1
PASSWORD=password
DATE=$(date +%y%m%d-%H%M)
# Initializing microphone
MIC_ID=$(pactl list short sources|grep GoMic|grep input|cut -f 1)
@Zverik
Zverik / game.txt
Created August 7, 2020 06:08
flickgame
{"gameLink":"www.flickgame.org","canvasses":[[65,"e",6,"f",153,"e",8,"f",152,"e",8,"f",152,"e",8,"f",151,"e",10,"f",149,"e",11,"f",97,"e",4,"1",48,"e",11,"f",96,"e",13,"1",40,"e",11,"f",96,"e",21,"1",23,"e",1,"1",8,"e",12,"f",95,"e",3,"1",2,"4",41,"1",7,"e",12,"f",15,"e",14,"1",66,"e",3,"1",10,"4",33,"1",7,"e",12,"f",13,"e",21,"1",61,"e",3,"1",18,"4",25,"1",7,"e",12,"f",3,"e",1,"1",6,"e",29,"1",56,"e",3,"1",39,"4",3,"1",8,"e",12,"f",2,"e",13,"1",14,"d",15,"1",51,"e",3,"1",39,"4",3,"1",8,"e",12,"f",2,"e",11,"1",21,"d",16,"1",45,"e",3,"1",39,"4",3,"1",9,"e",10,"f",3,"e",8,"1",29,"d",16,"1",40,"e",3,"1",38,"4",3,"1",11,"e",8,"f",4,"e",3,"1",39,"d",15,"1",36,"e",3,"1",38,"4",3,"1",23,"e",3,"1",45,"d",10,"1",36,"e",3,"1",37,"4",3,"1",23,"e",3,"1",50,"d",5,"1",36,"e",3,"1",37,"4",3,"1",23,"e",3,"1",52,"d",3,"1",36,"e",3,"1",37,"4",3,"1",23,"e",3,"1",52,"d",3,"1",36,"e",3,"1",36,"4",3,"1",24,"e",3,"1",52,"d",3,"1",36,"e",3,"1",36,"4",3,"1",23,"e",3,"1",53,"d",3,"1",36,"e",3,"1",36,"4",3,"1",23,"e",3,"1",53,"d",3,"1"
#!/usr/bin/env python3
import requests
import json
import re
import statistics
import time
resp = requests.get('https://russiancast.club/data.json')
data = resp.json()
@Zverik
Zverik / SingleTile.js
Last active July 4, 2018 12:41
A layer for single-tile WMS layers. Displays a layer as a big picture, updates it on pan and zoom. This is a hack, made for an internal project; still waiting for https://github.com/Leaflet/Leaflet/issues/558 to be solved nicely. Example: L.singleTile('http://irs.gis-lab.info/').setParams({layers: 'landsat'}).addTo(map); (won't work, because tha…
/*
* L.SingleTile uses L.ImageOverlay to display a single-tile WMS layer.
* url parameter must accept WMS-style width, height and bbox.
*/
L.SingleTile = L.ImageOverlay.extend({
defaultWmsParams: {
service: 'WMS',
request: 'GetMap',
version: '1.1.1',
@Zverik
Zverik / make_stop_areas.py
Created September 20, 2017 13:05
Add stop_area relations to a map
#!/usr/bin/env python3
import json
from lxml import etree
import sys
import kdtree
import math
QUERY = """
[out:json][timeout:25][bbox:{{bbox}}];
@Zverik
Zverik / build_dmg.sh
Created November 16, 2016 15:22
Build script for a DMG file of MAPS.ME desktop
#!/bin/bash
set -e -u
OMIM_PATH="$(cd "${OMIM_PATH:-$(dirname "$0")/../..}"; pwd)"
DATA_PATH="$OMIM_PATH/data"
BUILD_PATH="$OMIM_PATH/out"
RELEASE_PATH="$BUILD_PATH/release"
source "$OMIM_PATH/tools/autobuild/detect_qmake.sh"
#rm -rf "$RELEASE_PATH"
@Zverik
Zverik / vecher2016.md
Last active October 21, 2016 08:24
Ссылки для «Вечера оживших карт»

Беспорядочная свалка, почти всё это я показал на «вечере». Есть вопросы? Задавайте на ilya@zverev.info или в телеграме.

@Zverik
Zverik / geo.php
Created October 8, 2014 20:26
Display icecast2 listeners count by country and by city
<?php
$login = 'admin';
$password = '<password>';
$mount = '/radio';
$server = '<ip>:8000';
$url = "http://$server/admin/listclients?mount=$mount";
$opts = array('http' => array(
'method' => 'GET',
'header' => 'Authorization: Basic '.base64_encode("$login:$password")."\r\n"
));
@Zverik
Zverik / index.html
Last active May 24, 2016 15:39 — forked from anonymous/index.html
Presentation
<!DOCTYPE html>
<html>
<head>
<title>Foo</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<style type='text/css'>
body {
font-family: 'Helvetica Neue';
background:#000;