This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
Proof of Concept: | |
Django devs built an ORM that seems way more straightforward than many existing tools. This class lets you leverage the django-orm without any project settings or other aspects of a django setup. | |
There are probably weak points and functionality missing, but it seems like a relatively intuitive proof of concept | |
''' | |
import os | |
import django | |
from django.conf import settings |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step 1: apply the subscription | |
cat <<EOF | oc create -f - | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
labels: | |
openshift.io/run-level: "1" | |
name: openshift-performance-addon | |
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
MouseIdentifierString="Mouse" | |
writeOpts() { | |
sudo cat <<'EOF' | sudo tee -a /var/lib/bluetooth/$1/$2/info | |
[ConnectionParameters] | |
MinInterval=6 | |
MaxInterval=7 | |
Latency=0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tornado.web | |
import tornado.ioloop | |
from tornado.options import define, options | |
define('port', default=45000, help='try running on a given port', type=int) | |
def fib(): | |
a, b = 1, 1 | |
while True: | |
yield a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django import template | |
from django.conf import settings | |
import pystache | |
# Needed to register a custom template tag | |
register = template.Library() | |
# Decorator to register a tag that takes the context | |
@register.simple_tag(takes_context=True) | |
# Function which takes the django context class and the template string |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zope.component import getUtility | |
from zope.interface import Interface | |
from zope.interface import alsoProvides | |
from plone.registry.interfaces import IRegistry | |
from plone.app.registry.browser.controlpanel import ControlPanelFormWrapper | |
from plone.app.registry.browser.controlpanel import RegistryEditForm | |
from plone.z3cform import layout |