Skip to content

Instantly share code, notes, and snippets.

@jasonbot
jasonbot / textmetrics.py
Created January 31, 2012 21:50
Get the width and height (in inches) of a string using the Win32 CTypes APIs.
import ctypes
import ctypes.wintypes
class Constants(object):
"Container for constants found in win32 headers"
WS_OVERLAPPED = 0x00000000L
WS_POPUP = 0x80000000L
WS_CHILD = 0x40000000L
WS_MINIMIZE = 0x20000000L
WS_VISIBLE = 0x10000000L
@spiwn
spiwn / README.txt
Created February 21, 2012 13:50
A simple python utility to change a process' priority
A very simple script to change a process' priority in native python 3.#
Works on Windows only (for now)
Todo:
Make it less hacky, more portable (should extract values from the api and use them instead of the hardcoded ones)
Add documentation
@ruedesign
ruedesign / thread.py
Last active July 29, 2023 22:12
Python thread sample with handling Ctrl-C
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys, time, threading, abc
from optparse import OptionParser
def parse_options():
parser = OptionParser()
parser.add_option("-t", action="store", type="int", dest="threadNum", default=1,
help="thread count [1]")
@umpirsky
umpirsky / A.markdown
Last active August 3, 2023 18:14 — forked from olivierlacan/An_example.markdown
Sublime Text Monokai Sidebar Theme.
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active March 1, 2025 00:22
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@hyg
hyg / gist:9c4afcd91fe24316cbf0
Created June 19, 2014 09:36
open browser in golang
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@chrisjmendez
chrisjmendez / StreamURI.md
Last active August 27, 2021 15:24
Triton Audio streams for Classical KUSC and Classical KDFC

Stream URL's for Classical KUSC and Classical KDFC

New URL Pattern:

http://[bit rate].[encoder format].[file format].[call letters].live

Old URL Pattern:

@teknoraver
teknoraver / unixhttpc.go
Last active November 7, 2024 14:29
HTTP over Unix domain sockets in golang
package main
import (
"context"
"flag"
"fmt"
"io"
"net"
"net/http"
"os"
@MarMed
MarMed / README.md
Last active February 7, 2025 15:10
Routing plex traffic through an SSH tunnel

Routing plex traffic through an SSH tunnel

This guide creates a reverse SSH tunnel to route all Plex server traffic through it.

Step 2 is done on the tunnel, all other steps are done on the plex server.

1. Setup SSH keys (if you already have key based authenthication setup skip to step 2)

On plex server:

@jerblack
jerblack / junk_remover.ps
Last active May 28, 2018 19:16
Removing built-in Windows 10 apps
Get-AppxPackage *3dbuilder* | Remove-AppxPackage
Get-AppxPackage *3DViewer* -AllUsers | Remove-AppxPackage
Get-AppxPackage *windowsalarms* | Remove-AppxPackage
Get-AppxPackage *windowscommunicationsapps* | Remove-AppxPackage
Get-AppxPackage *windowscamera* | Remove-AppxPackage
Get-AppxPackage *officehub* | Remove-AppxPackage
Get-AppxPackage *skypeapp* | Remove-AppxPackage
Get-AppxPackage *getstarted* | Remove-AppxPackage
Get-AppxPackage *gethelp* | Remove-AppxPackage
Get-AppxPackage *zunemusic* | Remove-AppxPackage