Skip to content

Instantly share code, notes, and snippets.

View ionelmc's full-sized avatar
🙃
wat

Ionel Cristian Mărieș ionelmc

🙃
wat
View GitHub Profile
@ionelmc
ionelmc / .gitignore
Last active October 22, 2023 01:47
ffmpeg-wz
*.exe
*.dll
doc
.idea

The reStructuredText Cheat Sheet: Syntax Reminders

Info

See <http://docutils.sf.net/rst.html> for introductory docs.

Author

David Goodger <goodger@python.org>

Date

$Date: 2013-02-20 01:10:53 +0000 (Wed, 20 Feb 2013) $

Revision

$Revision: 7612 $

Description

This is a "docinfo block", or bibliographic field list

Note

If you are reading this as HTML, please read

@ionelmc
ionelmc / .env-example
Last active August 26, 2022 07:56
multistream-obs
YOUTUBE_KEY=
FACEBOOK_KEY=
TWITCH_KEY=
TWITCH_HOST=live-fra05.twitch.tv
TROVO_KEY=
watch --difference=cummulative --interval=1 '(echo device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue; for file in /sys/block/*/stat; do echo -n $file; cat $file; done) | column -t'
# OUTPUTS:
#device read_IOs read_merges read_sectors read_ticks write_IOs write_merges write_sectors write_ticks in_flight io_ticks time_in_queue
#/sys/block/dm-0/stat 116962 0 2212746 314096 7705653 0 150218536 609670232 0 644428 610921004
#/sys/block/dm-1/stat 116479 0 2208882 313324 7686986 0 150218536 609676068 0 644616 611418072
#/sys/block/dm-2/stat 302 0 2416 780 0 0 0 0 0 148 780
#/sys/block/sda/stat 91181 26273 2217246 74876 7314854 388030 150261802 16954364
@ionelmc
ionelmc / vbox-shutdown.py
Last active July 26, 2021 13:42
VirtualBox automatic shutdown cleaner. Runs in the "notification icon area". When closed by windows it waits for VMs to shutdown (acpi) and if it doesn't work it tries to suspend the VMs.
import logging
import subprocess
import time
import sys
import win32con
import win32gui_struct
import os
try:
import winxpgui as win32gui
except ImportError:
from time import time
from hunter import Action
from hunter import trace
class ProfileAction(Action):
def __init__(self):
self.timings = {}
def __call__(self, event):
b = 1
def foo():
b = 2
class foo:
a = b
b = 3
return foo()
foo().a
@ionelmc
ionelmc / .gitignore
Last active February 12, 2020 09:26
A JSON parser benchmark. See README.rst for instructions.
*.cbor
*.log
*.xml
*.yaml
*.json
*.msgpack
*.html
*.marshal
*.pickle
.tox
>>> delta = datetime.timedelta(days=200)
>>> tz = pytz.timezone('Europe/Bucharest')
>>> datetime_dt = datetime.datetime(2019, 1, 1, tzinfo=tz)
>>> print('datetime.datetime(2019, 1, 1, tzinfo=tz):', datetime_dt.isoformat())
datetime.datetime(2019, 1, 1, tzinfo=tz): 2019-01-01T00:00:00+01:44
>>> datetime_dt = tz.localize(datetime.datetime(2019, 1, 1))
>>> print('tz.localize(datetime.datetime(2019, 1, 1)):', datetime_dt.isoformat())
tz.localize(datetime.datetime(2019, 1, 1)): 2019-01-01T00:00:00+02:00
>>>
>>> print('datetime + delta:', (datetime_dt + delta).isoformat())
@ionelmc
ionelmc / .gitignore
Last active June 16, 2019 10:15
Socat PPA (readline)
socat*