I hereby claim:
- I am mechanism on github.
- I am mechanism (https://keybase.io/mechanism) on keybase.
- I have a public key ASAYecgpXx82qwlmw9uXz9-8gMxbsMeinXffkuZbsTTXbAo
To claim this, I am signing this object:
<link rel="import" href="{{ STATIC_URL }}vendor/polymer/polymer.html"> | |
<link rel="import" href="{{ STATIC_URL }}vendor/core-ajax/core-ajax.html"> | |
<polymer-element name="django-ajax" extends="core-ajax"> | |
<script> | |
Polymer({ | |
ready: function() { | |
this.super(); | |
this.headers = { | |
"X-CSRFToken": {{ csrf_token }}, |
I hereby claim:
To claim this, I am signing this object:
CREATE OR REPLACE FUNCTION notify_trigger() RETURNS trigger AS $$ | |
DECLARE | |
channel_name varchar DEFAULT (TG_TABLE_NAME || '_changes'); | |
BEGIN | |
IF TG_OP = 'INSERT' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || NEW.id || '"}'); | |
RETURN NEW; | |
END IF; | |
IF TG_OP = 'DELETE' THEN | |
PERFORM pg_notify(channel_name, '{"id": "' || OLD.id || '"}'); |
I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.
#!/usr/bin/env python3 | |
import redis | |
import xml.dom.minidom as minidom | |
def generate_placemark(doc, document, station): | |
"Generates a single place mark from a station" | |
placemark = doc.createElement('Placemark') | |
document.appendChild(placemark) |
Streaming your Linux desktop to Youtube and Twitch via Nvidia's NVENC and VAAPI:
Considerations to take when live streaming:
The following best practice observations apply when using a hardware-based encoder for live streaming to any platform:
Set the buffer size (-bufsize:v
) equal to the target bitrate (-b:v
). You want to ensure that you're encoding in CBR mode.
Set up the encoders as shown: