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 os | |
import re | |
from kivy.logger import Logger | |
from kivy.properties import (ObjectProperty, BooleanProperty, StringProperty, | |
OptionProperty, NumericProperty, ReferenceListProperty) | |
from kivy.uix.widget import Widget | |
from kivy.utils import platform |
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
# -*- coding: utf-8 -*- | |
from base64 import b64encode | |
from datetime import datetime | |
from os.path import join | |
try: | |
import json | |
except ImportError: | |
import simplejson as json |
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 kivy.app import App | |
from kivy.uix.widget import Widget | |
from kivy.lang import Builder | |
from kivy.properties import StringProperty | |
kv = ''' | |
<MyWidget>: | |
canvas: | |
Rectangle: | |
size: self.size |
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 kivy.animation import Animation | |
from kivy.clock import Clock | |
from kivy.lang import Builder | |
from kivy.properties import (BooleanProperty, ListProperty, NumericProperty, | |
OptionProperty, ObjectProperty, StringProperty) | |
from kivy.uix.label import Label | |
from kivy.uix.scrollview import ScrollView | |
Builder.load_string(""" | |
<AutoScrollableVLabel>: |
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
# dont do this | |
this_function_name(foo, bar | |
baz) | |
# do this | |
cramers_version( | |
foo, bar, baz) | |
# allow this | |
cramers_version(foo, bar, |
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 lxml import etree | |
from time import time | |
st = time() | |
c = 0 | |
order_pattern = [ | |
'1st_column', | |
'2nd_column', | |
'3rd_column', |
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
# ! /usr/bin/env python3 | |
import asyncio | |
from autobahn.asyncio.websocket import WebSocketServerProtocol, WebSocketServerFactory | |
class MyServerProtocol(WebSocketServerProtocol): | |
def processHandshake(self): | |
hand = super().processHandshake() | |
print(self.http_headers) | |
return hand |
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
map $http_upgrade $connection_upgrade { | |
default upgrade; | |
'' close; | |
} | |
upstream websocket { | |
server 127.0.0.1:8888; | |
} | |
upstream backend_PROJ { | |
server unix:///opt/PROJ/socket; |
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 os | |
import json | |
import asyncio | |
from datetime import datetime | |
from sys import platform | |
from autobahn.asyncio.websocket import WebSocketClientProtocol, WebSocketClientFactory | |
loop = asyncio.get_event_loop() |
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 graphene import relay, String, List | |
from graphene_django.filter import DjangoFilterConnectionField | |
from graphene_django.fields import DjangoConnectionField | |
from app.models import Model | |
class Object(DjangoObjectType): | |
class Meta: | |
model = Model |
OlderNewer