Skip to content

Instantly share code, notes, and snippets.

View devbym's full-sized avatar
🎑
Long-Range Binoculars

Michiel (devbym) devbym

🎑
Long-Range Binoculars
  • CZ
View GitHub Profile
@devbym
devbym / index.html
Created January 8, 2024 01:06
Text over image
<main>
<div class="toi1">
<h2 class="red">Enjoy the holidays!</h2>
<h3 class="green">
<span>Let it snow</span>
<span>Let it snow</span>
<span>Let it snow</span>
</h3>
</div>
</main>
@devbym
devbym / search.js
Created October 16, 2022 14:22
JS Table Search & Sort
function searchTable(searchtextId,tableId,columnIndex) {
var input, filter, table, tr, td, i,idx, txtValue;
input = document.getElementById(searchInputId);
filter = input.value.toUpperCase();
table = document.getElementById(tableId);
tr = table.getElementsByTagName("tr");
idx = document.getElementById("select"); // In this case, a <select> element is used to get the value for the columnindex
val = idx.value;
for (i = 0; i < tr.length; i++) {
td = tr[i].getElementsByTagName("td")[val];
@devbym
devbym / search_and_export.py
Last active July 17, 2022 02:18
Search directories for a specific extension and parse to either HTML or JSON
from pathlib import Path
import pandas as pd
import json
def filelist_to_dataframe(path_to_dir:str,extension:str,mode:int) -> None:
"""Searches the given directory for any file of the specified extension"""
url = [ "<a href='file://" ,
"' rel='external noopener nofollow' type='",
"' target='_blank'>",
@devbym
devbym / index.html
Created June 25, 2022 16:03
Redraw <img> inline with <canvas>
<section class="preview">
<h2>Original image</h2>
<img src="https://mdn.mozillademos.org/files/5397/rhino.jpg" alt="">
</section>
<section>
<h2>Redrawn with canvas</h2>
<canvas id="cnv"></canvas>
</section>
@devbym
devbym / subclassing_dict.py
Created March 18, 2022 23:47
Subclassing built-in dict with __setitem__
class DictMaker(dict):
def __init__(self, *args, **kwargs):
self.update(*args, **kwargs)
def __getitem__(self, key):
val = dict.__getitem__(self, key)
print 'GET', key
return val
def __setitem__(self, key, val):
@devbym
devbym / remove_password.vb
Last active June 17, 2020 15:24
Excel - Remove Workbook and Worksheet protection
Sub RemoveProtection()
Dim dialogBox As FileDialog
Dim sourceFullName As String
Dim sourceFilePath As String
Dim sourceFileName As String
Dim sourceFileType As String
Dim newFileName As Variant
Dim tempFileName As String
Dim zipFilePath As Variant