Skip to content

Instantly share code, notes, and snippets.

View TurBoss's full-sized avatar

TurBoss TurBoss

  • Spain
View GitHub Profile
@astralaster
astralaster / Agon-Light-Mode-0-2-Colors.gpl
Created June 19, 2023 21:42
Agon Light Gimp Palettes
GIMP Palette
Name: Agon Light Mode 0, 2 colors
Columns: 0
#
0 0 0 Color 0
255 255 255 Color 1
@sekigon-gonnoc
sekigon-gonnoc / converter.py
Last active June 16, 2023 08:05
Bad Apple!! on OLED
import cv2
import numpy as np
import math
WIDTH=32
HEIGHT=24
def frame2array(frame):
img = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
img = cv2.resize(img, (WIDTH,HEIGHT))
@ednisley
ednisley / Kicad-to-HAL.py
Last active May 3, 2022 01:20
Python and Kicad library: Convert Kicad schematic netlist to LinuxCNC HAL machine configuration
# Parse Kicad schematic netlist into a LinuxCNC HAL configuration file
#
# Ed Nisley - KE4ZNU
# 2021-03
import argparse
from pathlib import Path
from lxml import etree
@clickwir
clickwir / cool.sh
Last active April 10, 2021 20:18 — forked from orhun/cool.sh
Random MOD player
#!/usr/bin/env bash
# Get a random music file from modarchive.org and play it.
# Uses VLC. Many other players could work too.
# Check for needed programs. Exit if they are not found.
#if ! which xmp > /dev/null; then echo "xmp not installed. Try: apt install xmp"; exit 1; fi
if ! which vlc > /dev/null; then echo "VLC not installed. Try: apt install vlc"; exit 1; fi
if ! which curl > /dev/null; then echo "curl not installed. Try: apt install curl"; exit 1; fi
# Check if the user wants a specific module
@orhun
orhun / cool.sh
Last active April 10, 2021 20:08
Random MOD player
#!/usr/bin/env bash
# Plays a random MOD file from https://modarchive.org
# Depends on XMP (http://xmp.sourceforge.net/)
# https://gist.github.com/orhun/eda9701e357b625c2bada19563872715
rand=$(shuf -i 1-189573 -n 1)
tmp=$(mktemp /tmp/${rand}.XXXXXXXX.mod)
curl https://modarchive.org/jsplayer.php?moduleid=${rand} > ${tmp}
xmp ${tmp}
rm ${tmp}
@adocampo
adocampo / mycroft.service
Created August 21, 2019 07:57
systemd unit file for mycroft service
# The file must be placed on /usr/lib/systemd/user/mycroft.service
# and need to be run as the user who owns the file permissions
# with the command systemctl --user start|enable mycroft.service
[Unit]
Description=Mycroft main service
After=network.target local-fs.target remote-fs.target
[Service]
Type=forking
RemainAfterExit=no
@jerobado
jerobado / sorting_qtableview.py
Created January 25, 2018 12:48
How to sort a QTableView?
# Applying a sort feature in a QTableView
import sys
from PyQt5.QtCore import (Qt,
QModelIndex,
QAbstractTableModel,
QSortFilterProxyModel)
from PyQt5.QtWidgets import (QApplication,
QTableView)
@KurtJacobson
KurtJacobson / building_pyqt5.md
Last active October 19, 2023 00:33
Building PyQt5 to support Python2 based QtDesigner Plugins

Building PyQt5 to support Python2 based QtDesigner Plugins

As far as I can tell, the reason Qt5 Designer does not load custom PyQt5 widgets is due to the 'stock' shared library libpyqt5.so (which comes with PyQt5) not being built for the correct combination of the Python and Qt versions. It seems the only way to get around this is to build PyQt5 from source so we will have a libpyqt5.so that is correct and will be able to load the custom widgets.

Install Python dev tools

@NicolasBizzozzero
NicolasBizzozzero / comprehensive_header.py
Last active July 16, 2024 18:59
Python template of a comprehensive header, with shebang, docstring, GPLv3 license and all metadata.
#!/usr/bin/env python
""" Short description of this Python module.
Longer description of this module.
This program is free software: you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation, either version 3 of the License, or (at your option) any later
version.
import sys
import time
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
from PyQt5 import QtCore
from PyQt5.QtCore import Qt
var = 0
f = ""
choiceStr = ""