Skip to content

Instantly share code, notes, and snippets.

@luelista
luelista / git-jetbrains-nav.user.js
Created February 5, 2024 09:49
github/gitlab jetbrains nav (click on the "Raw" button to install)
// ==UserScript==
// @name github/gitlab jetbrains nav
// @author Mira
// @version 1
// @grant GM.xmlHttpRequest
// @match https://github.com/*
// @match https://gitlab.com/*
// ==/UserScript==
/***********************************************************************
@luelista
luelista / collect_notifications.sh
Last active November 6, 2023 01:15
Scripts to fetch mastodon notification data and put in local SQLite, for further analysis
# run repeatedly until you have collected enough notifications
curl -H "authorization: Bearer $MASTODON_TOKEN" "https://$MASTODON_HOST/api/v1/notifications?limit=30&max_id=$(sqlite3 mastodon.db 'select min(nid) from noti;' || echo 0)" \
| jq '.[] | {nid:.id,type,created_at,user:.account.username,sid:.status.id,content:.status.content}' \
| dumptodb --db mastodon.db --table noti --key nid
@luelista
luelista / monty.py
Created February 26, 2023 15:16
Monty Hall Problem
#!/usr/bin/env python3
import random
import sys
class GameMasterStrategy:
def step1(self):
self.doors = [1,2,3]
self._correctDoor = random.choice(self.doors)
return self.doors
@luelista
luelista / simpletest.py
Last active May 2, 2022 20:00
Test for Qt-Ads bug
import sys
from PyQt5.QtWidgets import QApplication, QMainWindow, QTextEdit, QLabel
from PyQt5.QtCore import Qt
from PyQtAds import ads
def makewindow(name):
txt = QTextEdit()
THE LOW-DOWN ON LOADALL:
EXCERPTS FROM THE BOOK
THE HYPER-SPACE NAVIGATOR'S GUIDE
by
Terrance E. Hodgins
copyright (C) 1990 by Terrance E. Hodgins,
All rights reserved.
@luelista
luelista / dino.rb
Last active August 30, 2020 18:26
Homebrew formula for dino.im XMPP client
class Dino < Formula
desc "Modern Jabber/XMPP Client using GTK+/Vala "
homepage "https://dino.im"
## TODO: This is not really a version, but a dummy that's not going to work.
# url "https://github.com/dino/dino/archive/0.0.tar.gz"
# sha256 "a951b50559671ab30e74304ddc66c943405c8ad1bcbe4d77bef647a081fd0dbb"
head do
url "https://github.com/dino/dino.git"
@luelista
luelista / show_downloadable.sh
Last active July 24, 2020 12:15
List and update the download URL of all downloadable files of virtual products in a WooCommerce installation
(wp post list --post_type=product_variation --meta_key=_downloadable_files --fields=ID | tail -n +2;
wp post list --post_type=product --meta_key=_downloadable_files --fields=ID | tail -n +2) | (
while read ID; do wp post meta get $ID _downloadable_files ; done)
@luelista
luelista / change_wallpaper
Last active November 24, 2019 05:02
Use the recent "Astronomy Picture of the Day" by NASA as your desktop wallpaper (Python script for Mac OS X, should be easy do adapt for Linux or Windows)
#!/usr/bin/python
# Downloads the current "Astronomy Picture of the Day" from nasa.gov and sets as wallpaper
#
# Installation steps:
# - store this file somewhere and take note of the path
# - change WALLPAPER_DIR to some folder in your home directory
# and create the folder
# - make it executable:
# chmod a+x /path/to/change_wallpaper
# - follow instructions given in the .plist file to make it run daily
// library: Infrared
// Sends Rc5 0/1 twice with different toggle values.
// Turns e.g. a Philips TV to channel 11.
#include <Rc5Renderer.h>
#include <IrSenderNonMod.h>
static IrSenderNonMod sender(3);
IrSignal *signal ;
@luelista
luelista / jpeg2kml.pl
Last active May 5, 2019 01:16
Extracts GPS location data from JPEG EXIF and creates a KMZ file with thumbnails. Info and Howto here: http://home.max-weller.de/perl/jpeg2kml/
#!/usr/bin/perl
# jpeg2kml.pl
# Extracts GPS location data from JPEG EXIF and creates a KMZ file with thumbnails
# http://home.max-weller.de/perl/jpeg2kml/
use strict;
use Image::ExifTool qw(:Public);
use File::Basename;
use File::Copy;
use Data::Dumper;