Skip to content

Instantly share code, notes, and snippets.

@eyaler
eyaler / unlocalize.py
Created January 6, 2024 15:24
Find Windows folders with a fake display name and optionally delete offending desktop*.ini files to reset folder name and behavior
"""Find Windows folders with a fake display name and optionally delete offending desktop*.ini files to reset folder name and behavior
Usage: python unlocalize.py [delete]
Renaming a folder via Windows 7-11 Explorer search results, might not change the actual folder name, but just the displayed name in Explorer.
The fake display name is set as a LocalizedResourceName in desktop.ini, and the effect survives even if renaming desktop.ini itself.
Moreover, from this point on any further renaming via Explorer, even not in search results, will only affect the displayed name.
This can lead to data loss e.g. copying a folder with the old name to the same location, unintentionally overwriting the "renamed" folder.
See also: https://superuser.com/questions/1777997/prevent-windows-explorer-to-use-localizedresourcename-when-renaming-file-or-fo
"""
@eyaler
eyaler / roboshaul_inference.ipynb
Last active May 15, 2023 14:55
roboshaul_inference
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / ldm-txt2im.ipynb
Last active June 23, 2022 23:58
LDM-TXT2IM.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / plotting-pi.ipynb
Last active September 13, 2022 14:38
Plotting Pi
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / moodle_block_next_until_answered.html
Last active January 15, 2022 00:07
moodle_block_next_until_answered.html
<script type="text/javascript">
function onLoadHide() { // Hide the [Next page] button:
var d1 = document.getElementsByClassName("que description informationitem notyetanswered")[0];
var d2 = document.getElementsByClassName("que description informationitem answersaved")[0];
if (!d1 && !d2) document.getElementsByClassName("mod_quiz-next-nav btn btn-primary")[0].disabled = true;
}
function onAnswerShow() { // Show the [Next page] button:
document.getElementsByClassName("mod_quiz-next-nav btn btn-primary")[0].disabled = false;
@eyaler
eyaler / deep-painterly-harmonization.ipynb
Last active September 23, 2024 17:14
deep-painterly-harmonization.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / rudalle-outpainting.ipynb
Last active December 23, 2022 19:49
ruDALLE-Outpainting.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / delchunk.py
Last active November 23, 2022 01:10
Delete chunks from a large file
"""Usage: python3 delchunk.py BIG_FILE CHUNK_FILE_OR_FOLDER [OUT_FILE]
Given a large file BIG_FILE, delete all complete non-overlapping (and possibly large) chunks given by CHUNK_FILE_OR_FOLDER
While each chunk file is treated statelessly (AABABB-AB=AB), multiple chunk files are treated statefully (ACABDB-AB-CD=AB)
Multiple chunk files will be deleted from the largest to the smallest (and secondarily by chunk filename)
If OUT_FILE is omitted, will do a dryrun
"""
import mmap
@eyaler
eyaler / openpose-video2bvh.ipynb
Created October 27, 2021 16:06
openpose+video2bvh.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / gsheet_fetcher.py
Last active August 7, 2021 19:36
gsheet_fetcher.py
# to run:
# python gsheet_fetcher.py
try:
import requests # faster - need to pip install requests
get = requests.get
req = True
except:
import urllib.request
get = urllib.request.urlopen