Skip to content

Instantly share code, notes, and snippets.

@eyaler
eyaler / deep-painterly-harmonization.ipynb
Last active April 7, 2022 14:37
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 / 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 / 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
@eyaler
eyaler / image.html
Created August 26, 2020 21:03
A complete solution to the window fitting image scaling display problem in 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>
@eyaler
eyaler / timestributed_dropout_error
Created October 25, 2016 16:12
timedistributed(dropout) error when batch_size is specified and using theano
import numpy
from keras.models import Model
from keras.layers import Input, Dropout, TimeDistributed
batch_size = 10
timesteps = 5
nb_features = 7
dropout = 0.5
input = Input(batch_shape=(batch_size, timesteps, nb_features))