This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
import datetime | |
import hashlib | |
import random | |
import string | |
import sys | |
from contextlib import suppress | |
random.seed(0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numsites=3 | |
all: invoices | |
search-results.json: | |
googler --count ${numsites} --exact --noprompt 'intitle:”index of” nfe xml' --json > $@ | |
sites.txt: search-results.json | |
< search-results.json jq ".[]|.url" | sed 's/"//g' > $@ | |
invoices: sites.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import sys | |
import subprocess | |
import zipfile | |
#----------------------------------------------------------------------------- | |
def main(): | |
fileNames = sys.argv[1:] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from xml.etree.ElementTree import iterparse | |
from types import SimpleNamespace | |
def show(text, depth, spacer=' '): | |
print(spacer * depth + text) | |
def main(spec_file_path): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This function will be called before each test case. | |
setup () { | |
# This block will run only for the first test in this file. | |
# Usefull for setting up resources that should last for all tests. | |
if [[ "$BATS_TEST_NUMBER" -eq 1 ]]; then | |
: | |
fi | |
: | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from multiprocessing import Lock, Process, Queue | |
print_lock = Lock() | |
def square_producer(inputqueue, resultqueue): | |
"""A producer that pops numbers off the inputqueue, squares them and puts the | |
result on resultqueue | |
""" | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env bash | |
# | |
# Pomodoro script. | |
# | |
# Displays a notification after X minutes. | |
# | |
# Depends on libnotify-bin | |
main() { | |
minutes=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bb | |
;; -*- mode: clojure -*- | |
(defn first-rest [col] | |
[(first col) (rest col)]) | |
(defn split-path [file] | |
(let [file (io/file file)] | |
[(.getParent file) (.getName file)])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
edition = "2021" | |
name = "block-search-bin" | |
version = "0.1.0" | |
[dependencies] | |
anyhow = "*" | |
chrono = "*" | |
hex = "*" | |
serde_json = "*" |