Skip to content

Instantly share code, notes, and snippets.

@zbyna
zbyna / jaknato.txt
Last active July 26, 2017 19:21
Episodes list json response
eventuální scrapování info o epizodách:
thetvdb:
- po sezónách - vrátí všechny epizody pro sezonu
get /series/{id}/episodes/query
https://api.thetvdb.com/series/81189/episodes/query?airedSeason=1
response: thetvdb.json
themoviedb:
@zbyna
zbyna / example.pas
Created October 4, 2017 22:26
How to remove diacritics
// using utf8tools and LazUTF8
procedure nahradDiakritiku(var retezec:String);
var
ukChar: PChar;
unicode: Cardinal;
CharLen: integer;
unicodeCategory: SmallInt;
pomString:String;
begin
pomString:='';
@zbyna
zbyna / frequent.vba
Last active January 4, 2019 00:16
Basic vba statements - frequent uses
Sub TotoTlacitka_Click()
' callback for button with name TotoTlacitka, _ is part of vba syntax
' early binding
Dim Aktualni_vyber As Range
Dim bunka As Range
Dim cislo As Integer
' object initialisation
Set Aktualni_vyber = Selection
For Each bunka In Aktualni_vyber
Sub Sheet2_Button1_Click()
'
' Sheet2_Button1_Click Macro
'
Dim Tabulka As ListObject
Dim List As Worksheet
Set List = ActiveSheet ' to get code completion, it does not work on ActiveSheet property
Set Tabulka = List.ListObjects.Add(SourceType:=xlSrcRange, _
@zbyna
zbyna / Soda Dark 3.sublime-theme
Created March 18, 2017 18:51
Bigger status bar font in Sublime Text 3 - Soda Dark 3.sublime-theme
[
// Status bar label
{
"class": "label_control",
"parents": [{"class": "status_bar"}],
"color": [150, 150, 150],
"shadow_color": [25, 25, 25],
"shadow_offset": [0, -1],
"font.size" : 14
}
@zbyna
zbyna / vimium-custom-dark-mode.css
Created March 4, 2020 01:27
vimium-custom-dark-mode.css compatible with Vimium 1.66
div > .vimiumHintMarker {
/* linkhint boxes */
background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#FFF785),
color-stop(100%,#FFC542));
border: 1px solid #E3BE23;
}
div > .vimiumHintMarker span {
/* linkhint text */
color: black;
@zbyna
zbyna / script.vim
Last active August 27, 2020 23:47
substitute command :s with script
" pokus - 1 search for items with at least 1 char between asterisks eg: not **
" 2 substitute them with the same string with stripped spaces
" list - mujList - is here for testing purposes
let flags = ''
let mujList = []
call cursor(1,1)
while search('\*\(.\{-}\)\*', flags,line("$")) > 0
" last search register "/
let @/='\*\(.\{-}\)\*'
" trigger next search using gn object and copy it
@zbyna
zbyna / script.vim
Last active October 27, 2020 04:03
VIM - checking reStructuredText (Sphinx) markups used in godot docs - without confirmation
" ONLY in VIM 8.0.1630 and later
" (trim function added see: https://github.com/vim/vim/commit/295ac5ab5e840af6051bed5ec9d9acc3c73445de)
" You can execute more than one command in command line by placing a | between two commands.
" You can execute the file by running this :source <filename>
" :ref:`label-name`
" weblate.org machine translation adds space after : like: : ref:
" %s/: ref: /:ref:/gc - zřejmě bylo špatně :-) stane se :-)
%s/: ref: / :ref:/g
%s/: kbd: / :kbd:/g
@zbyna
zbyna / gist:6fdd6af66fd890ff51796ef5826985cc
Last active October 27, 2020 04:07
VIM - checking reStructuredText (Sphinx) markups used in godot docs
" ONLY in VIM 8.0.1630 and later
" (trim function added see: https://github.com/vim/vim/commit/295ac5ab5e840af6051bed5ec9d9acc3c73445de)
" You can execute more than one command in command line by placing a | between two commands.
" You can execute the file by running this :source <filename>
" :ref:`label-name`
" weblate.org machine translation adds space after : like: : ref:
%s/: ref: /:ref:/gc
%s/: ref: / :ref:/gc
@zbyna
zbyna / internettools_thetvdb_xpath.pas
Last active September 1, 2021 17:50
Internet tools - scrarping thetvdb.com pomocí xpath query
procedure TForm1.Button2Click(Sender: TObject);
var pomQuery: String;
v: IXQValue;
i: Integer;
pomString: String;
pomString3: String;
p: IXQValue;
p3: IXQValue;
begin
str:= ' <?xml version="1.0" encoding="UTF-8" ?>'+ slineBreak +