Skip to content

Instantly share code, notes, and snippets.

View Preston-Landers's full-sized avatar

Preston Landers Preston-Landers

View GitHub Profile
@Preston-Landers
Preston-Landers / ChatGPT print hack.md
Last active May 25, 2023 18:39
Tweak ChatGPT CSS to allow better printing of the conversation

ChatGPT print hack

If you want to print a conversation (or PDF) from ChatGPT, as of this writing the CSS makes it cut off everything after the first page.

Here's a simple little hack to enable printing the entire conversation.

Open the Javascript Console (Ctrl-Shift-J) or Developer Tools (Ctrl-Shift-I). Make sure the focus is on the console prompt >.

Paste and run this:

@Preston-Landers
Preston-Landers / issue24_test.py
Created April 8, 2020 14:13
Test of concurrent-log-handler issue 24
import logging
from concurrent.futures.process import ProcessPoolExecutor
from concurrent_log_handler import ConcurrentRotatingFileHandler
class Foo():
def func(self, *args):
print("Called func")
@Preston-Landers
Preston-Landers / test_multiproc_socket_inherit.py
Created December 6, 2016 22:56
Test the ability to inherit sockets in multiprocessing on Windows (Python 3.6)
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""
Test socket inheritance on Windows with multiprocessing.
"""
import time
@Preston-Landers
Preston-Landers / index.html
Created March 14, 2015 16:28
speakur-discussion Element Demo // source http://jsbin.com/jubabubazu/8
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title>speakur-discussion Element Demo</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1"/>
<meta charset="utf-8">
<script src="http://preston-landers.github.io/speakur-discussion/components/webcomponentsjs/webcomponents.min.js"></script>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://www.polymer-project.org/webcomponents.min.js"></script>
<title>JS Bin</title>
</head>
<!--
This is where you should put a basic demo to show off what your element can do!
A good usage example will help others understand what your element is and how
@Preston-Landers
Preston-Landers / pyuac.py
Last active June 16, 2023 04:09
pyuac - elevate a Python process with UAC on Windows
#!/usr/bin/env python
# -*- coding: utf-8; mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vim: fileencoding=utf-8 tabstop=4 expandtab shiftwidth=4
"""
THIS CODE IS OUTDATED! Please use this instead:
https://pypi.org/project/pyuac/
https://github.com/Preston-Landers/pyuac

Keybase proof

I hereby claim:

  • I am Preston-Landers on github.
  • I am planders (https://keybase.io/planders) on keybase.
  • I have a public key whose fingerprint is 1B11 8DEC 1920 CB99 F45E CDA0 6A6F 2667 C8A3 E66F

To claim this, I am signing this object: