Skip to content

Instantly share code, notes, and snippets.

View marcbelmont's full-sized avatar
🐧

Marc Belmont marcbelmont

🐧
View GitHub Profile
@marcbelmont
marcbelmont / image_viewer.py
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
marcbelmont / tornado_rollbar.py
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
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 http://tampermonkey.net/
// @description Detects and blocks ads on Spotify. Automatically mute Spotify ads. Turn sound on again after the ad.
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
// @updateURL https://gist.github.com/marcbelmont/1ea63270867a4e8786dd5f172d8d4489/raw
@marcbelmont
marcbelmont / unicode_icons.py
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?
# https://gist.github.com/marcbelmont/c12d2fd2519a372d3b347f665b37e74a#gistcomment-3240106
from __future__ import absolute_import, division, print_function
from itertools import repeat
import ranger.api
// ==UserScript==
// @name Spotify ad skipper
// @version 1.0
// @namespace http://tampermonkey.net/
// @description Detects and skips ads on spotify
// @match https://*.spotify.com/*
// @grant none
// @run-at document-start
// @downloadURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
// @updateURL https://gist.githubusercontent.com/Simonwep/24f8cdcd6d32d86e929004013bd660ae/raw
@Karmalakas
Karmalakas / FB_no_sponsored.user.js
Last active August 1, 2022 17:24
Remove sponsored posts on Facebook feed
// ==UserScript==
// @name No Sponsored FB posts
// @description Hide Sponsored posts on Facebook
// @namespace http://karmalakas.lt/
// @version 1.5.13
// @author Karmalakas
// @updateURL https://gist.github.com/Karmalakas/b0860e39ad26857c285d6bad4884bea6/raw/FB_no_sponsored.user.js
// @downloadURL https://gist.github.com/Karmalakas/b0860e39ad26857c285d6bad4884bea6/raw/FB_no_sponsored.user.js
// @supportURL https://gist.github.com/Karmalakas/b0860e39ad26857c285d6bad4884bea6
// @match https://www.facebook.com/
import tensorflow as tf
import numpy as np
class ConvolutionalAttentionNLI(object):
def __init__(self, embeddings_shape, target_classes=2, conv_filter_size=3, conv_projection_size=300, attention_output_size=200, comparison_output_size=100, learning_rate=0.05):
self._embeddings_shape = embeddings_shape
self._target_classes = target_classes
self._conv_filter_size = conv_filter_size
self._conv_projection_size = conv_projection_size
@sunsided
sunsided / dump_operations.py
Last active October 27, 2021 21:26
Listing operations in frozen .pb TensorFlow graphs in GraphDef format (see comments for SavedModel)
import argparse
import os
import sys
from typing import Iterable
import tensorflow as tf
parser = argparse.ArgumentParser()
parser.add_argument('file', type=str, help='The file name of the frozen graph.')
args = parser.parse_args()
@awjuliani
awjuliani / DCGAN.ipynb
Last active May 19, 2020 07:12
An implementation of DCGAN in Tensorflow and Python.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@minimal
minimal / jetty.clj
Created January 20, 2010 01:17
Websockets with clojure + jetty
;; Copyright (c) James Reeves. All rights reserved.
;; The use and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php) which
;; can be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by the
;; terms of this license. You must not remove this notice, or any other, from
;; this software.
(ns compojure.server.jetty
"Clojure interface to start an embedded Jetty server."