Skip to content

Instantly share code, notes, and snippets.

View sosie-js's full-sized avatar

SoSie sosie-js

View GitHub Profile
@sosie-js
sosie-js / mimetype_resolver.py
Created August 29, 2023 14:26
Determines the mimetype from a pathname/filename
##!/usr/bin/env python
##-*- coding: utf-8 -*-
import requests
from bs4 import BeautifulSoup
from objbrowser import browse
import os
@sosie-js
sosie-js / main.c
Last active February 18, 2023 19:58
Patched eventlircd/src/main.c to free the OK button so it reacts in Kodi when button is pressed on the remote control
/*
* Copyright (C) 2009-2010 Paul Bender.
*
* This file is part of eventlircd.
*
* eventlircd is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
@sosie-js
sosie-js / ankiDBversion.py
Created September 13, 2021 17:33
Determine Anki Database version
#!/usr/bin/env python3
#################################################
# Determine Anki Database version, usefull to track DB version errors
#
#
# Installation steps for 2.1.44 (can be others versions too):
#
# 1) Remove previous versions
# sudo apt-get remove anki
# sudo pip3 uninstall anki
@sosie-js
sosie-js / gist:0be0aaabbed21d221aaa602e75432246
Created October 9, 2020 22:34
Insert a text at a given position
//see http://stackoverflow.com/a/25943182
function insertHTML(newElement) {
var sel, range;
if (window.getSelection && (sel = window.getSelection()).rangeCount) {
range = sel.getRangeAt(0);
range.collapse(true);
range.insertNode(newElement);
// Move the caret immediately after the inserted span
range.setStartAfter(newElement);