Skip to content

Instantly share code, notes, and snippets.

View alexanderk23's full-sized avatar

Alexander Kovalenko alexanderk23

View GitHub Profile
@alexanderk23
alexanderk23 / tap2wav.py
Created November 6, 2021 09:16
Convert TAP to WAV
#!/usr/bin/env python
import argparse
import struct
import wave
SECONDS_PAUSE = 1.5
SECONDS_PILOT_HEADER = 3
SECONDS_PILOT_DATA = 1.5
@alexanderk23
alexanderk23 / heapq.asm
Last active June 3, 2021 14:34
heapq.asm
; Binheap priority queue
; Based on 6502 code by MagerValp
; https://github.com/MagerValp/AsmHeap
; 255 items max, 3 bytes wasted
struct HEAPQ
align 256
tree ds 255, 0
size db 0
macro emptytrd_with_boot _trdname
DISP 0
.boot db $00, $01, $66, $00, $f9, $c0, $30, $0e, $00, $00, $57
db $5d, $00, $3a, $ea, $3a, $f7, $22, $62, $6f, $6f, $74
db $20, $20, $20, $20, $22, $0d, $f3, $cd, $6b, $0d, $09
db $e5, $01, $05, $09, $cd, $13, $3d, $e1, $54, $5d, $01
db $08, $00, $35, $28, $27, $34, $28, $29, $e5, $09, $7e
db $e1, $fe, $42, $20, $1c, $e5, $c5, $d5, $11, $4d, $5d
db $1a, $ed, $a1, $20, $04, $13, $ea, $7d, $5d, $d1, $c1
db $e1, $28, $08, $11, $4d, $5d, $ed, $b0, $c3, $03, $3d
--- ext/openssl/ossl.c
+++ ext/openssl/ossl.c
@@ -1062,6 +1062,7 @@
*/
/* CRYPTO_malloc_init(); */
/* ENGINE_load_builtin_engines(); */
+ OPENSSL_config(NULL); /* Makes Ruby respect system OpenSSL config */
OpenSSL_add_ssl_algorithms();
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
--- ext/openssl/ossl.c
+++ ext/openssl/ossl.c
@@ -1022,6 +1022,7 @@
*/
/* CRYPTO_malloc_init(); */
/* ENGINE_load_builtin_engines(); */
+ OPENSSL_config(NULL); /* Makes Ruby respect system OpenSSL config */
OpenSSL_add_ssl_algorithms();
OpenSSL_add_all_algorithms();
ERR_load_crypto_strings();
@alexanderk23
alexanderk23 / example.php
Created December 8, 2016 14:15
FindFace API example (PHP)
<?php
define('DATEFMT', 'Y-m-d\TH:i:s.u');
/* Bounded box from "Common objects" */
class BBox {
var $x1, $y1, $x2, $y2;
function __construct($x1, $y1, $x2, $y2) {
$this->x1 = $x1;
$this->y1 = $y1;
$this->x2 = $x2;
@alexanderk23
alexanderk23 / scrview.py
Last active January 12, 2023 15:18
scrview.py: ZX Spectrum SCREEN$ viewer & trdtool.py: TRD disk image tool
#!/usr/bin/env python
"""scrview.py: ZX Spectrum SCREEN$ viewer"""
import sys
import Image
from array import array
class ZXScreen:
WIDTH = 256
[Desktop Entry]
Version=9
Name=Teamviewer 9
Comment=
Exec=/home/user/.teamviewer9/teamviewer
Icon=/home/user/.teamviewer9/tv_bin/desktop/teamviewer.png
Terminal=false
Type=Application
Categories=Utility;Application;
###
# Read in XML as a stream, write out JSON as a stream. As little information
# is kept in memory as possible.
require 'nokogiri'
require 'psych'
class JSONTranslator < Nokogiri::XML::SAX::Document
attr_reader :emitter
def initialize emitter
@alexanderk23
alexanderk23 / fucking-great-indicator.py
Last active January 3, 2016 02:39
Fucking Great Indicator
#!/usr/bin/env python
# coding: utf-8
APPNAME = u"Охуенный блять совет"
URI = 'http://fucking-great-advice.ru/'
API_URI = URI + 'api/random'
SOUND_URI = URI + 'files/sounds'
INTERVAL = 350
from gi.repository import AppIndicator3 as AI