Skip to content

Instantly share code, notes, and snippets.

@jaraco
jaraco / foo.py
Last active November 15, 2018 12:29
import functools
import collections
import cherrypy
class SelectedMethod:
"""
Descriptor allowing a series of handler methods to satisfy
a variety of behaviors based on the request method.
python3statement.github.io master $ gem install jekyll
Fetching: colorator-1.1.0.gem (100%)
Successfully installed colorator-1.1.0
Fetching: http_parser.rb-0.6.0.gem (100%)
Building native extensions. This could take a while...
Successfully installed http_parser.rb-0.6.0
Fetching: eventmachine-1.2.7.gem (100%)
Building native extensions. This could take a while...
Successfully installed eventmachine-1.2.7
Fetching: em-websocket-0.5.1.gem (100%)
query = [{'$lookup': {
'from': 'tasks',
'let': {'target_id': '$ID'},
'pipeline': [
{
'$match': {
'$expr': {
'$eq': ['$TARGET_ID', '$$target_id'],
},
},
SELECT TARGETS.*, TASKS.LAST_HARVESTED
FROM TARGETS
LEFT OUTER JOIN (
SELECT TARGET_ID, max(HARVESTED) LAST_HARVESTED
FROM TASKS
GROUP BY TARGET_ID
) TASKS
on TARGETS.ID = TASKS.TARGET_ID
jaraco.site master $ curl -v -L -u any:any https://www.jaraco.com/auth-demo/here/
* Trying 2001:4802:7800:1:be76:4eff:fe20:21d9...
* TCP_NODELAY set
* Connected to www.jaraco.com (2001:4802:7800:1:be76:4eff:fe20:21d9) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
setuptools master $ git diff
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
index 05508ceb..108308ab 100755
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -408,6 +408,7 @@ class easy_install(Command):
self._expand_attrs(dirs)
def run(self):
+ raise RuntimeError()
import stripe
stripe.api_key = '...'
disc = stripe.Coupon.create(amount_off=189, currency='USD', duration='forever', id='nice-discount')
cust = stripe.Customer.create(description="nice customer")
prod = stripe.Product.create(name="Individual Lite", type='service')
plan = stripe.Plan.create(nickname='Monthly', amount=199, currency='USD', product=prod, interval='month')
sub = stripe.Subscription.create(customer=cust, items=[dict(plan=plan, quantity=0)], coupon=disc)
item, = sub['items']['data']
item.quantity += 1
item.save().quantity
import cherrypy
class App:
@cherrypy.expose
def index(self):
return 'Done'
cherrypy.config.update({
'server.socket_host': '127.0.0.1',
'server.socket_port': 8080,

Keybase proof

I hereby claim:

  • I am jaraco on github.
  • I am jaraco (https://keybase.io/jaraco) on keybase.
  • I have a public key ASBB1cwe3WVEN7uHXVukGXLA6jRWJ0WnfOXJyHgYJGJs-wo

To claim this, I am signing this object:

jaraco@kafka:~$ sudo systemctl status pmxbot
● pmxbot.service - chat bot
Loaded: loaded (/etc/systemd/system/pmxbot.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Fri 2018-03-30 00:14:01 UTC; 17h ago
Process: 8256 ExecStart=/opt/pmxbot/bin/pmxbot /etc/pmxbot/main.conf /etc/pmxbot/server.conf /etc/pmxbot/database.conf /etc/pmxbot/twilio.conf /etc/pmxbot/trans.conf /
Main PID: 8256 (code=exited, status=1/FAILURE)
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.