Skip to content

Instantly share code, notes, and snippets.

View martinheld's full-sized avatar

Martin Held martinheld

  • Berlin / Germany
View GitHub Profile
@nvgrw
nvgrw / TP_Mac_Setup.markdown
Last active February 15, 2024 05:09
TurboPascal setup tutorial for Mac

TurboPascal on Mac

Note: probably 99% of this tutorial (excluding installation and folder structure) is DOSBox- and not Mac-specific. As long as your computer can run DOSBox you should be able to convert the steps to work on Windows.

1. Downloading & Installing DOSBox

DOS apps don't run natively on OS X, so we use DOSBox to emulate DOS for us.

1a. Downloading DOSBox

Navigate to the official DOSBox download page

@bradmontgomery
bradmontgomery / dummy-web-server.py
Last active April 15, 2024 14:27
a minimal http server in python. Responds to GET, HEAD, POST requests, but will fail on anything else.
#!/usr/bin/env python
"""
Very simple HTTP server in python (Updated for Python 3.7)
Usage:
./dummy-web-server.py -h
./dummy-web-server.py -l localhost -p 8000
Send a GET request:
@dound
dound / postgresql_upsert.py
Created January 10, 2011 00:19
Python implementation of UPSERT for use with postgresql.
def upsert(db_cur, table, pk_fields, schema=None, **kwargs):
"""Updates the specified relation with the key-value pairs in kwargs if a
row matching the primary key value(s) already exists. Otherwise, a new row
is inserted. Returns True if a new row was inserted.
schema the schema to use, if any (not sanitized)
table the table to use (not sanitized)
pk_fields tuple of field names which are part of the primary key
kwargs all key-value pairs which should be set in the row
"""