Skip to content

Instantly share code, notes, and snippets.

View Ruzzz's full-sized avatar

Ruslan Zaporojets Ruzzz

View GitHub Profile
@Ruzzz
Ruzzz / jar_run.cmd
Created November 17, 2016 20:19
JAR Start Template
@echo off
setlocal
cd /d %~dp0
start javaw -Xms128m -Xmx1024m -jar NAME.jar %*
endlocal
type
MemAlign<T> = record
private
First: Byte;
Second: T;
public
class function Get(): Cardinal; static; inline;
end;
const
Свойство Class Object Record Interface
Является указателем
Наследование
Наследование от Interface
Visibility
Методы (Methods)
Свойства (Properties)
Поля (Fields)
Consts
Type Signed/Unsigned x86 (bit) x64 (bit)
BYTE, BOOLEAN U 8 8
SHORT S 16 16
USHORT, WORD U 16 16
INT, LONG S 32 32
UINT, ULONG, DWORD U 32 32
INT_PTR, LONG_PTR, LPARAM S 32 64
UINT_PTR, ULONG_PTR, WPARAM U 32 64
LONGLONG S 64 64
AIR Version SWF Version Flash Player Version
N/A 9 9.0.115.0
1.5, 2.0 10 10.0, 10.1
2.6 11 10.2
2.7 12 10.3
3 13 11.0
3.1 14 11.1
3.2 15 11.2
3.3 16 11.3
Категория Оператор Объявление Эквивалент
Conversion Implicit Implicit(a: Type): TResult; implicit Typecast
. Explicit Explicit(a: Type): TResult; explicit Typecast
Unary Negative Negative(a: Type): TResult; -
. Positive Positive(a: Type): TResult; +
. Inc Inc(a: Type): TResult; Inc
. Dec Dec(a: Type): TResult Dec
. LogicalNot LogicalNot(a: Type): TResult; not
. Trunc Trunc(a: Type): TResult; Trunc
@Ruzzz
Ruzzz / deploy.cmd
Created January 1, 2017 12:26
Create actual distr archive my_app.7z and source code archive from repository my_app_src.zip
set PROJECT=MY_APP
set ARCH_NAME=%PROJECT%_by_ruzzz.7z
set ROOT=%~dp0
del "%ROOT%\%ARCH_NAME%"
rd /s /q "%ROOT%\%PROJECT%"
md "%ROOT%\%PROJECT%"
copy "%ROOT%\bin\MY_APP.exe" "%ROOT%\%PROJECT%"
copy "%ROOT%\bin\MY_APP64.exe" "%ROOT%\%PROJECT%"
@Ruzzz
Ruzzz / diff_big.cpp
Last active January 2, 2017 14:39
Show differense of big files with same size (use WinAPI)
// The MIT License (MIT)
// Copyright (c) 2016 Ruslan Zaporojets
//
// 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:
//
@Ruzzz
Ruzzz / prepareForDom.php
Last active January 15, 2017 14:12
Функция подготовки html-кода для работы с DOM — решает проблемы с кириллицей
<?php
function prepareForDOM($html, $inCharset) {
if ($inCharset != 'utf8' && $inCharset != 'utf-8')
$html = iconv($inCharset, 'UTF-8//TRANSLIT', $html);
$html = preg_replace('/<(script|style|noscript)\b[^>]*>.*?<\/\1\b[^>]*>/is', '', $html);
$tidy = new tidy;
$config = array( // See http://tidy.sourceforge.net/docs/quickref.html
'drop-font-tags' => true,
'drop-proprietary-attributes' => true,
'hide-comments' => true,
# If needed install: JSON::Any, Data::Validate::IP, IO::Socket::SSL
sudo apt-get install libjson-any-perl libdata-validate-ip-perl libio-socket-ssl-perl
cd ~
wget https://raw.githubusercontent.com/wimpunk/ddclient/master/ddclient
sudo cp ddclient /usr/sbin/ddclient
sudo chmod +x /usr/sbin/ddclient
sudo mkdir /var/cache/ddclient
sudo mkdir /etc/ddclient
sudo nano /etc/ddclient/ddclient.conf