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
    
  
  
    
  | #!/usr/bin/env python | |
| import os, pty, subprocess, time | |
| from pprint import pprint | |
| # Ask the OS to create a new "pseudoterminal pair" | |
| # The shell is going to have the "tty" end and the terminal emulator is going to have the | |
| # "pseudoterminal master" ("ptmx") end | |
| # pprint(os.environ) | |
| ptmx, tty = pty.openpty() | 
  
    
      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
    
  
  
    
  | def hexdump(byte_stream, encoding='utf-8', grouping=16): | |
| num_bytes = len(byte_stream) | |
| padding = (grouping-num_bytes%grouping)%grouping | |
| byte_stream += bytes(chr(0)*padding, encoding) | |
| def map_byte_to_readable_char(the_byte, valid_range=range(32,128), invalid_char='.'): | |
| return chr(the_byte) if the_byte in valid_range else invalid_char | |
| for row in range(0,len(byte_stream)//grouping): | |
| row_data = [f"{byte_stream[row*grouping+n]:02x}" for n in range(0,grouping)] | |
| row_chars = [ | |
| f"{map_byte_to_readable_char(byte_stream[row*grouping+n])}" | 
  
    
      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
    
  
  
    
  | def get_dimensions_from_image_path(path): | |
| import os, subprocess, plistlib #os for path expansion; subprocess for Popen; plistlib for parsing the plist format | |
| mdls_output = subprocess.Popen( | |
| # command line arguments, including "-p -" for stdout output | |
| ['/usr/bin/mdls', '-p', '-', os.path.expandvars(path).rstrip('\n')], | |
| stdout=subprocess.PIPE # pipe for stdout | |
| ).stdout.read().decode() # read bytes from stdout, and decode them as string | |
| mdls_dict = plistlib.loads(mdls_output) # load string as Plist | |
| return mdls_dict['kMDItemPixelWidth'], mdls_dict['kMDItemPixelHeight'] # keys for image width and height | 
  
    
      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
    
  
  
    
  | # Get files | |
| import os | |
| import re | |
| # os.expanduser provides the right username based on the current user | |
| target_files = [x for x in os.listdir(os.path.expanduser('~/Downloads')) | |
| if x.lower().endswith('.pdf') | |
| and x.startswith('2025_') # comment out if needed | |
| and x.find('_recepit') != -1 # comment out if needed | |
| ] | 
  
    
      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
    
  
  
    
  | def irange(*args): | |
| """irange(stop) -> range object | |
| irange(start, stop[, step]) -> range object | |
| Returns a range object that produces a sequence of integers from start (inclusive) | |
| to stop (also inclusive) by step, which defaults to 1 | |
| irange(i, j) produces i, i+1, i+2, ..., j. (range would stop at j-1) | |
| start defaults to 0, and stop is omitted! irange(4) produces 0, 1, 2, 3, 4. | |
  
    
      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 sys # we use sys to get the input to the service | |
| # from sys.stdin | |
| from urllib.parse import quote # to convert high-ASCII and other | |
| # into URL-compatible quoting | |
| import webbrowser # To open the web browser | |
| # establish the base instance URL | |
| jama_search_base_url = "https://almaobservatory.jamacloud.com/perspective.req#/" | |
| project_id="project_id code" | 
  
    
      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
    
  
  
    
  | #!/usr/bin/env python | |
| import datetime as dt | |
| def riddle_for_date(date, solutions=False): | |
| """ | |
| Determines the number for the Saturday Mac Riddle associated with | |
| a given date, considering whether it is the date for the riddle | |
| or the solutions. | 
  
    
      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
    
  
  
    
  | \documentclass{article} | |
| \usepackage{hyperref} | |
| \usepackage{makeidx} | |
| \usepackage{glossaries} | |
| \makeindex | |
| \makeglossaries | |
| % Define your acronym | 
  
    
      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 script assumes that [mdbtools][1] are installed, for instance with | |
| # `brew install mdbtools` | |
| # [1]: https://github.com/mdbtools/mdbtools | |
| # It also assumes that [pandas][2] and [pandas_access][3] are installed, | |
| # [2]: https://pandas.pydata.org/ | |
| # [3]: https://pypi.org/project/pandas_access/ | |
| # which you can do with | |
| # `pip install pandas pandas_access` | |
| # or | |
| # `pip install pandas_access` | 
  
    
      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
    
  
  
    
  | digraph pictionary_play { | |
| node [fontname = "Handlee"]; | |
| edge [fontname = "Handlee"]; | |
| splines=false; | |
| randir=LR; | |
| draw [ | |
| label = "Draw a picture"; | 
NewerOlder