Skip to content

Instantly share code, notes, and snippets.

@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 / plotting-pi.ipynb
Last active September 13, 2022 14:38
Plotting Pi
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / roboshaul_inference.ipynb
Last active May 15, 2023 14:55
roboshaul_inference
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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
"""