Skip to content

Instantly share code, notes, and snippets.

@wyfinger
wyfinger / die_fuckers.js
Created October 2, 2020 04:59
User script for disable some fucking events
// ==UserScript==
// @name die fuckers
// @namespace http://tampermonkey.net/
// @version 0.1
// @description disable some fucking events
// @author wyfinger
// @match *://*/*
// @run-at document-end
// @grant none
// ==/UserScript==
@wyfinger
wyfinger / Boolean expressions with 3 inputs
Created February 18, 2020 03:54
Анализ всез возможных булевых выражений с 3 входами
Нередко в ветвлениях требуется проверять три условия сразу.
@wyfinger
wyfinger / Readed Books
Created January 8, 2020 09:35
My Readed Books
many many many
...
2020-01-08 Masters of Doom, David Kushner
@wyfinger
wyfinger / ExtractComments.bas
Created July 24, 2019 23:11
Extract comments from Word document into a new document as table
Public Sub ExtractCommentsToNewDoc()
'=========================
'Macro created 2007 by Lene Fredborg, DocTools - www.thedoctools.com
'Revised October 2013 by Lene Fredborg: Date column added to extract
'THIS MACRO IS COPYRIGHT. YOU ARE WELCOME TO USE THE MACRO BUT YOU MUST KEEP THE LINE ABOVE.
'YOU ARE NOT ALLOWED TO PUBLISH THE MACRO AS YOUR OWN, IN WHOLE OR IN PART.
'=========================
'The macro creates a new document
'and extracts all comments from the active document
@wyfinger
wyfinger / CommentsAuthor.bas
Created July 24, 2019 23:07
Edit comments author at selection in Word
Sub EditComment()
If ActiveDocument.Comments.Count = 0 Then Exit Sub
For i = 1 To ActiveDocument.Comments.Count
If (Selection.Start >= ActiveDocument.Comments(i).Scope.Start) And _
(Selection.Start <= ActiveDocument.Comments(i).Scope.End) Then
ActiveDocument.Comments(i).Author = InputBox(ActiveDocument.Comments(i).Author _
& vbCrLf & vbCrLf & ActiveDocument.Comments(i).Range.Text, "Author", ActiveDocument.Comments(i).Author)
End If
Next
End Sub
@wyfinger
wyfinger / EDHelper.js
Last active July 13, 2018 04:34
ED Help to Examine
// ==UserScript==
// @name ED Helper
// @version 0.1
// @description ED Help to Examine
// @author Igor Matveev miv@prim.so-ups.ru
// @match ***ED TEST SITE***
// @include ***ED TEST SITE***
// @grant none
// run-at document-end
// ==/UserScript==
@wyfinger
wyfinger / Convert BGR to RGB.md
Last active May 21, 2018 13:43
Convert BGR to RGB without additional variables

So, if you need to convert BGR (as $00BBGGRR) color to RGB (as $00RRGGBB) you can extract individual bytes of color and combine it. But let's do it without additional variables, as brain training.

Var 1: assembler

BSWAP - that's almost what we need. This command swap $AABBCCDD to $DDCCBBAA, later we can shift bytes right.

mov eax,AABBCC

bswap eax ; EAX = CCBBAA00

@wyfinger
wyfinger / HyperlinkCheckForm.frm
Last active February 11, 2018 22:45
Excel sheet hyperlink check and edit
VERSION 5.00
Begin {C62A69F0-16DC-11CE-9E98-00AA00574A4F} HyperlinkCheckForm
Caption = "Hyperlink"
ClientHeight = 1260
ClientLeft = 120
ClientTop = 450
ClientWidth = 17070
OleObjectBlob = "HyperlinkCheckForm.frx":0000
StartUpPosition = 2 'CenterScreen
End
@wyfinger
wyfinger / SunRiseSet.cpd
Last active November 3, 2017 23:49
Calculate time of Sunrise and Sunset by geo-coordinates and current day of year
day=308; # day of year
longitude=131.9551; # lonDegree + lonMinutes/60 + lonSeconds/3600
latitude=43.1096; # latDegree + latMinutes/60 + latSeconds/3600
zenith=90.8; # angle of sunrise or sunset, with correction by the interference of light in the atmosphere
# sunrise calculation
lngHour = longitude / 15;
trise = day + ((6-lngHour)/24);
Mrise = (0.9856*trise)-3.289;
Lrise = Mrise+(1.916*sin(pi*Mrise/180))+(0.020*sin(2*pi*Mrise/180))+282.634;
@wyfinger
wyfinger / check_pdf_text.bat
Created October 20, 2017 02:52
Mass check pdf files for Text layer by pdftotext.exe from Poppler
@ECHO OFF
SET filelist=pdflist.txt
SET textfile=c:\PDF\text.txt
SET outfile=pdfcheck.txt
rem delete results log
del /Q %outfile%
rem check files to text layer in loop