Skip to content

Instantly share code, notes, and snippets.

View aeroaks's full-sized avatar

Akshay Verma aeroaks

  • Netherlands
View GitHub Profile
@petarov
petarov / ArchLinux-USB-Powersave.md
Last active June 11, 2023 10:58
Arch Linux Hints and Tricks

Mouse and Keyboard power off

Do you use an usb mouse and keyboard and have laptop_mode installed under your Arch linux ? Then maybe you have the same problems as me - mouse and keyboard getting inactive every 2 seconds or so.

To solve this, go to /etc/laptop-mode/conf.d and copy usb-autosuspend.conf to /etc/laptop-mode/conf.d/board-specific. After that run lsusb and get the ID of the usb device you want, e.g., 093a:2500 .

Open the board-specific/usb-autosuspend.conf file and find the AUTOSUSPEND_USBID_BLACKLIST conf option. Put the desired usb IDs there. You might need to run sudo laptop_mode afterwards to reload the configs.

@dbridges
dbridges / CustomSortFilterProxyModel.py
Last active December 1, 2022 22:11
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.
@aortbals
aortbals / dispatch.py
Last active October 20, 2023 16:09
Synchronize two folders using python.
#! /usr/bin/python
# Dispatch - synchronize two folders
import os
import filecmp
import shutil
from stat import *
class Dispatch:
''' This class represents a synchronization object '''
@durden
durden / references.md
Last active September 11, 2017 18:17
References for Python Science apps talk from Pycon 2013, PyTexas 2013, and PyArkansas 2012
@mdornseif
mdornseif / osm_shortlink.py
Created May 26, 2013 13:40
Implementation of OpenStreetmap Shortlinks in Python
@kemitche
kemitche / simple_app.py
Last active July 25, 2023 16:12
reddit OAuth 2.0 Python Webserver Example
#!/usr/bin/env python
from flask import Flask, abort, request
from uuid import uuid4
import requests
import requests.auth
import urllib
CLIENT_ID = None # Fill this in with your client ID
CLIENT_SECRET = None # Fill this in with your client secret
REDIRECT_URI = "http://localhost:65010/reddit_callback"
@electronut
electronut / ldr.py
Created May 4, 2014 06:14
Display analog data from Arduino using Python (matplotlib animation)
"""
ldr.py
Display analog data from Arduino using Python (matplotlib)
Author: Mahesh Venkitachalam
Website: electronut.in
"""
import sys, serial, argparse
@maedoc
maedoc / pgcbar.py
Created July 2, 2014 14:08
PyQtGraph colorbar class
import numpy as np
import pyqtgraph as pg
class ColorBar(pg.GraphicsObject):
def __init__(self, cmap, width, height, ticks=None, tick_labels=None, label=None):
pg.GraphicsObject.__init__(self)
# handle args
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'design.ui'
#
# Created: Wed May 27 16:39:17 2015
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'threading_design.ui'
#
# Created: Thu Aug 6 13:47:18 2015
# by: PyQt4 UI code generator 4.10.4
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui