Skip to content

Instantly share code, notes, and snippets.

View theY4Kman's full-sized avatar

Zach Kanzler theY4Kman

View GitHub Profile
@theY4Kman
theY4Kman / requirements.txt
Last active February 20, 2024 23:15
Xfce4 panel plugin enabling easy switching between display profiles
pygobject
dbus-python
python-xlib
@theY4Kman
theY4Kman / pg-table-sizes.sql
Created October 15, 2023 06:03
Show sizes of all tables in the public schema, itemized for tablespace alone, indexes size, and TOAST size
-- Sizes of all tables in the public schema
SELECT
table_name AS "Table",
pg_size_pretty(table_size) AS "Table Size",
pg_size_pretty(indexes_size) AS "Indexes Size",
pg_size_pretty(toast_size) AS "Toast Size",
pg_size_pretty(total_size) AS "Total Size"
FROM (
SELECT
table_name,

Below are a list of the available Slack commands for Jukebot.

Command Description
/add track name Add a song to your Jukebot playlist
/album album name Search for an album
/artist artist name Search for an artist
/current playlist track
/delete Delete the currently playing track from your Jukebot playlist
/find track name Search for a track to add to your Jukebot playlist
@theY4Kman
theY4Kman / BranchChangedFileLocalLineStatusTracker.kt
Created May 27, 2023 07:52
Branch Changed Files line status tracker
package com.github.rewstapp.packauthoring.openapi.vcs.impl
import com.github.rewstapp.packauthoring.psi.search.scope.packageSet.BranchChangedFilesCustomScopesProvider
import com.github.rewstapp.packauthoring.settings.PackAuthoringSettings
import com.intellij.diff.DiffApplicationSettings
import com.intellij.diff.DiffContentFactory
import com.intellij.diff.DiffManager
import com.intellij.diff.comparison.ByWord
import com.intellij.diff.comparison.ComparisonPolicy
import com.intellij.diff.contents.DiffContent
@theY4Kman
theY4Kman / django_ignore_mysql_warnings.py
Created March 11, 2014 16:49
Disables MySQL warnings in Django. I place it somewhere in my settings module. My use case is I develop on multiple branches, some with different database migrations, and I don't have a proper setup with a different database for each, so when I have to add a hotfix, MySQL sometimes complains about stupid shit. I don't really care about it, so I …
# Ignoring MySQL warnings, such as:
# "Field 'discount_id' doesn't have a default value"
IGNORE_MYSQL_WARNINGS = True
if IGNORE_MYSQL_WARNINGS:
_GOT_FIRST_REQUEST = False
def on_first_request(signal, sender):
global _GOT_FIRST_REQUEST
if not _GOT_FIRST_REQUEST:
_GOT_FIRST_REQUEST = True
@task
def perchy(c):
"""Perchy Print"""
perchy = '''\
*:::
*::::::
*::::::::::
*:::::::::::::
*:::::::::::::::
*::::::::::::::::::
from _typeshed import Incomplete
from collections.abc import Generator
from typing import Any, Generic, Type, TypeVar
from sqlalchemy.orm.query import Query
from sqlalchemy.orm.session import Session
from . import utils as utils
from .model import DefaultMeta as DefaultMeta, Model as Model
@theY4Kman
theY4Kman / convenient-pycharm-templates.md
Created November 8, 2017 03:36
A little write-up on some of the PyCharm Live Templates I use on a daily basis

Convenient PyCharm Live Templates

I find the real beauty of PyCharm to be its code insight. vim seems to be winning on the scripting side of things, but it looks like the JetBrains ecosystem made it economical to build deeply insightful and performant language tooling, enabling ways to navigate, produce, and refactor code – regardless of who wrote it – without waiting for an executable to start, or a plugin to be written, or a maintainer to patch the eighteen bugs affecting only others... in his pro bono, personal-use tool. And one day when JetBrains realizes the selling power of (or I get off my ass and embed) a scripting language for customization, shit's gon' explode.

Till then, PyCharm has a few semi-customizable features which make dev life easier. One of them is Live Templates, which are text templates which can either be expanded by typing an abbreviation and pressing tab; or by selecting some text, pressing Option+Command+T, autocompl

@theY4Kman
theY4Kman / Source.html
Created November 23, 2011 00:21
Trying to create a Facebook Like button after page load
<iframe src="http://widgets.awe.sm/v3/fblike_button?href=&send=true&data-layout=button_count&show_faces=false&font=verdana&awesm_key=c4e2cc2a143cd4741589587221017e476474399de7d50b21d73c78f20eaf45da&awesm_user_id_profile_url=http%3A%2F%2Fwww.styleseat.com%2Fp%2F32&awesm_user_id_username=they4kman%2Bcrapbag%40gmail.com&awesm_user_id_icon_url=http%3A%2F%2Fstatic.styleseat.com%2Fstatic%2Fuploads%2F2011%2F11%2F14%2F84eebd0d-c74_14_200x200.jpg&awesm_user_id=122" id="order-sharing-fb" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:24px;" allowTransparency="true"></iframe>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.