Skip to content

Instantly share code, notes, and snippets.

View thatbudakguy's full-sized avatar

Nick Budak thatbudakguy

  • San Francisco, CA
  • 04:39 (UTC -07:00)
View GitHub Profile
@thatbudakguy
thatbudakguy / docker-compose.yml
Created January 6, 2020 18:44
django docker devenv
FROM node:8
RUN mkdir /code
WORKDIR /code
COPY package.json /code/
RUN npm -g config set user root
RUN npm install -g node-sass postcss-cli autoprefixer
RUN npm install
FROM python:3.5
ENV PYTHONUNBUFFERED 1
@thatbudakguy
thatbudakguy / docker-compose.yml
Created February 4, 2020 19:32
single solr compose file
version: '3'
services:
index:
image: solr
ports:
- "8983:8983"
volumes:
- ./solr_conf:/opt/solr/server/solr/configsets/core-name:ro
command:
- solr-precreate
@thatbudakguy
thatbudakguy / visual_tests.py
Created July 8, 2021 14:04
percy scrapy crawler
from percy import percy_snapshot
from scrapy.spiders import SitemapSpider
from selenium import webdriver
class PercySpider(SitemapSpider):
"""Sitemap crawler that uploads DOM snapshots to Percy."""
name = "cdhweb"
sitemap_urls = ["http://localhost:8000/sitemap.xml"]
@thatbudakguy
thatbudakguy / supar.py
Last active October 15, 2021 14:43
supar-kanbun tokenizer
class SuParKanbunTokenizer(object):
to_disk = lambda self, *args, **kwargs: None
from_disk = lambda self, *args, **kwargs: None
to_bytes = lambda self, *args, **kwargs: None
from_bytes = lambda self, *args, **kwargs: None
def __init__(self, bert, segment, vocab) -> None:
self.bert = bert
self.vocab = vocab
self.simplify = {}
@thatbudakguy
thatbudakguy / circ_index_profile.rb
Created May 19, 2023 17:43
FOLIO circ rules evaluation
# frozen_string_literal: true
# require 'ruby-prof'
require 'csv'
# locations
## institution
SU_ID = '8d433cdd-4e8f-4dc1-aa24-8a4ddb7dc929'
## campus
@thatbudakguy
thatbudakguy / make_conll.py
Created January 6, 2024 23:21
CoNLL-2002 and CoNLL-U generators (spaCy)
"""Auto-generate CoNLL-2002 (IOB) entities by tagging a text file."""
from pathlib import Path
from typing import Optional
from typing_extensions import Annotated
import spacy
from spacy.training import offsets_to_biluo_tags
from spacy.training import biluo_to_iob
import typer
@thatbudakguy
thatbudakguy / weather_report.py
Created April 24, 2024 20:23
weather reporting bot for MQTT
"""
Report weather data via MQTT.
"""
import sys
import os
import requests
import time
import paho.mqtt.client as mqtt