Skip to content

Instantly share code, notes, and snippets.

@PTwr
PTwr / LazySingletonForServiceWithDefaultmplementation.cs
Last active June 27, 2018 07:35
Lazy singleton for service with default implementation
using System;
using System.Collections.Generic;
using System.Linq;
namespace ConsoleApp7
{
public interface IService
{
string Foo();
string Bar(string a);
@PTwr
PTwr / A38_T92.xml
Last active June 16, 2019 22:48
decoded T92 tank definition
<A38_T92.xml>
<xmlref>http://bwt/xmlref</xmlref>
<crew>
<commander></commander>
<gunner></gunner>
<driver></driver>
<radioman></radioman>
<loader></loader>
<loader></loader>
</crew>
@PTwr
PTwr / scripts_config.xml
Created December 16, 2019 16:16
decoded scripts_config.xml v.1.7.0.1
<scripts_config.xml>
<login>
<host>
<name>US Central</name>
<short_name>USC</short_name>
<url>wotna3.login.wargaming.net:20016</url>
<url_token>wotna3-2.login.wargaming.net:20016</url_token>
<public_key_path>loginapp_wot.pubkey</public_key_path>
<periphery_id>303</periphery_id>
</host>
@PTwr
PTwr / scripts_config.xml
Created December 16, 2019 19:16
Color blidn modification for scripts_config.xml
<scripts_config.xml>
<login>
<host>
<name>US Central</name>
<short_name>USC</short_name>
<url>wotna3.login.wargaming.net:20016</url>
<url_token>wotna3-2.login.wargaming.net:20016</url_token>
<public_key_path>loginapp_wot.pubkey</public_key_path>
<periphery_id>303</periphery_id>
</host>
@PTwr
PTwr / blah.css
Last active January 3, 2020 22:04
force image into drilldown chart description
span.highcharts-drilldown-axis-label:nth-child(1)::before {
content: '';
height: 24px;
width: 24px;
background: url(assets/images/nations/ussr.png);
display: block;
background-size: contain;
}
span.highcharts-drilldown-axis-label:nth-child(2)::before {
content: '';
[Adblock Plus 2.0]
! Version:
! Title: WorlOfTanks forum filters
! Last modified: 06.12.2020
! Expires: 7 days (update frequency)
! Homepage:
!
forum.worldoftanks.com##div.post_body div.signature img
forum.worldoftanks.com#?#div[id^="index_stats"] li.clearfix:-abp-has(a.url.name span[itemprop^="name"]:-abp-contains(Whistling_Death_))
forum.worldoftanks.com#?#table.topic_list tr[itemscope]:-abp-has(a[hovercard-ref^="member"] span[itemprop^="name"]:-abp-contains(Whistling_Death_))
@PTwr
PTwr / rename replays.ps1
Last active December 6, 2020 21:15
Powershell script to batch-rename World Of Tanks replays
#change path if you store replays in different place, or just navigate manually
cd C:\games\World_of_Tanks\replays
#regex to snatch stuff from filename
$splitfilename = '(?<date>[0-9]+)_(?<time>[0-9]+)_(?<=_)(?<nation>.*?)(?=-)-(?<=-)(?<tankcode>.*?)(?=_)_(?<=_)(?<tankname>.*?)(?=_(?<mapid>[0-9]+)(?!.*[0-9]))_[0-9]+_(?<mapname>.*)\.wotreplay$'
foreach ($replay in Dir *.wotreplay)
{
$parts = $replay.Name -match $splitfilename
[Reflection.Assembly]::LoadWithPartialName('System.IO.Compression.FileSystem')
foreach($sourceFile in (Get-ChildItem -filter 'vehicles_level_*.pkg'))
{
foreach($entry in [IO.Compression.ZipFile]::OpenRead($sourceFile.FullName).Entries | select-string "vehicles\/(american|british|chinese|czech|french|german|japan|poland|russian|sweden)\/([a-zA-Z]*[0-9]*_[^\/]*)\/$")
{
"$entry $sourceFile"
}
}
@PTwr
PTwr / progression.xml
Created July 20, 2021 10:49
sCrew 2.1 Sandbox scripts\item_defs\crew2\detachments\progression.xml decrypted
<progression.xml>
<xsi>http://www.w3.org/2001/XMLSchema-instance</xsi>
<noNamespaceSchemaLocation>../../../development/xml_schema/crew2/detachment/progression.xsd</noNamespaceSchemaLocation>
<progression>
<layout>
<id>1</id>
<priceGroupID>1</priceGroupID>
<badgeID>200</badgeID>
<levels>
<level>
@PTwr
PTwr / Vanillifer.ini
Created July 21, 2021 18:52
Vanillifer - remove only dogtags
[dogtags]
disable = true