Skip to content

Instantly share code, notes, and snippets.

View Bomberus's full-sized avatar

Pascal Maximilian Bremer Bomberus

  • Sinsheim, Germany
View GitHub Profile
@Bomberus
Bomberus / gpuswitch.sh
Created October 12, 2016 08:14
GPU Switcher NVIDIA <--> Nouveau <--> VFIO-PCI
#!/bin/sh
# Switch GPU Drivers
# Script by Pascal Maximilian Bremer
# === Functions ===
# Read GPUs in System
lspci -v | perl -ne '/VGA/../^$/ and /VGA|Kern/ and print'
# Read name of selected GPU
@Bomberus
Bomberus / windows.sh
Created October 12, 2016 16:20
QEMU KVM - Windows 10 GPU Passthrough
# Get the memory consumed by cache (memory used by the cache cannot be used for hugepages)
free -m | awk 'NR==2{print $6}'
# Free Cache Memory
sync && echo 3 > /proc/sys/vm/drop_caches
@Bomberus
Bomberus / notebook_importing.py
Last active November 30, 2016 20:52
Notebook Importing Python 3.5 compatible
"""
Module directly collated from
http://nbviewer.ipython.org/github/adrn/ipython/blob/1.x/examples/notebooks/Importing%20Notebooks.ipynb
"""
import io, os, sys, types
from nbformat import current
from IPython.core.interactiveshell import InteractiveShell
def find_notebook(fullname, path=None):
"""find a notebook, given its fully qualified name and an optional path
@Bomberus
Bomberus / w2v
Created April 24, 2017 18:21
w2v Validation
stopwords:
'too','was','where','just','how','have','so','this','has','into','or','what','now', 'about', 'when', 'their','will','some','off','all','can','your','his','you','over', 'no','out','more','not','who','its', 'up','it','be', 'after','that','are','by','but', 'from','an', 'as', 'at','with', 'is','on','and','for','of','to','in','a','the'
labels:
['Arts' 'Business' 'Health' 'Opinion' 'Politics' 'Science' 'Sports' 'Style' 'Technology']
Title (min 35 Character) :
Train : 7204
@Bomberus
Bomberus / userscript.js
Last active October 9, 2017 13:52
Userscript : Remove Google Consent Popover EU Law
// ==UserScript==
// @name Kill Google Consent
// @namespace
// @version 0.2
// @description No body got time for this shit !!!
// @author Bomberus
// @include https://*.youtube.tld/*
// @include https://*.google.tld/*
// @grant none
// @require https://code.jquery.com/jquery-3.2.1.slim.min.js
@Bomberus
Bomberus / store.ts
Last active June 14, 2018 06:05
Vuex-persist localstorage sync
import Vuex, {Payload, Store} from 'vuex'
import VuexPersistence from 'vuex-persist'
const vuexLocal = new VuexPersistence<State, Payload> ({
strictMode: true,
storage: window.localStorage,
filter: mutation => mutation.type !== 'RELOAD_MUTATION'
})
const store = new Vuex.Store<State>({
@Bomberus
Bomberus / main.py
Last active November 8, 2019 01:50
Asyncqt, concurrent executor example
import sys, asyncio, random, threading, datetime
from qtpy.QtWidgets import QApplication, QProgressBar
from asyncqt import QEventLoop, QThreadExecutor
app = QApplication(sys.argv)
loop = QEventLoop(app)
asyncio.set_event_loop(loop)
progress = QProgressBar()
@Bomberus
Bomberus / main.py
Created June 19, 2019 07:27
asyncqt issue
import functools
from PyQt5.QtWidgets import QApplication, QPushButton, QWidget, QVBoxLayout
import sys
def slot(*args):
def outer(fn):
@functools.wraps(fn)
def wrapper(*args, **kwargs):
print("args", args)
print("kwargs", kwargs)
@Bomberus
Bomberus / books.xml
Last active December 22, 2019 02:07
Adobe Livecycle Designer, hide pages depending on provided xml data
<?xml version="1.0"?>
<!-- Source: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v%3Dvs.85)-->
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
@Bomberus
Bomberus / data.xml
Created December 22, 2019 19:35
Adobe LiveCycle Designer Extend Item subform till the end of page
<?xml version="1.0"?>
<!-- Source: https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ms762271(v%3Dvs.85)-->
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications