Skip to content

Instantly share code, notes, and snippets.

View whinee's full-sized avatar
👋
hello!

Lyra whinee

👋
hello!
  • Klik-A-Snap Photography Services
  • Philippines
  • 21:43 (UTC +08:00)
View GitHub Profile
@AntonSol919
AntonSol919 / audio-window-shift.py
Last active April 6, 2023 09:48
Balance audio left/right based on window location
import pulsectl
import gi
gi.require_version('Wnck', '3.0')
from gi.repository import Wnck, GLib
screen = Wnck.Screen.get_default()
screen.force_update()
width = screen.get_width()
pulse = pulsectl.Pulse('audio-window-shift')
sink = pulse.sink_list()[0]
@justfoolingaround
justfoolingaround / deaththread.py
Created April 11, 2022 12:23
Be able kill Python threads by installing a trace
import sys
import threading
class DeathThread(threading.Thread):
kill_state = threading.Event()
def run(self):
sys.settrace(self.global_trace)
Hi! Thank you for offering a PR for one of my open source libraries. I really
appreciate it, because in most cases, I have very little time to maintain them.
I often get PRs that lead to a back-and-forth between me and the contributor,
where I ask them to undo many of the changes they have made. To avoid this in
your case, or to at least give you an idea why I'm asking you to adapt your PR,
here are my criteria for accepting PRs.
Every PR should have one, and only one, unique goal. Your PR should make the
absolute minimum number of changes that are required to achieve this goal.
@mklement0
mklement0 / Out-HostColored.ps1
Last active July 3, 2024 06:19
PowerShell function that colors portions of the default host output that match given patterns.
<#
Prerequisites: PowerShell version 2 or above.
License: MIT
Author: Michael Klement <mklement0@gmail.com>
DOWNLOAD, from PowerShell version 3 or above:
irm https://gist.github.com/mklement0/243ea8297e7db0e1c03a67ce4b1e765d/raw/Out-HostColored.ps1 | iex
@pojda
pojda / example_image_utils.py
Last active July 7, 2024 16:44 — forked from josephkern/example_image_utils.py
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText
@Vap0r1ze
Vap0r1ze / discord_oauth2.md
Last active April 7, 2024 14:54
Discord OAuth2 Flow

Discord OAuth2

Step 1

You: Redirect User to https://discordapp.com/api/oauth2/authorize

Query Params
name value
client_id Your application's Client ID
scope A list of scopes, delimited by spaces
redirect_uri The uri to send the user after authorization
@fny
fny / GNU GPL.md
Created January 30, 2013 22:06
GNU General Public License in Markdown

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>

Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.

@turicas
turicas / example_image_utils.py
Created December 10, 2011 19:04
Layer on top of Python Imaging Library (PIL) to write text in images easily
#!/usr/bin/env python
# coding: utf-8
# You need PIL <http://www.pythonware.com/products/pil/> to run this script
# Download unifont.ttf from <http://unifoundry.com/unifont.html> (or use
# any TTF you have)
# Copyright 2011 Álvaro Justen [alvarojusten at gmail dot com]
# License: GPL <http://www.gnu.org/copyleft/gpl.html>
from image_utils import ImageText