Skip to content

Instantly share code, notes, and snippets.


Marc Belmont marcbelmont

View GitHub Profile
marcbelmont /
Last active Nov 13, 2020
Browser based image viewer. Display all the images from a directory as thumbnails on a webpage.
#! /usr/bin/python3
import argparse
import imghdr
import webbrowser
from http.server import HTTPServer, SimpleHTTPRequestHandler
from os import chdir
from pathlib import Path
from urllib.parse import parse_qs, urlparse
marcbelmont /
Last active Oct 11, 2020
Use in-memory image in Plate Recognizer and other speed tricks.
import io
import json
import requests
from PIL import Image
def main():
im ='RGB', (300, 300))
# or
marcbelmont /
Created Jul 7, 2020
Use Rollbar with Tornado Web
import tornado.ioloop
import tornado.web
class MyRequestHandler(tornado.web.RequestHandler):
def log_exception(self, typ, value, tb):
rollbar.report_exc_info((typ, value, tb))
super().log_exception(typ, value, tb)
marcbelmont / portal_knights.cfg
Created Jun 14, 2020
Portal Knights Linux Fix. `Protal Knights/protal_knights.cfg` may not be created when on Linux. You may copy this one.
View portal_knights.cfg
"gamebuild": "",
"graphics": {
"api": "Direct3D11",
"adapterPlatformId": "32902,354,0,0",
"displayName": "\\\\.\\DISPLAY1",
"width": 2560,
"height": 1080,
"refreshRateNumerator": 60,
"refreshRateDenominator": 1,
marcbelmont /
Last active Feb 8, 2021
Plate Recognizer: How to Receive Webhook Data.
This script is now available from
marcbelmont / spotify-ad-muter.tampermonkey.js
Last active Mar 28, 2021
Spotify Ad Muter. Automatically mute (block) Spotify ads. Turn sound on again after the ad.
View spotify-ad-muter.tampermonkey.js
// ==UserScript==
// @name Spotify Ad Muter
// @version 1.1
// @namespace
// @description Detects and blocks ads on Spotify. Automatically mute Spotify ads. Turn sound on again after the ad.
// @match https://**
// @grant none
// @run-at document-start
// @downloadURL
// @updateURL
marcbelmont /
Last active Nov 24, 2020
Add Unicode Icons to Ranger File Manager. 🖼️ 📂 🎵 🥳
# Unicode Icons in Ranger File Manager
# How to install?
from __future__ import absolute_import, division, print_function
from itertools import repeat
import ranger.api

Keybase proof

I hereby claim:

  • I am marcbelmont on github.
  • I am marcemile ( on keybase.
  • I have a public key ASBAQ4uMeCYD353vGrasriJsy1LIKcSajl89Mfux2_8ClAo

To claim this, I am signing this object:

View ParallelCriterionSkip.lua
local ParallelCriterionSkip, parent = torch.class('nn.ParallelCriterionSkip', 'nn.Criterion')
function ParallelCriterionSkip:__init(repeatTarget)
self.criterions = {}
self.weights = {}
self.gradInput = {}
self.repeatTarget = repeatTarget
marcbelmont / gist:5259298
Created Mar 28, 2013
Extract Skype chats / conversations from preferences (main.db file), convert them to html and send them to an email using Gmail stmp.
View gist:5259298
# -*- coding: utf-8 -*-
Skype database access functionality.
@author Erki Suurjaak
@created 26.11.2011
@modified 07.03.2013
import copy
import csv