Skip to content

Instantly share code, notes, and snippets.

View tmarki's full-sized avatar
🐢

Tamas Marki tmarki

🐢
View GitHub Profile
@tmarki
tmarki / cosmosdb_bulk_delete_by_query.py
Created May 15, 2024 22:21
Bulk delete items from a CosmosDB container by query (cross partition key)
from azure.cosmos import CosmosClient
url = "YOUR_DB_URL"
key = "YOUR_DB_KEY"
database = "YOUR_DB_NAME"
container = "YOUR_CONTAINER"
query = input("Please input the query:")
# For example:
@tmarki
tmarki / uno.py
Created January 13, 2022 04:24
IRC Uno bot for Phenny
"""
Copyright 2010 Tamas Marki. All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are
permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of
conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list
@tmarki
tmarki / keepdark.sh
Last active October 29, 2020 17:18
Keep built-in MacBook monitor off when an external display is connected
#!/bin/zsh
# Keep internal Macbook monitor off when an external monitor is connected
# Requires https://formulae.brew.sh/formula/brightness
while true
do
if [[ `brightness -l 2>/dev/null|grep 'display 1'` ]]
then
if [[ -z `brightness -l 2>/dev/null|grep 'display 1: brightness 0.000000'` ]]
then
brightness -d 1 0