Skip to content

Instantly share code, notes, and snippets.

View jadudm's full-sized avatar

Matthew Jadud jadudm

View GitHub Profile
@jadudm
jadudm / rollup_01.py
Created October 18, 2023 10:45
fac_rollup_01
import os
import requests
FAC_API_BASE = os.getenv("FAC_API_URL")
FAC_API_KEY = os.getenv("API_GOV_KEY")
# get_n_report_ids : number -> list-of strings
# Returns `n` report IDs.
def get_n_report_ids(n):
url = f"{FAC_API_BASE}/general?select=report_id&limit={n}"
@jadudm
jadudm / generate.py
Created April 19, 2023 13:01
Generating Excel workbooks
from openpyxl import Workbook
from openpyxl.workbook.defined_name import DefinedName
from openpyxl.worksheet.datavalidation import DataValidation
from openpyxl.utils import quote_sheetname, absolute_coordinate
import json
from json import JSONEncoder
wb = Workbook()
ws = wb.active
<!DOCTYPE html>
<html lang = "en">
<head>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.8.2/dist/chart.min.js"></script>
</head>
<body>
<canvas id="chart01" width="400" height="400"></canvas>
<script>
@jadudm
jadudm / pcapySniffer.py
Created February 26, 2021 21:53 — forked from membrive/pcapySniffer.py
A very simple python-pcapy example for monitor mode WiFi sniffing
#!/usr/bin/python
#
# A very simple python-pcapy example for monitor mode WiFi sniffing.
#
# Usage example:
# $ python pcapySniffer.py mon0
import pcapy
import sys
import os
@jadudm
jadudm / jquery-count.py
Created May 29, 2020 12:42
Counting usages of $( in files as a way of estimating JQuery usage.
import os
import re
root = "."
list_of_files = []
file_count = 0
ignore_extensions = ["sh", "md", "png", "otf", "woff2", "ttf", "woff", "eot", "ico", "jpg", "sample"]
<html>
<head>
<title>Replacing JQuery?</title>
</head>
<body>
<script>
let MiniQuery = class {
constructor (queryString) {
this.queryString = queryString;
// In JQuery...
@jadudm
jadudm / dbase.rkt
Created March 17, 2020 12:25
A little Star Wars database for exploring GraphQL
#lang racket
(require db sql)
(provide conn)
(when (file-exists? "/tmp/dbase.sqlite")
(delete-file "/tmp/dbase.sqlite"))
(define conn (sqlite3-connect #:database
"/tmp/dbase.sqlite"
@jadudm
jadudm / lobsters.py
Last active March 8, 2020 18:53
tbl 20200308 01
from tbl import *
pets_url = "https://docs.google.com/spreadsheets/d/e/2PACX-1vSK2rd47ogfI2CpQi2L6HDo9AOEhnhqBN4zR4kLPUO28vBzmlc8XQWrvTfBYCU0ePf478yxcNKdOy5m/pub?gid=0&single=true&output=csv"
pets_tbl = tbl_from_sheet(pets_url)
@jadudm
jadudm / README.txt
Created October 20, 2019 23:52 — forked from Cyberek/README.txt
Starting Kodi automatically on Raspbian Jessie and Stretch
So you were able to install Kodi via "sudo apt-get install kodi" but have no idea how to force it to autostart on boot?
You have tried all those googled solutions such as adding kodi-standalone to .bashrc, creating init.d script but nothing worked?
This is the right place to get the answer.
For some reason, the current version of Kodi doesnt provide 2 important files:
/etc/init.d/kodi
/etc/default/kodi
@jadudm
jadudm / elecrow_config.txt
Created October 20, 2019 21:11 — forked from kaz-yos/elecrow_config.txt
Elecrow 5inch 800x480 LCD configuration for Raspberry Pi (Add to the bottom of /boot/config.txt)
### Elecrow HDMI 5inch 800x480 LCD display
# https://www.amazon.com/Elecrow-Display-Monitor-800x480-Raspberry/dp/B013JECYF2/
# Adopted from the following URL. Modified for clarity and corrections.
# https://www.amazon.com/gp/aw/review/B013JECYF2/R3ZXW0VTV8AEB/ref=cm_cr_dp_mb_rvw_1?ie=UTF8&cursor=1
# DOCUMENTATION > CONFIGURATION > CONFIG-TXT
# https://www.raspberrypi.org/documentation/configuration/config-txt.md
### Display configuration
# hdmi_group: 0 auto-detect from EDID; 1 CEA; 2 DMT
hdmi_group=2