Skip to content

Instantly share code, notes, and snippets.

@iconara
iconara / queries.sql
Last active November 13, 2023 22:26
Low level Redshift cheat sheet
-- Table information like sortkeys, unsorted percentage
-- see http://docs.aws.amazon.com/redshift/latest/dg/r_SVV_TABLE_INFO.html
SELECT * FROM svv_table_info;
-- Table sizes in GB
SELECT t.name, COUNT(tbl) / 1000.0 AS gb
FROM (
SELECT DISTINCT datname, id, name
FROM stv_tbl_perm
JOIN pg_database ON pg_database.oid = db_id
@eestrada
eestrada / sqlite_regex.py
Last active February 28, 2025 07:31
How to do regular expressions in sqlite3 (using python).
#!/usr/bin/env python
"""How to do regular expressions in sqlite3 (using python)."""
from __future__ import division, absolute_import, print_function, unicode_literals
import re
import sys
import time
import datetime
import sqlite3
@mzizzi
mzizzi / x11_events.py
Created November 12, 2015 01:15
Subscribe to X11 PropertyChange events
"""
Subscribe to X11 PropertyChange events and print "Window Changed!" when a
_NET_ACTIVE_WINDOW property has been changed.
Unfortunately no event is received events when _NET_WM_NAME is changed so this
would only partially solve https://github.com/dictation-toolbox/aenea/issues/103
You'll have to `pip install python-xlib` to run this script.
(Tested with the Cinnamon 2.2.16 desktop)
;; Adapted from https://github.com/rurban/picat-lang/blob/master/picat-mode.el
;; mostly the same but this one works..
;;
(eval-when-compile
(require 'generic)
(require 'font-lock)
(require 'regexp-opt))
(defmacro picat-match-symbol (&rest symbols)
@keturn
keturn / pr-only-fork.sh
Last active March 8, 2026 04:11
Document git fork as "Pull-Request Only"
#!/bin/bash
# Replace the repo's default branch with a README explaining this fork is only for its submitted pull requests.
set -e -x -o pipefail
REMOTE=origin
GH_USERNAME="${GH_USERNAME:-$USER}"
TRUNK="$(git symbolic-ref --short refs/remotes/$REMOTE/HEAD | sed "s:${REMOTE}/::")"
REMOTE_URL="$(git remote get-url $REMOTE)"
@eggplants
eggplants / ALT-SH.md
Last active March 31, 2026 03:50
List of alternative shell-scripting languages (or shells)

Alternative shell-scripting languages (or shells)

  • sorted by repo name [a-z]

amirbawab/BashClass

BashClass is an Object Oriented Programming language that compiles to BASH 4.4

@keturn
keturn / SpyingOutputObjectStream.java
Last active May 18, 2022 03:01
Java: Get a lambda's parameter types
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.Serializable;
import java.lang.invoke.MethodType;
import java.lang.invoke.SerializedLambda;
import java.lang.reflect.Method;
import java.security.AccessController;
import java.security.PrivilegedActionException;
@keturn
keturn / MethodHandleAdapters.java
Last active May 18, 2022 03:01
Java MethodHandle from SerializedLambda
import com.google.common.base.Throwables;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodHandleInfo;
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
import java.lang.invoke.SerializedLambda;
import java.security.AccessController;
import java.security.PrivilegedActionException;
import java.security.PrivilegedExceptionAction;

Hacking HY300 Pro+ Projector (720p)

Hello manufacturer. Good device. But software we want to customize. If you allow, we will buy more.

Despite being advertised as "4K 1080P", it really downscales those to 720P.

But for 28.50 EUR from Amazon Warehuose Germany in 2025, one can't exactly complain. https://www.amazon.de/dp/B0DSP74YQW

Chengdu Hotack Technology Co., Ltd. is the OEM?