Skip to content

Instantly share code, notes, and snippets.

View jdgoettsch's full-sized avatar
💭
Three sword style

Jeffrey Goettsch jdgoettsch

💭
Three sword style
View GitHub Profile
@jdgoettsch
jdgoettsch / aes.py
Last active April 12, 2023 22:44
python encryption/decryption class
from __future__ import print_function
from __future__ import unicode_literals
import base64
from Crypto import Random
from Crypto.Cipher import AES
class Cipher(object):
@jdgoettsch
jdgoettsch / requirements-dev.in
Created April 6, 2023 17:04
python dev requirements
bandit
flake8
jedi
jedi-language-server
mypy
neovim
pycodestyle
pydocstyle
pylint
reorder-python-imports
@jdgoettsch
jdgoettsch / __import-records.sql
Last active November 2, 2020 18:45
Evergreen 3.6 Import Issues
DROP TABLE IF EXISTS staging_records_import;
CREATE TABLE staging_records_import (id BIGSERIAL, dest BIGINT, marc TEXT);
ALTER SEQUENCE staging_records_import_id_seq RESTART WITH 1;
TRUNCATE TABLE biblio.record_entry CASCADE;
ALTER SEQUENCE biblio.record_entry_id_seq RESTART WITH 1;
CREATE OR REPLACE FUNCTION staging_importer() RETURNS VOID AS $$
DECLARE stage RECORD;
BEGIN
@jdgoettsch
jdgoettsch / logwatch.service
Created January 13, 2020 20:15
Sample logwatch service
#!/usr/bin/perl
my $Debug = $ENV{'LOGWATCH_DEBUG'};
my $Detail = $ENV{'LOGWATCH_DETAIL_LEVEL'};
my $Error = 0;
my @ErrorLines = ();
my $Success = 0;
my @SuccessLines = ();
my @Warning = 0;
my @WarningLines = ();
@jdgoettsch
jdgoettsch / Global .hgrc
Last active January 13, 2020 21:45
My .hgrc settings
[ui]
username = Jeffrey Goettsch <jdgoettsch@ucdavis.edu>
ssh = ssh -C
merge = vimdiff
[extensions]
hgext.color =
hgext.convert =
hgext.extdiff =
hgext.fetch =
@jdgoettsch
jdgoettsch / selenium-example.py
Created February 15, 2019 18:50
Selenium example with Firefox and Python 3
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
from selenium import webdriver
def main():
ff = os.path.join('/', 'Applications', 'Firefox Developer Edition.app',
'Contents', 'MacOS', 'firefox')
wd = webdriver.Firefox(firefox_binary=ff)