Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python3
# /// script
# requires-python = ">=3.12"
# dependencies = [
# "pyobjc-core",
# "pyobjc-framework-EventKit"
# ]
# ///
--------- BEGIN X LICENSE ---------
A5LUFQBhZGFtZGFuZ29vckBnbWFpbC5jb20IADM4
NTc0NDQxAQQAAAde5kDLDgv3+dQm8VU6RF6lbQzi
4DDaDsWQRPWqowT7JzQ+SJIZEXrbCn+wipxv/05W
UEnEuehI+38wOzlNtS3sDC88DDveMdGIGAdNyAOO
m958pFeTLG9+3JGmAxq+I9TXwUUVlVwoAu6i9YU9
oubTDNZ1Gq9gmc+DtAyVCwu1Xf44xRRf4Q==
---------- END X LICENSE ----------
@adamtheturtle
adamtheturtle / file_like_object.py
Last active January 20, 2024 14:30
Example of using StringIO in a test as a file like object
"""
An example of the benefits of passing a file-like object.
Run tests using:
pip install pyYAML
python -m unittest file_like_object
"""
import unittest
import StringIO

Welcome to a's documentation!

Contents:

# -------- begin 33404240:33521608 response ----------
HTTP/1.1 500 Server Error
Content-Length: 128
Via: 1.1 Repose (Repose/2.12)
X-Compute-Request-Id: req-da6cff4c-9fcb-4e29-8506-4e915390afce
Server: Jetty(8.0.y.z-SNAPSHOT)
Date: Thu, 22 Jan 2015 18:09:16 GMT
Content-Type: application/json; charset=UTF-8
{"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}
@adamtheturtle
adamtheturtle / github_to_jira.py
Created January 9, 2015 11:25
Close one test issue
#!/usr/bin/env python
"""
Tool to help with the move from GitHub to JIRA.
For any open issue (not PR) in ClusterHQ/flocker created by a member of the
ClusterHQ team:
* the body of the issue is changed to refer to the replacement,
* a comment is added saying that the issue is being replaced,
* the issue is closed.
@adamtheturtle
adamtheturtle / github_to_jira.py
Created January 9, 2015 11:09
Print GitHub issues plan
#!/usr/bin/env python
"""
Tool to help with the move from GitHub to JIRA.
For any open issue (not PR) in ClusterHQ/flocker created by a member of the
ClusterHQ team:
* the body of the issue is changed to refer to the replacement,
* a comment is added saying that the issue is being replaced,
* the issue is closed.
@adamtheturtle
adamtheturtle / github_to_jira.py
Created January 9, 2015 11:06
Print issues which will change
#!/usr/bin/env python
"""
Tool to help with the move from GitHub to JIRA.
For any open issue (not PR) in ClusterHQ/flocker created by a member of the
ClusterHQ team:
* the body of the issue is changed to refer to the replacement,
* a comment is added saying that the issue is being replaced,
* the issue is closed.
@adamtheturtle
adamtheturtle / gist:91663a5b0a8f39a10e34
Created January 9, 2015 11:06
Print issues which will change
#!/usr/bin/env python
"""
Tool to help with the move from GitHub to JIRA.
For any open issue (not PR) in ClusterHQ/flocker created by a member of the
ClusterHQ team:
* the body of the issue is changed to refer to the replacement,
* a comment is added saying that the issue is being replaced,
* the issue is closed.
@adamtheturtle
adamtheturtle / gist:50f8c4faacdc7cec1394
Created January 6, 2015 15:27
Acceptance test errors
(flocker-release-flocker-0.3.3dev3)~/Documents/ClusterHQ/flocker-0.3.3dev3/flocker Adam$ admin/run-acceptance-tests --distribution fedora-20
==> node2: VM not created. Moving on...
==> node1: VM not created. Moving on...
Bringing machine 'node1' up with 'virtualbox' provider...
Bringing machine 'node2' up with 'virtualbox' provider...
==> node1: Importing base box 'clusterhq/flocker-tutorial'...
==> node1: Matching MAC address for NAT networking...
==> node1: Checking if box 'clusterhq/flocker-tutorial' is up to date...
==> node1: Setting the name of the VM: fedora-20_node1_1420557754325_8806
==> node1: Clearing any previously set network interfaces...