This file contains hidden or 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 -*- | |
""" | |
Created on Thu Jul 11 23:06:53 2013 | |
@author: chipolux | |
""" | |
import json | |
import urllib2 | |
import threading | |
import Queue |
This file contains hidden or 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
INSTRUMENTS = filter(lambda x: x, map(str.strip, """ | |
Flow %d (bpd) | |
Target Flow (bpd) | |
Intake (psi) | |
Discharge (psi) | |
Pressure (psi, ft) | |
Torque %d (ft lbf) | |
Power (hp) | |
Speed (rpm) | |
Temperature (F) |
This file contains hidden or 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/ruby | |
# Create display override file to force Mac OS X to use RGB mode for Display | |
# see http://embdev.net/topic/284710 | |
require 'base64' | |
data=`ioreg -l -d0 -w 0 -r -c AppleDisplay` | |
edids=data.scan(/IODisplayEDID.*?<([a-z0-9]+)>/i).flatten | |
vendorids=data.scan(/DisplayVendorID.*?([0-9]+)/i).flatten |
This file contains hidden or 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 sys | |
from PyQt5.QtWidgets import ( | |
QApplication, | |
QFormLayout, | |
QGridLayout, | |
QLabel, | |
QScrollArea, | |
QScroller, | |
QWidget, |
This file contains hidden or 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
class MdlTestData(SqlSyncTableModel): | |
TABLE_NAME = "TestData" | |
def __init__(self, parent=None): | |
super(MdlTestData, self).__init__(parent) | |
self.setSort(self.ixPointNo, Qt.AscendingOrder) | |
self.setHeaderData(self.ixTemperature, Qt.Horizontal, "Temperature") | |
self.setHeaderData(self.ixTime , Qt.Horizontal, "Time") | |
self.setHeaderData(self.ixVoltsAB , Qt.Horizontal, "Volts AB") |
This file contains hidden or 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
nakyle at lnakyle-work in ~/Projects/manufacturing-kiosk (time-routing●●) | |
$ mkvirtualenv test-fdb -p python3 | |
Running virtualenv with interpreter /usr/local/bin/python3 | |
Using base prefix /usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5 | |
New python executable in test-fdb/bin/python3.5 | |
Also creating executable in test-fdb/bin/python | |
Installing setuptools, pip, wheel...done. | |
virtualenvwrapper.user_scripts creating /Users/nakyle/.virtualenvs/test-fdb/bin/predeactivate | |
virtualenvwrapper.user_scripts creating /Users/nakyle/.virtualenvs/test-fdb/bin/postdeactivate | |
virtualenvwrapper.user_scripts creating /Users/nakyle/.virtualenvs/test-fdb/bin/preactivate |
This file contains hidden or 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 PyQt5.QtWidgets import QDialog, QGridLayout, QLabel, QPushButton | |
from PyQt5.QtNetwork import QNetworkInterface, QAbstractSocket | |
class NetworkInfoDialog(QDialog): | |
def __init__(self, parent=None): | |
super().__init__(parent) | |
self.setWindowTitle('Network Interface Info') | |
layout = QGridLayout(self) | |
for i, interface in enumerate(self.get_interfaces()): |
This file contains hidden or 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 sys | |
from PyQt5.QtCore import QUrl | |
from PyQt5.QtGui import QGuiApplication | |
from PyQt5.QtQuick import QQuickView | |
app = QGuiApplication(sys.argv) | |
view = QQuickView() | |
view.setSource(QUrl('./test.qml')) |
This file contains hidden or 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
# A simple example of using a QTimer to create a debounce on a line edit. | |
# For things like search fields, etc. | |
from PyQt5.QtCore import QTimer | |
from PyQt5.QtWidgets import QWidget, QLineEdit, QApplication, QVBoxLayout | |
class Widget(QWidget): | |
def __init__(self, parent=None): | |
super().__init__(parent) |
This file contains hidden or 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
def get_window_id(name): | |
import Xlib.display | |
d = Xlib.display.Display() | |
r = d.screen().root | |
window_ids = r.get_full_property( | |
d.intern_atom('_NET_CLIENT_LIST'), Xlib.X.AnyPropertyType | |
).value |
OlderNewer