Skip to content

Instantly share code, notes, and snippets.

View schors's full-sized avatar

Phil Kulin schors

View GitHub Profile
@schors
schors / rst.json
Created January 12, 2024 13:01
Web Push. Proof of concept.
{"chapter":1,"verse":1,"text":"В начале сотворил Бог небо и землю.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":2,"text":"Земля же была безвидна и пуста, и тьма над бездною, и Дух Божий носился над водою.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":3,"text":"И сказал Бог: да будет свет. И стал свет.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":4,"text":"И увидел Бог свет, что он хорош, и отделил Бог свет от тьмы.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":5,"text":"И назвал Бог свет днем, а тьму ночью. И был вечер, и было утро: день один.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":6,"text":"И сказал Бог: да будет твердь посреди воды, и да отделяет она воду от воды.","translation_id":"RST","book_id":"Gen","book_name":"Genesis"}
{"chapter":1,"verse":7,"text":"И создал Бог твердь, и отделил воду, которая под твердью
@schors
schors / IPv4toInt32.go
Created November 10, 2019 14:06
Convert string with IPv4 address to int32 in GO language
// my IPv4 parser without slices
func ip2i(s string) uint32 {
var ip, n uint32 = 0, 0
var r uint = 24
for i := 0; i < len(s); i++ {
if '0' <= s[i] && s[i] <= '9' {
n = n*10 + uint32(s[i]-'0')
if n > 0xFF {
//Debug.Printf("Bad IP (1) n=%d: %s\n", n, s)
return 0xFFFFFFFF
@schors
schors / btLstHL.tex
Created October 14, 2019 07:59
Реализация btLstHL для подсветки строк и оверлея
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% \btIfInRange{number}{range list}{TRUE}{FALSE}
%
% Test in int number <number> is element of a (comma separated) list of ranges
% (such as: {1,3-5,7,10-12,14}) and processes <TRUE> or <FALSE> respectively
\newcount\bt@rangea
\newcount\bt@rangeb
@schors
schors / fix-lstlinebgrd.tex
Created October 14, 2019 07:56
Обход ошибки подключения пакета lstlinebgrd
\makeatletter
\let\old@lstKV@SwitchCases\lstKV@SwitchCases
\def\lstKV@SwitchCases#1#2#3{}
\makeatother
\usepackage{lstlinebgrd}
\makeatletter
\let\lstKV@SwitchCases\old@lstKV@SwitchCases
\lst@Key{numbers}{none}{%
\def\lst@PlaceNumber{\lst@linebgrd}%
@schors
schors / docker.conf
Last active July 27, 2017 15:28
Dockerized SSH + pam_docker /etc/security/docker.conf example
ashot env_php56_rev01
gogi env_php56_rev01
alice env_php71_rev01
ashot env_php56_rev01
gogi env_php56_rev01
alice env_php71_rev01
@schors
schors / docker-compose.yml
Last active July 27, 2017 15:22
Dockerized ssh + pam_docker + environment containers example
version: '3.3'
services:
php71env:
build:
context: ./php71-build
# OVERLORD_HOST and hostname - for pretty PS1 prompt (OVERLORD_HOST)USER@HOSTNAME:
# Usually this is the name of main node
environment:
- OVERLORD_HOST=arrakis
@schors
schors / crontab
Created July 27, 2017 15:03
Simple empty crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file
# and files in /etc/cron.d. These files also have username fields,
# that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
@schors
schors / cron_entrypoint.sh
Created July 27, 2017 15:02
Environment container php 7.1 entrypiont.sh
FROM php:7.1-cli
RUN apt-get update && apt-get install -y \
openssl \
bash \
locales \
man \
vim \
curl \
wget \
@schors
schors / Dockerfile
Created July 27, 2017 15:00
Environment container php 7.1 Dockerfile
FROM php:7.1-cli
RUN apt-get update && apt-get install -y \
openssl \
bash \
locales \
man \
vim \
curl \
wget \