Skip to content

Instantly share code, notes, and snippets.

View marcbelmont's full-sized avatar

Marc Belmont marcbelmont

View GitHub Profile
marcbelmont /
Last active February 23, 2022 16:20
Jetson TX2 Packages for Plate Recognizer Stream

After running those commands, you should have the following packages (output from dpkg --list).

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
marcbelmont /
Last active May 24, 2023 03:38
Manage notes stored in a text file using Rofi. Bonus: tiny calculator using Python's eval. For details, see first comment.
#! /usr/bin/python3
import os
import sys
from pathlib import Path
NOTES = Path('/home/marc/Documents/notes.txt')
def to_clipboard(text):
marcbelmont /
Last active November 13, 2020 09:20
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 March 16, 2022 04:51
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 July 7, 2020 09:06
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 / spotify-ad-muter.user.js
Last active April 22, 2024 10:28
Spotify Ad Muter. Automatically mute (block) Spotify ads. Turn sound on again after the ad.
// ==UserScript==
// @name Spotify Ad Muter
// @version 1.2
// @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 July 8, 2023 18:31
Add Unicode Icons to Ranger File Manager (see first comment for details). 🖼️ 📂 🎵 🥳
# Unicode Icons in Ranger File Manager
# How to install?
from __future__ import absolute_import, division, print_function
from itertools import repeat
import ranger.api
marcbelmont /
Created November 2, 2018 14:16

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:

local ParallelCriterionSkip, parent = torch.class('nn.ParallelCriterionSkip', 'nn.Criterion')
function ParallelCriterionSkip:__init(repeatTarget)
self.criterions = {}
self.weights = {}
self.gradInput = {}
self.repeatTarget = repeatTarget