Skip to content

Instantly share code, notes, and snippets.

View vyamkovyi's full-sized avatar
🇺🇦

Vlad Yamkovyi vyamkovyi

🇺🇦
View GitHub Profile
@vyamkovyi
vyamkovyi / WTHPL
Created October 13, 2019 15:50
A fork of WTFPL
DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE
Version 4, October 2019
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Copyright (C) 2013 Ben McGinnes <ben@adversary.org>
Copyright (C) 2019 Hexawolf <hexawolfie@gmail.com>
Everyone is permitted to copy and distribute verbatim or
modified copies of this license document, and changing it is
allowed as long as the name is changed.
@vyamkovyi
vyamkovyi / utils.go
Last active April 2, 2024 20:57
Geogarbage
// WGS84 EPSG identifier
const WGS84 = 4326
const DEG_TO_RAD = math.Pi / 180.0
const RAD_TO_DEG = 180.0 / math.Pi
// DecodeUTF16 converts a UTF-16 string to a UTF-8 string.
func DecodeUTF16(b []byte) (string, error) {
if len(b)%2 != 0 {
return "", errors.New("must have even length byte slice")
@vyamkovyi
vyamkovyi / mqttc.go
Last active April 2, 2024 20:57
Simple MQTT client application.
// mqttc.go - Simple MQTT client application for testing purposes.
// Copyright (c) 2019 Hexawolf
//
// 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:
@vyamkovyi
vyamkovyi / byteslice.go
Created September 25, 2019 19:36
A simple byte slice wrapper.
package main
import "sort"
// ByteSlice attaches the methods of sort.Interface to []byte, sorting in
// increasing order.
type ByteSlice []byte
func (s ByteSlice) Len() int { return len(s) }
func (s ByteSlice) Less(i, j int) bool { return s[i] < s[j] }
@vyamkovyi
vyamkovyi / pool.py
Last active October 13, 2019 15:51
e621 pool downloader, python 2
# DO WHAT THE HECK YOU WANT TO PUBLIC LICENSE
# Version 4, October 2019
#
# Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
# Copyright (C) 2013 Ben McGinnes <ben@adversary.org>
# Copyright (C) 2019 Hexawolf <hexawolfie@gmail.com>
#
# Everyone is permitted to copy and distribute verbatim or
# modified copies of this license document, and changing it is
# allowed as long as the name is changed.