Skip to content

Instantly share code, notes, and snippets.

@eyaler
eyaler / ldm-txt2im.ipynb
Last active Jun 23, 2022
LDM-TXT2IM.ipynb
View ldm-txt2im.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View plotting-pi.ipynb
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 Jan 15, 2022
moodle_block_next_until_answered.html
View 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 Apr 7, 2022
deep-painterly-harmonization.ipynb
View deep-painterly-harmonization.ipynb
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 Sep 19, 2022
ruDALLE-Outpainting.ipynb
View rudalle-outpainting.ipynb
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 Nov 23, 2022
Delete chunks from a large file
View delchunk.py
"""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 Oct 27, 2021
openpose+video2bvh.ipynb
View openpose-video2bvh.ipynb
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 Aug 7, 2021
gsheet_fetcher.py
View 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
@eyaler
eyaler / notebook.ipynb
Last active Aug 19, 2022
siren_video.ipynb
View notebook.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@eyaler
eyaler / image.html
Created Aug 26, 2020
A complete solution to the window fitting image scaling display problem in HTML
View image.html
<!DOCTYPE html>
<html>
<body style="overflow:hidden; margin:0; text-align:center;">
<img src="https://file-examples-com.github.io/uploads/2017/10/file_example_JPG_2500kB.jpg" style="height:100vh; max-width:100%; object-fit: contain;">
</body>
</html>