Skip to content

Instantly share code, notes, and snippets.

View patkub's full-sized avatar
💭
🤔

Patrick Kubiak patkub

💭
🤔
View GitHub Profile
@patkub
patkub / badboysforlife.json
Created April 9, 2020 21:50
Bad boys Whatcha want, watcha want Whatcha gonna do
{
"Title":"Bad Boys for Life",
"Year":"2020",
"Rated":"R",
"Released":"17 Jan 2020",
"Runtime":"124 min",
"Genre":"Action, Comedy, Crime, Thriller",
"Director":"Adil El Arbi, Bilall Fallah",
"Writer":"Chris Bremner (screenplay), Peter Craig (screenplay), Joe Carnahan (screenplay), Peter Craig (story), Joe Carnahan (story), George Gallo (characters)",
"Actors":"Will Smith, Martin Lawrence, Vanessa Hudgens, Alexander Ludwig",
@patkub
patkub / chatlogger.py
Last active April 17, 2024 03:26
zoom.us chat logger
import json
with open("file.txt", "r") as f:
data = json.load(f)
#print(data)
for message in data:
print("[" + message['time'] + "] " + message['username'] + ": " + message['content'])
@patkub
patkub / muse.py
Last active March 20, 2020 06:33
📚
import bs4, requests, os, re, unicodedata
# spoof useragent
user_agent = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'
headers = {'User-Agent': user_agent}
def slugify(value):
"""
Normalizes string, converts to lowercase, removes non-alpha characters,
and converts spaces to hyphens.
@patkub
patkub / etc_fstab
Created March 8, 2020 03:11
fstab ntfs-3g ugh
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
/dev/mapper/isw_cgbcidigec_Manjaro2 / ext4 errors=remount-ro 0 1
/dev/mapper/isw_cgbcidigec_Manjaro1 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
@patkub
patkub / syncnotes
Last active February 12, 2020 19:04
auto notes backup :)
#!/bin/bash
inotifywait -m -e close_write --format '%w' ~/Documents/Notes/*.xopp | while read FILE
do
# export to PDF
xournalpp "$FILE" -p "${FILE%.*}.pdf"
# upload to gdrive
rclone --config ~/Documents/gdrive/config/rclone.conf copy ~/Documents/Notes drive:Notes
done
@patkub
patkub / ready.js
Created November 6, 2019 06:36
waits for an element to be added to the DOM. useful for userscripts
(function(win) {
'use strict';
var listeners = [],
doc = win.document,
MutationObserver = win.MutationObserver || win.WebKitMutationObserver,
observer;
function ready(selector, fn) {
// Store the selector and callback to be monitored
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
<script type="text/javascript" src="https://unpkg.com/local-storage-poorlyfill/dist/local-storage-poorlyfill.js"></script>
</head>
<body>
</body>
@patkub
patkub / index.js
Created July 5, 2018 21:55
porcelain test
'use strict'
const exec = require('child_process').execSync
const fs = require("fs")
// create a file so there are changes
var createStream = fs.createWriteStream("new_file.txt");
createStream.end();
console.log("git ls-files length: " + exec('git ls-files').toString().split('\n').length)
@patkub
patkub / plex.conf
Created March 28, 2018 07:09
nginx plex proxy pass
location /web {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";