Skip to content

Instantly share code, notes, and snippets.

View MightyPork's full-sized avatar
🐶
meow

Ondřej Hruška MightyPork

🐶
meow
View GitHub Profile
@cliss
cliss / mergechapters.py
Created January 26, 2021 14:30
Merge Files with Chapters
import datetime
import json
import os
import subprocess
import sys
#############
### USAGE ###
#############
version: '3'
services:
db:
restart: always
image: postgres:9.6-alpine
networks:
- internal_network
### Uncomment to enable DB persistance
volumes:
@MightyPork
MightyPork / uQuery.js
Created August 22, 2017 12:52
tiny inlineable query library to replace jquery
// uQuery
function qsa(q){return document.querySelectorAll(q)}
function qs(q){return document.querySelector(q)}
function bind(el,evt,fn){el.addEventListener(evt,fn)}
function qbind(q,evt,fn){var els=qsa(q);els&&els.forEach(function(el){el.addEventListener(evt, fn)})}
@MightyPork
MightyPork / gme-mnozstevni-sleva.js
Last active October 5, 2017 16:31
userscript pro GME.cz - graf ceny dle počtu kusů
// ==UserScript==
// @name GME vykreslovač množstevní slevy
// @namespace http://tampermonkey.net/
// @version 3
// @description Množstevní sleva GME
// @author Ondřej Hruška, 2017
// @match https://www.gme.cz/*
// @grant MIT
// ==/UserScript==
file = open("usb_hid_keys.h", "r")
for line in file:
goodline = line[8:].split(" ")
if line.startswith("#define ") and len(goodline)>1:
key = goodline[0]
value = ""
for i in range(1, len(goodline)):
if goodline[i] == "":
continue
@dasJ
dasJ / qemu_frozendroid
Created November 3, 2015 18:38
Qemu FrozenDroid
qemu-system-x86_64 \
-enable-kvm -M q35 -localtime -usb -name Windows `# General options` \
-monitor /dev/tty -nographic -vga none -serial none `# Graphic options` \
-cpu host,kvm=off -smp 1,sockets=1,cores=1,threads=1 `# CPU Options` \
-m 1024 `# Memory` \
-bios /usr/share/qemu/bios.bin `# BIOS` \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 `# PCIe Bus` \
-device vfio-pci,host=02:00.0,bus=root.1,addr=00.0,multifunction=on,x-vga=on `# Graphics card` \
-device vfio-pci,host=02:00.1,bus=root.1,addr=00.1 `# Graphics card sound` \
-soundhw hda `# Sound` \
@dasJ
dasJ / windows
Last active August 29, 2017 19:36
Qemu final
#!/bin/bash
xhost local:root > /dev/null
if ! [ -d /sys/fs/cgroup/cpuset/windows ]; then
sudo cgcreate -t $USER:users -a $USER:users -g cpuset:windows
fi
/bin/echo "2-7" > /sys/fs/cgroup/cpuset/windows/cpuset.cpus
/bin/echo "0" > /sys/fs/cgroup/cpuset/windows/cpuset.mems
@magnetikonline
magnetikonline / README.md
Last active March 14, 2024 22:48
IE 7/8/9/10/11 Virtual machines from Microsoft - Linux w/VirtualBox installation notes.
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: