Skip to content

Instantly share code, notes, and snippets.

@hyOzd
hyOzd / plotmatrix.cpp
Created July 24, 2018 17:56
qwt plot matrix zoomer integration
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
* Qwt Widget Library
* Copyright (C) 1997 Josef Wilgen
* Copyright (C) 2002 Uwe Rathmann
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the Qwt License, Version 1.0
*****************************************************************************/
// vim: expandtab
@hyOzd
hyOzd / 10-marble.conf
Created October 30, 2017 18:47
Logitech Trackman Marble trackball scroll wheel emulation configuration for Linux Mint, right small button is configured for wheel emulation
# place in : /usr/share/X11/xorg.conf.d/
Section "InputClass"
Identifier "Marble Mouse"
MatchProduct "Logitech USB Trackball"
Option "EmulateWheel" "true"
Option "EmulateWheelButton" "9"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection
@hyOzd
hyOzd / kicadmenuitem.py
Created February 17, 2017 12:43
an experiment to add menu items to kicad pcbnew via scripting
import wx
def showMacros(e):
print("heey")
def findPcbnewWindow():
windows = wx.GetTopLevelWindows()
title = "Pcbnew"
pcbnew = filter(lambda w: w.GetTitle() == title, windows)
if len(pcbnew) != 1:
<function name="new"
c:identifier="goo_canvas_rect_new"
introspectable="0">
<doc xml:space="preserve">Creates a new rectangle item.
&lt;!--PARAMETERS--&gt;
Here's an example showing how to create a rectangle at (100,100) with a
width of 200 and a height of 100.
@hyOzd
hyOzd / sudo-this.el
Created August 25, 2016 09:29
emacs open this file as sudo
;; open this file in sudo
(defun sudo-this ()
"Open currently visited file as sudo!"
(interactive)
(if buffer-file-name
(let ((to-close (current-buffer)))
(find-file (s-concat "/sudo:root@localhost:" buffer-file-name))
(kill-buffer to-close))
(message "No file!")))
@hyOzd
hyOzd / pcbannotate.py
Created July 28, 2016 00:13
a version of my pcbannotate.py script that uses native api of kicad
# -*- coding: utf-8 -*-
#
# This script will re-annotate board companents according to their x,y
# positions and back-annotate those changes to schematic files.
#
# Make sure you have backups of all your files!
#
# Forked from https://github.com/cculpepper/kicad-python/blob/master/examples/pcbannotate.py
#
# You should run the script from inside pcbnew script console. After
@hyOzd
hyOzd / 99-sprutbrenner.rules
Created June 9, 2016 02:13
udev rules file for sprut brenner pic programmer which allows usburn to access to device without root permissions, no more sudo
# save this file in /etc/udev/rules.d/
SUBSYSTEM=="usb", ATTRS{idProduct}=="ff0b", ATTRS{idVendor}=="04d8", GROUP = "plugdev"
import cadquery as cq
from Helpers import show
BS = cq.selectors.BoxSelector
# PARAMETERS
mount_holes = True
# mold size
mw = 40
mh = 13
@hyOzd
hyOzd / reload_ext.sh
Last active January 21, 2024 01:08
Reload a cinnamon extension or applet from the command line. Useful during extension/applet development. Replace the EXTENSION_UUID at the end of the command with your extensions UUID.
# replace the EXTENSION_UUID with your extension/applet/desklet name
# replace the APPLET with other types if you are not working with an applet
dbus-send --session --dest=org.Cinnamon.LookingGlass --type=method_call /org/Cinnamon/LookingGlass org.Cinnamon.LookingGlass.ReloadExtension string:'EXTENSION_UUID' string:'APPLET'
@hyOzd
hyOzd / unfix-all-the-toolbars.user.js
Last active July 31, 2021 12:43 — forked from vbuaraujo/unfix-all-the-toolbars.user.js
GreaseMonkey script to remove "position: fixed" from webpages
// ==UserScript==
// @name unfix-all-the-toolbars
// @description Removes "position: fixed" style from elements, unfixing "toolbars" and the such.
// @namespace https://hasanyavuz.ozderya.net
// @include *
// @version 1
// @grant none
// ==/UserScript==