Skip to content

Instantly share code, notes, and snippets.

View sbrugman's full-sized avatar

Simon Brugman sbrugman

View GitHub Profile
@saleph
saleph / centering.py
Last active August 8, 2022 05:20
[qt5] center a window on screen
__author__ = 'tom'
import sys
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication
class Example(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
#!/bin/bash
# GUI-related packages
pkgs="
xserver-xorg-video-fbdev
xserver-xorg xinit
gstreamer1.0-x gstreamer1.0-omx gstreamer1.0-plugins-base
gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-alsa
gstreamer1.0-libav
epiphany-browser
@clemsos
clemsos / gensim_workflow.py
Last active February 22, 2022 11:09
How to calculate TF-IDF similarity matrix of a complete corpus with Gensim
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
This script just show the basic workflow to compute TF-IDF similarity matrix with Gensim
OUTPUT :
@empr
empr / gist:2774676
Created May 23, 2012 11:22
PySide QWebView disable context menu
# coding: utf-8
import os
import sys
import site
site.addsitedir('/usr/local/lib/python2.7/site-packages')
from PySide import QtCore, QtGui, QtWebKit
class WebView(QtWebKit.QWebView):