Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimir Vissoultchev wqweto

  • Unicontsoft
  • Sofia, Bulgaria
View GitHub Profile
@wqweto
wqweto / Program.cs
Created Oct 13, 2021
ECDSA server certificate signed by a ECDSA self-signed CA
View Program.cs
using System;
using System.IO;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace ConsoleApp1
{
class Program
{
static void Main(string[] args)
@wqweto
wqweto / program.cs
Last active Oct 2, 2021
Minimal .Net Web Server with Regex Routing in 177 LOC of C#
View program.cs
//
// Poor Man's Web Server with Regex Routing in 177 LOC of C#
//
// This is a simple standalone http server that handles routing with regular expressions
// matching. For each request the router passes capture groups to handlers as a data dictionary.
//
// Router implementation constructs a single composite regex to match request path, based on
// https://nikic.github.io/2014/02/18/Fast-request-routing-using-regular-expressions.html
//
// One can use `WebServer` and `Router` classes alone, just has to register all custom
@wqweto
wqweto / BbCode2Rtf.bas
Last active Aug 12, 2021
Convert BBCode to RTF
View BbCode2Rtf.bas
Option Explicit
'
' BbCodes supported:
' b, i, u
' size={FontSize}
' color={ColorNameOrValue}
' font={FontName}
' table={Col1_Width},{Col2_Width}, ...[;[TableLeftOffset],[ColumnLeftOffset]]
' row={Col1_BackColor},{Col2_BackColor}, ...;<<col1_border>>;<<col2_border>>;...]
' <<colN_border>>:=[BorderLeftColor] [BorderLeftWidth],[BorderTopColor] [BorderTopWidth],[BorderRightColor] [BorderRightWidth],[BorderBottomColor] [BorderBottomWidth]
@wqweto
wqweto / mdAesCtr.bas
Last active Jun 24, 2021
Simple AES 256-bit password protected encryption
View mdAesCtr.bas
'--- mdAesCtr.bas
Option Explicit
DefObj A-Z
#Const ImplUseShared = False
'=========================================================================
' API
'=========================================================================
@wqweto
wqweto / msvbvm60_3.tlb
Created May 13, 2021
Typelib resource ID 3 from MSVBVM60.DLL
View msvbvm60_3.tlb
// Generated .IDL file (by the OLE/COM Object Viewer)
//
// typelib filename: 3
[
uuid(EA544A21-C82D-11D1-A3E4-00A0C90AEA82),
version(6.0),
helpstring("Visual Basic runtime objects and procedures"),
helpfile("VB98.CHM"),
helpcontext(0x000df908)
@wqweto
wqweto / check_vat.php
Last active Feb 8, 2021
Check company VAT number using SOAP service at http://ec.europa.eu and return JSON encoded result
View check_vat.php
<?php
header('Content-type: application/json; charset=utf8');
$vatno = str_replace(array(' ', '.', '-', ',', '"'), '', $_GET['vatno']);
echo serviceCheckVat($vatno, &$name, &$address, &$error);
/*
include "connect.php";
mysql_query("SET NAMES utf8");
$vatno = mysql_real_escape_string($_GET['vatno']);
@wqweto
wqweto / Form1.frm
Created Jan 27, 2021
Large string array
View Form1.frm
Option Explicit
Private Sub Form_Load()
Const STR_NAMES1 As String = "|Thousand|Million|Billion|Trillion|Quadrillion|Quintillion|Sextillion|Septillion|Octillion|Nonillion|Decillion|Undecillion|Duodecillion|Tredecillion|Quattuordecillion|Quindecillion|Sexdecillion|Septendecillion|Octodecillion|Novemdecillion|Vigintillion|Unvigintillion|Duovigintillion|Trevigintillion|Quattuorvigintillion|Quinvigintillion|Sexvigintillion|Septenvigintillion|Octovigintillion|Novemvigintillion|Trigintillion|Untrigintillion|Duotrigintillion|Tretrigintillion|Quattuortrigintillion|Quintrigintillion|Sextrigintillion|Septtrigintillion|Octotrigintillion|Novemtrigintillion|Quadragintillion|Unquadragintillion|Duoquadragintillion|Trequadragintillion|Quattuorquadragintillion|Quinquadragintillion|Sexquadragintillion|Septquadragintillion|Octoquadragintillion|Novemquadragintillion|Quinquagintillion|Unquinquagintillion|Duoquinquagintillion|Trequinquagintillion|Quattuorquinquagintillion" & _
"|Quinquinquagint
@wqweto
wqweto / mdJson.bas
Last active Dec 17, 2020
JSON parsing/dumping/accessing functions for VB6 and VBA
View mdJson.bas
'=========================================================================
'
' https://github.com/wqweto/UcsFiscalPrinters/blob/master/src/Shared/mdJson.bas
' JSON parsing and dumping functions
'
'=========================================================================
Option Explicit
DefObj A-Z
Private Const MODULE_NAME As String = "mdJson"
@wqweto
wqweto / mdCollection.bas
Last active Dec 16, 2020
[VB6/VBA] Collection keys
View mdCollection.bas
Option Explicit
#Const HasPtrSafe = (VBA7 <> 0)
#Const LargeAddressAware = (Win64 = 0 And VBA7 = 0 And VBA6 = 0 And VBA5 = 0)
'--- for CopyMemory
#If HasPtrSafe Then
Private Const NULL_PTR As LongPtr = 0
#Else
Private Const NULL_PTR As Long = 0
@wqweto
wqweto / mdExcel.bas
Last active Nov 5, 2020
Write to Excel using ADO
View mdExcel.bas
Option Explicit
Public Function ReadFromExcel( _
ByVal sFileName As String, _
Optional Workbook As String, _
Optional ByVal CsvHeader As Boolean) As Recordset
Dim cn As ADODB.Connection
Dim rsDest As Recordset
Dim sTable As String
Dim sCharset As String