Skip to content

Instantly share code, notes, and snippets.

@joeyv120
joeyv120 / TicToc.py
Created April 1, 2021 14:17
Tic Toc Timer
from time import time
class TicToc():
'''
Represents a simple timer-like, or stopwatch object.
tic() starts the timer.
toc() returns time (seconds) since tic() was called.
'''
def __init__(self):
@joeyv120
joeyv120 / ni_reserve.py
Created September 9, 2021 18:41
NI-DAQmx device reservation heist
"""Steal a network device for exclusive use regardless of reservation"""
import warnings
import nidaqmx as ni
# ignore warnings from nidaqmx (i.e. network device is already in the system)
warnings.filterwarnings('ignore', module='nidaqmx')
host = 'cDAQ9185-1E00AD8' # ip address or host name
cdaq = ni.system.device.Device(name=host)
@joeyv120
joeyv120 / qmk_c_json.txt
Created November 30, 2021 20:14
QMK commands for converting between json and c keymap files
qmk json2c2 C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.json
qmk c2json -km joeyv120 -kb keebio/iris/rev4 C:/Users/[USERSAME]/qmk_firmware/keyboards/keebio/iris/keymaps/joeyv120/keymap.c
qmk c2json -km JoeNAO -kb jnao C:/Users/[USERSAME]/qmk_firmware/keyboards/JNAO/keymaps/JoeNAO/keymap.c --no-cpp
@joeyv120
joeyv120 / d4Scraper.py
Created June 13, 2024 20:06
Script to scrape PDF files from d4Caltrop's blog
# https://martechwithme.com/get-list-pages-url-from-website-python/
# https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url#39225272
import requests
import os
import re
from usp.tree import sitemap_tree_for_homepage
from time import sleep
@joeyv120
joeyv120 / YUMDMScraper.py
Created July 2, 2024 16:33
Script to scrape PDF files from YUM-DM's website
# https://martechwithme.com/get-list-pages-url-from-website-python/
# https://stackoverflow.com/questions/38511444/python-download-files-from-google-drive-using-url#39225272
# https://stackoverflow.com/questions/38489386/how-to-fix-403-forbidden-errors-when-calling-apis-using-python-requests
import requests
import os
import re
from usp.tree import sitemap_tree_for_homepage
from time import sleep