Skip to content

Instantly share code, notes, and snippets.

@qpxu007
qpxu007 / index.html
Created January 21, 2021 01:49 — forked from mphuie/index.html
pyqt webview javascript -> python example
<html>
<head>
<script src="qrc:///qtwebchannel/qwebchannel.js"></script>
<style>
::selection {
background:transparent;
}
</style>
</head>
@qpxu007
qpxu007 / CustomSortFilterProxyModel.py
Created January 5, 2021 01:51 — forked from dbridges/CustomSortFilterProxyModel.py
A subclass of QSortFilterProxyModel that implements custom filtering, especially useful for multicolumn filtering.
from PySide import QtGui
class CustomSortFilterProxyModel(QtGui.QSortFilterProxyModel):
"""
Implements a QSortFilterProxyModel that allows for custom
filtering. Add new filter functions using addFilterFunction().
New functions should accept two arguments, the column to be
filtered and the currently set filter string, and should
return True to accept the row, False otherwise.
@qpxu007
qpxu007 / pyqt threading example.py
Created December 31, 2020 22:58 — forked from blakebjorn/pyqt threading example.py
PySide/PyQT non-blocking thread example
from PySide import QtCore, QtGui
import sys
import time
class MainWindow(QtGui.QMainWindow):
def __init__(self, parent=None):
super(MainWindow, self).__init__(parent)
#Build a UI
self.myLayout = QtGui.QVBoxLayout()
self.myCentralWidget = QtGui.QWidget()
@qpxu007
qpxu007 / DataFrameGUI.py
Created December 25, 2020 00:56 — forked from jsexauer/DataFrameGUI.py
A sophisticated GUI to interact with DataFrame objects
"""
DataFrameTable
==============
Quick and Dirty Qt app to view pandas DataFrames. Includes sorting and
filterting.
Based on qtpandas in pandas sandbox module, by Jev Kuznetsov
Usage:
@qpxu007
qpxu007 / git.migrate
Created December 23, 2020 02:53 — forked from niksumeiko/git.migrate
Moving git repository and all its branches, tags to a new remote repository keeping commits history
#!/bin/bash
# Sometimes you need to move your existing git repository
# to a new remote repository (/new remote origin).
# Here are a simple and quick steps that does exactly this.
#
# Let's assume we call "old repo" the repository you wish
# to move, and "new repo" the one you wish to move to.
#
### Step 1. Make sure you have a local copy of all "old repo"
### branches and tags.
@qpxu007
qpxu007 / checkbox.py
Created December 23, 2020 01:34 — forked from MarshallChris/checkbox.py
Python - PyQt & Pandas - Implement a Column of Check boxes in a table Problem updating state.
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 17 10:50:56 2013
@author: cmarshall
"""
import sip
sip.setapi('QString', 1)
sip.setapi('QVariant', 1)
@qpxu007
qpxu007 / checkbox.py
Created December 23, 2020 01:34 — forked from MarshallChris/checkbox.py
Python - PyQt & Pandas - Implement a Column of Check boxes in a table Problem updating state.
# -*- coding: utf-8 -*-
"""
Created on Wed Jul 17 10:50:56 2013
@author: cmarshall
"""
import sip
sip.setapi('QString', 1)
sip.setapi('QVariant', 1)
@qpxu007
qpxu007 / WSL2GUIXvnc-en.md
Created December 14, 2020 23:28 — forked from tdcosta100/WSL2GUIXvnc-en.md
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key components we need to install are tigervnc-standalone-server and systemd-genie.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working [WSL2](https://docs.microsoft.com/pt-br/windows/wsl/w

@qpxu007
qpxu007 / ec2-printconfig.py
Created October 9, 2015 20:37 — forked from ttddyy/ec2-printconfig.py
a python script to display ec2 name and ip address as ssh-config or hosts file.
#! /usr/bin/env python
import argparse
import os
import sys
import boto.ec2
def parse_args():
@qpxu007
qpxu007 / s3signurl.py
Created September 28, 2015 23:07 — forked from manelclos/s3signurl.py
Quick, dirty Python script that spits out a signed url for Amazon S3
#!/usr/bin/env python
import optparse
import sys
import os
os.environ['S3_USE_SIGV4'] = 'True'
from boto.s3.connection import S3Connection
def sign(bucket, path, access_key, secret_key, https, expiry, host=None):