Skip to content

Instantly share code, notes, and snippets.

@RobbWatershed
RobbWatershed / toXls.ps1
Last active May 4, 2023 18:40
toXls.ps1
$files_en = @{}
Get-ChildItem '.' -Directory | ForEach-Object {
$folder = $_
if (!$folder.Name.StartsWith('values') -or $folder.Name.EndsWith('dp')) { return }
$isEN = ($folder.Name -eq "values")
Write-Output $folder.Name
Get-ChildItem $folder -File | ForEach-Object {
$file = $_
@RobbWatershed
RobbWatershed / fromXls.ps1
Last active May 14, 2023 07:37
fromXls.ps1
Get-ChildItem '.' -Directory | ForEach-Object {
$folder = $_
if (!$folder.Name.StartsWith('values') -or $folder.Name.EndsWith('dp')) { return }
$isEN = ($folder.Name -eq "values")
Write-Output $folder.Name
Get-ChildItem $folder -File | ForEach-Object {
$file = $_
$fileName = $file.BaseName
@RobbWatershed
RobbWatershed / Mass-archiving Powershell command
Created March 30, 2023 17:01
Mass-archiving Powershell command
Get-ChildItem -Directory -Path '[Path to Hentoid Library root]\[source folder]\' | ForEach-Object { $name = "[Output path]\$(Split-Path -Leaf $_).zip"; if(-not(Test-Path -Path $([Management.Automation.WildcardPattern]::Escape($name)))) {& 'C:\Program Files\7-Zip\7z.exe' a "$name" "$_\*" -mmt=on} }
@RobbWatershed
RobbWatershed / ObjectBoxPredeterminedDataSource
Created September 22, 2020 07:31
ObjectBoxPredeterminedDataSource
class ObjectBoxPredeterminedDataSource<T> extends PositionalDataSource<T> {
private final Function<List<Long>, List<T>> fetcher;
private final long[] ids;
private final DataObserver<List<T>> observer;
private ObjectBoxPredeterminedDataSource(Function<List<Long>, List<T>> fetcher, long[] ids) {
this.fetcher = fetcher;
this.ids = ids;
this.observer = data -> ObjectBoxPredeterminedDataSource.this.invalidate();
}
@RobbWatershed
RobbWatershed / ThenGodSaidThatHentaiBeSorted.ps1
Last active October 24, 2020 17:31
Hentoid books organizer script (by logicdefyer)
#Enter The Master Porn Folder Here , Must Have Proper Json Information , the whole shit is about having the right jsons
$SortMasterFolder = $PSScriptRoot + "\Dataset"
$OutputMasterFolder = $PSScriptRoot + "\OutDataset"
$PSDefaultParameterValues['*:Encoding'] = 'utf8'
function CopyFilesToFolder ($fromFolder, $toFolder) {
$childItems = Get-ChildItem -LiteralPath $fromFolder
$childItems | ForEach-Object {
ONLY NON-REGRESSION FIXES AND IMPROVEMENTS
New: Downloads pausing and resuming
New: Revamped download queue screen with priority management (up / down buttons)
New: Personal data privacy statement in about screen
New: Slide page number to skip pages in paged view
New Setting: Configure number of concurrent download threads
Changed: search bar no longer resets after hiding; pager not hidden when changing pages with next/previous buttons
Experimental: default app dir is now ".Hentoid" to hide from gallery apps (new installs only; nothing will change for existing users)
Fixed: Endless reloading on ASMHentai and Pururin webviews
a