Recent Pads - Page 4

Total pad count: 686
created 1 year, 74 days ago
pyramid-wild-signed-cookie-session-factory-per-request

    def wild_signed_cookie_session_factory(request):
        """
        Hack SignedCookieSessionFactory to have `wild_domain`.
        Pyramid devs do not want to support this.

        In addition the domain is determined per request!

... view all 23 lines

created 1 year, 80 days ago
717711e7-e8b1-4a2c-af18-d786531b9bf5

invalid request block size: 4473 (max 4096)...skip
[uwsgi-http key: website-comments.tallyfy.com client_addr: 127.0.0.1 client_port: 34216] hr_instance_read(): Connection reset by peer [plugins/http/http.c line 647]
invalid request block size: 4473 (max 4096)...skip
[uwsgi-http key: website-comments.tallyfy.com client_addr: 127.0.0.1 client_port: 34728] hr_instance_read(): Connection reset by peer [plugins/http/http.c line 647]
... view all 5 lines

created 1 year, 80 days ago
6a6098e7-db8f-48a6-9b81-96f9349130bd

<!-- Remarkbox - Your readers want to communicate with you -->
<div id="remarkbox-div">
  <noscript>
    <iframe id=remarkbox-iframe src="https://website-comments.tallyfy.com/embed?nojs=true" style="height:600px;width:100%;border:none!important" tabindex=0></iframe>
  </noscript>
</div>
<script src="https://website-comments.tallyfy.com/static/js/iframe-resizer/iframeResizer.min.js"></script>
... view all 33 lines

created 1 year, 81 days ago
csrf-diff-fix

diff --git a/remarkbox/views/authentication.py b/remarkbox/views/authentication.py
index 7216fdb..90b9464 100644
--- a/remarkbox/views/authentication.py
+++ b/remarkbox/views/authentication.py
@@ -17,7 +17,10 @@ def log_out(request):
     return HTTPFound(uri)
 
... view all 56 lines

created 1 year, 82 days ago
ae7f4ed2-5c2a-4283-836b-b5598b1c76fa

check_csrf_token():

 Invalid token

expected = e7a5ebd830d9f78d23293014bf2e79db0d8cb747
supplied = 964f9355bf71c70f5c0fa7bfa72e354db78b5d51
... view all 6 lines

created 1 year, 89 days ago
1eafccca-d6f4-4957-9306-ce9eb75c5f94

gone
... view all 2 lines

created 1 year, 105 days ago
lucky-or-unlucky-block

from random import choice

death_msg = [
   "you wake up surrounded by magma with a lava cloud about to rain on your head! You were very unlucky ...",
   "you wake up in the end of the world with zombies everywhere! Too Bad!!!",
   "YOU FELL IN AN ENDLESS PIT!",
   "You woke up buried alive!",
... view all 69 lines

created 1 year, 108 days ago
salt-stack-uncomment

  # this broke sometime in 2015 release of salt...
  file.uncomment:
    - name: /etc/nginx/nginx.conf
    - regex: server_names_hash_bucket_size 64;
    - require:
      - pkg: nginx
    - watch_in:
... view all 19 lines

created 1 year, 115 days ago
adfc6ed3-f58b-4ea8-84d2-9f9900df43dd

<#if trigger == "start">
    <b>Starting</b>
<#elseif trigger == "failure">
    <b>Failure</b>
<#elseif trigger == "success">
    <b>Success</b>
</#if> - 
... view all 13 lines

created 1 year, 122 days ago
creative-flash-and-flow

blink | blink | blink | the cursor on the empty page flashed like a visual metronome. 

Then like a toppled glass the words poured like water onto the screen.

We in the industry call this flow or getting in the zone.

Ideas and thoughts flow through you as if coming from a higher place.
... view all 20 lines

created 1 year, 122 days ago
c4cf7b4c-f7e5-4f04-909a-a543ac0e0a47

with request.tm:
    for namespace in request.dbsession.query(m.Namespace).all():
        for user in namespace.owners:
            namespace.set_role_for_user(user, "owner")
            request.dbsession.add(user)
    request.dbsession.flush()
... view all 6 lines

created 1 year, 135 days ago
4bbc4edc-1ba1-46ad-a005-b41c2dbc9449

gone
... view all 2 lines

created 1 year, 139 days ago
f0f4d5ec-526e-47af-83de-13aaa1bea92d

russellbal [6:35 PM]
I came up with a new SaaS idea today.
Aggregated (digest) notifications as a service.
jamie [6:36 PM]
is dat twitter
russellbal [6:37 PM]
You punt a fire hose of notifications at it and based on user (destination) settings it aggregates daily / weekly (edited)
... view all 184 lines

created 1 year, 142 days ago
650fad3f-ca0f-4016-aaa7-4ec44b68bee2

Automatic Watching:

[ ] automatically watch any threads I participate in.
[x] automatically watch any threads I create.


Reply Notifications:
... view all 32 lines

created 1 year, 146 days ago
fba98f2e-9b9c-48d2-b18e-3bccde7ea026

<!-- Remarkbox - Your readers want to communicate with you -->
<div id="remarkbox-div">
  <noscript>
    <iframe id=remarkbox-iframe src="http://cruris.serveo.net/embed?nojs=true" style="height:600px;width:100%;border:none!important" tabindex=0></iframe>
  </noscript>
</div>
<script src="http://cruris.serveo.net/static/js/iframe-resizer/iframeResizer.min.js"></script>
... view all 33 lines

created 1 year, 147 days ago
8862407b-f071-4173-8c08-011de694375a

gone
... view all 2 lines

created 1 year, 150 days ago
c10a4108-4559-40fa-a146-91edb208d2e1

user.create_policy(
  PolicyName='rescue-policy',
  PolicyDocument="""
{
  "Version": "2012-10-17",
  "Statement": {
    "Effect": "Allow",
... view all 12 lines

created 1 year, 157 days ago
average-cost-per-share

>>> # given a list of (qty, price) tuples:
>>> purchases = [(1003.20, 13.25), (15.86, 13.87), (65.31, 13.78), (16.02, 13.73), (15.88, 13.85), (73.41, 13.7
6), (74.74, 13.38), (74.074, 13.5), (16.141, 13.63), (15.99, 13.76), (16.09,13.67)]

>>> # figure out the total quantity of shares:
>>> total_qty_shares = sum(map(lambda x : x[0], purchases))
1386.7150000000004
... view all 13 lines

created 1 year, 166 days ago
interact-with-chromecast-using-python

import pychromecast

if __name__ == "__main__":
    cast = pychromecast.get_chromecasts()[0]
    mc = cast.media_controller
    mc.play_media("http://192.168.0.103:8000/video_test.mp4", content_type = "video/mp4")
... view all 10 lines

created 1 year, 166 days ago
3957d671-a94a-42fd-a9f1-3548a378675c

3-6 minutes put site into maint mode? (I don't think anyone knows how long this takes)
1-3 minutes to take an aurora snapshot
2-3 minutes to PR stacks with the ARN of the snapshot

4-8 minutes ClusterParameterGroup CREATE_IN_PROGRESS Resource creation Initiated

45-60 minutes DBCluster CREATE_IN_PROGRESS Resource creation Initiated
... view all 12 lines

pages 1 2 3 4 5 6 .. 35