View book.py
""" | |
Example code | |
============ | |
""" | |
import typing as T | |
from flask import request, redirect | |
if T.TYPE_CHECKING: | |
from ..lib.cls_endpoint import CLSEndpointFlask |
View data_migration.py
"""Convert lat/long from float to int | |
Revision ID: b020841d98e4 | |
Revises: 6e741a21efc8 | |
Create Date: 2019-07-10 20:03:38.282042 | |
Given a source table like | |
class GPS(Base): | |
# $--RMC, hhmmss.sss, x, llll.lll, a, yyyyy.yyy, a, x.x, u.u, xxxxxx,, , v * hh < CR > < LF > |
View runner.py
import subprocess | |
import threading | |
import queue | |
import os | |
import time | |
class Runner(object): | |
def __init__(self, cmd: []): | |
self.cmd = cmd |
View reloader.py
""" | |
A flask like reloader function for use with txweb | |
In user script it must follow the pattern | |
def main(): | |
my main func that starts twisted | |
if __name__ == "__main__": |
View background.js
/***************************************************************** | |
* onMessage from the extension or tab (a content script) | |
*****************************************************************/ | |
chrome.runtime.onMessage.addListener( | |
function(request, sender, sendResponse) { | |
if (request.cmd == "any command") { | |
sendResponse({ result: "any response from background" }); | |
} else { | |
sendResponse({ result: "error", message: `Invalid 'cmd'` }); | |
} |
View notes.txt
Dislaimer | |
######### | |
I've been using Komodo IDE since the mid-90's but I AM NOT AN ACTIVE STATE EMPLOYEE. This is on your ownware with a I don't care license. | |
No warranty of the code is offered, read the code, and only install it if you understand what it does. | |
Semi-rant | |
######### | |
Pre-retirement, it was my in-house rule that all projects used virtualenv. It made it easier to `pip freeze > requirements.txt` | |
dependancies. Last thing I ever wanted to experience was having a "Oh my god everything is broken" call and spend an hour reverse |
View namap.py
""" | |
Features | |
-------- | |
A demonstration of some of the built-in Natural Earth features found | |
in cartopy. | |
modified from caropy examples/features.py | |
""" | |
__tags__ = ['Lines and polygons'] |
View run.js
'use strict'; | |
var express = require('express'), | |
app = express(), | |
http = require('http'), | |
server = http.createServer(app), | |
path = require('path'), | |
io = require('socket.io').listen(server), | |
fs = require('fs'), | |
zmq = require('zmq'), |
View annotated_abuse.py
""" | |
Command line output | |
================================= | |
Test with both arguments supplied | |
Handling call | |
Parameter name: always_int | |
Parameter name: always_str | |
Original position arguments: ('123',) | |
Original keyword arguments: {'always_str': 345} |
View knownpaths.py
import ctypes, sys | |
from ctypes import windll, wintypes | |
from uuid import UUID | |
class GUID(ctypes.Structure): # [1] | |
_fields_ = [ | |
("Data1", wintypes.DWORD), | |
("Data2", wintypes.WORD), | |
("Data3", wintypes.WORD), | |
("Data4", wintypes.BYTE * 8) |
NewerOlder