This file contains hidden or 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 SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
| """ | |
| Wrapper around the SWORD API, targeting Hyku's SWORD API specifically. | |
| """ | |
| import io | |
| import logging | |
| import mimetypes |
This file contains hidden or 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
| ;; org-roam-copy.el --- Copy `:COPY:` property from an org-roam node | |
| ;; Author: John Borwick <borwick@uw.edu> | |
| ;; This file is NOT part of GNU Emacs. | |
| ;; Copyright (c) 2025 University of Washington | |
| ;; All rights reserved. | |
| ;; Redistribution and use in source and binary forms, with or without |
This file contains hidden or 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
| (defun multiple-value-plist (properties func &rest args) | |
| "Wrap a function call, binding each return value to properties specified in `properties. Returns a plist. | |
| For example: | |
| (multiple-value-plist '(:return-arg1 :return-arg2) #'func args) | |
| would return a plist with properties `return-arg1` and `return-arg2` bound to the first and second values returned from `#'func`." | |
| (let ((return-vals (multiple-value-list (apply func args)))) | |
| ; thanks to copilot for this: |
This file contains hidden or 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
| --- /old/_header_value_parser.py 2023-10-26 15:58:17.000000000 -0700 | |
| +++ /opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/email/_header_value_parser.py 2023-10-26 15:58:29.000000000 -0700 | |
| @@ -1513,6 +1513,9 @@ | |
| raise | |
| token, value = get_cfws(value) | |
| obs_local_part.append(token) | |
| + if not obs_local_part: | |
| + return obs_local_part, value | |
| + | |
| if (obs_local_part[0].token_type == 'dot' or |
This file contains hidden or 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 finds org-mode links that have slashes in them. I used this to find URLs that needed | |
| # org-mode "escaping" with ='s around them (e.g. example.com/this/that/ --> =example.com/this/that/= ) | |
| # close ARGV if eof resets $. (the line number) | |
| perl -lne 'print "$ARGV $.: $1" if m|(\[https:[^\]]+\]\[[^\]]+/.*?\])|; close ARGV if eof;' * |
This file contains hidden or 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/bash | |
| URL=$1 | |
| if [ "x$URL" == "x" ] | |
| then | |
| echo "Run as: $0 url" | |
| exit 1 | |
| fi |
This file contains hidden or 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
| """ | |
| The below code will connect to a very old and insecure MySQL database. Do not use this for anything important! | |
| No warranty is expressed or implied. | |
| You must use Python ≤3.9 to be able to connect with OpenSSL 1.0 | |
| """ | |
| ctx = ssl.create_default_context() | |
| # https://stackoverflow.com/a/69457639/14068848 | |
| ctx.set_ciphers('ALL:@SECLEVEL=0') | |
| # https://stackoverflow.com/a/33770290/14068848 |
This file contains hidden or 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
| --- unpatched.py 2023-01-05 11:07:46.000000000 -0800 | |
| +++ email/_header_value_parser.py 2023-01-05 11:07:06.000000000 -0800 | |
| @@ -1485,6 +1485,8 @@ | |
| """ | |
| obs_local_part = ObsLocalPart() | |
| last_non_ws_was_dot = False | |
| + if len(value) >= 3 and value[0]=='[' and value[-2]==']': | |
| + value = value[1:-2] + value[-1] | |
| while value and (value[0]=='\\' or value[0] not in PHRASE_ENDS): | |
| if value[0] == '.': |
This file contains hidden or 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 logging | |
| import os | |
| if os.environ.get('DEBUG', False): | |
| logging.basicConfig(level=logging.DEBUG) | |
| else: | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger() |
This file contains hidden or 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
| (browse-url (concat "https://drive.google.com/drive/search?q=type:document%20after:" | |
| (format-time-string "%Y-%m-%d" | |
| (time-subtract (current-time) (days-to-time 14))))) |
NewerOlder