Skip to content

Instantly share code, notes, and snippets.

View rincew1nd's full-sized avatar

Vyacheslav Titov rincew1nd

  • Cattleya
  • Russia, Moscow
View GitHub Profile
/// <summary>
/// Класс для конвертации HTML форм в XSLT шаблоны.
/// https://products.aspose.app/cells/conversion/excel-to-html - Конвертер XLS/XLSX в HTML
/// </summary>
public class CleanHtmlTemplate
{
private static string[] _trashCssTags = { "mso-" };
public void Clean(string inputFilePath, string outputFilePath)
{
public class BenchmarkN1
{
public List<Test> testData;
public BenchmarkN1()
{
testData = new List<Test>() {new Test(), new Test(), new Test()};
}
[Benchmark]
@rincew1nd
rincew1nd / PlatmormioError.log
Created June 23, 2020 20:01
Anycubic Mega Zero Firmware update log
> Executing task: platformio run --target upload <
Processing sanguino1284p (platform: atmelavr; board: sanguino_atmega1284p; framework: arduino)
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/atmelavr/sanguino_atmega1284p.html
PLATFORM: Atmel AVR 2.2.0 > Sanguino ATmega1284p (16MHz)
HARDWARE: ATMEGA1284P 16MHz, 16KB RAM, 127KB Flash
DEBUG: Current (simavr) On-board (simavr)
PACKAGES:
@rincew1nd
rincew1nd / DirectLinkFinder
Created June 10, 2019 11:03
Парсеры контента
private static (string, string)[] StromoParser(string url)
{
var doc = HtmlUtils.GetHtmlPage(url);
var javascriptBlock = Regex.Match(doc, "new Playerjs\\(({.+?})\\);", RegexOptions.Singleline)?.Groups[1].Value;
dynamic jsonObj = JsonConvert.DeserializeObject(javascriptBlock);
var files = ((string)jsonObj.file).Replace("/,", string.Empty).Split(new[] { ']', '[' }, StringSplitOptions.RemoveEmptyEntries);
var result = new List<(string, string)>();
@rincew1nd
rincew1nd / Clean tables
Last active March 1, 2019 11:39
Function for cleaning data in MSSQL DB
USE NEOCASE_DB;
GO
IF OBJECT_ID('tempdb..##DisableTableConstraint') IS NOT NULL DROP PROCEDURE ##DisableTableConstraint
GO
CREATE PROCEDURE ##DisableTableConstraint (@Table NVARCHAR(100), @Type INT) AS
BEGIN
DECLARE @SlaveTab NVARCHAR(150);
DECLARE @MasterTab NVARCHAR(150);
DECLARE @AlterTableQuery NVARCHAR(1000);
DECLARE ForeignKeys CURSOR LOCAL FOR
@rincew1nd
rincew1nd / Global variables
Created February 7, 2019 19:40
Global variables
.rodata:00023638 unk_23638 DCB 0x38 ; 8 ; DATA XREF: deskey+16↑o
.rodata:00023638 ; deskey+4E↑o ...
.rodata:00023639 DCB 0x30 ; 0
.rodata:0002363A DCB 0x28 ; (
.rodata:0002363B DCB 0x20
.rodata:0002363C DCB 0x18
.rodata:0002363D DCB 0x10
.rodata:0002363E DCB 8
.rodata:0002363F DCB 0
.rodata:00023640 DCB 0x39 ; 9
@rincew1nd
rincew1nd / DES-Decompiled
Created February 7, 2019 19:28
Partial decompilation of DES algorithm
do
{
v23[v2] = (*(unsigned __int8 *)(a1 + ((signed int)*((unsigned __int8 *)&unk_23638 + v2) >> 3)) & *((unsigned __int16 *)&unk_23638 + (*((_BYTE *)&unk_23638 + v2) & 7) + 28)) != 0;
++v2;
}
while ( v2 != 56 );
v3 = 0;
do
{
v4 = 0;
using System;
using System.Data.SqlClient;
namespace TestCGI
{
class Program
{
[STAThread]
static void Main(string[] args)
{
@rincew1nd
rincew1nd / EqualDistribution.cs
Created March 28, 2018 12:16
Equal Distribution by 2 parameters (critical differens with sorting)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RestSharp;
using System.Security.Cryptography;
using System.IdentityModel.Tokens;
using Oracle.ManagedDataAccess.Client;
namespace ConsoleApplication1
@rincew1nd
rincew1nd / GlobalHotkeyWindow.cs
Created March 16, 2018 16:05
Global hotkeys for c# WPF application
using System;
using System.Runtime.InteropServices;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Interop;
using System.Windows.Media;
namespace WpfApplication1
{
/// <summary>