Skip to content

Instantly share code, notes, and snippets.

View Kentzo's full-sized avatar
🤖

Ilya Kulakov Kentzo

🤖
View GitHub Profile
@Kentzo
Kentzo / WaiterModel.json
Created October 12, 2017 04:44
Customizing botocore Waiters
# botocore/data/ec2/2016-11-15/waiters-2.json
"VolumeInUse": {
"delay": 15,
"operation": "DescribeVolumes",
"maxAttempts": 40,
"acceptors": [
{
"expected": "in-use",
"matcher": "pathAll",
"state": "success",
"Checks": [
{
"Node": "a912cc296ceb",
"CheckID": "serfHealth",
"Name": "Serf Health Status",
"Status": "critical",
"Notes": "",
"Output": "Agent not live or unreachable",
"ServiceID": "",
"ServiceName": "",
gst-launch-1.0 videotestsrc pattern=4 !
video/x-raw,format=I420,width=640,height=480,framerate=25/1 !
tcpclientsink host=127.0.0.1 port=4242
gst-launch-1.0 tcpserversrc host=127.0.0.1 port=4242 !
video/x-raw,format=I420,width=640,height=480,framerate=25/1 !
videoconvert !
video/x-raw,format=YV12 !
fakesink
@Kentzo
Kentzo / Example.sh
Last active January 23, 2023 16:07
Customize session restoration in Terminal.app for ZSH
# E.g. to restore Python's virtualenv
function shell_session_save_user_state() {
echo "function restore_session() {" >> ${SHELL_SESSION_FILE}
if [[ -n ${VIRTUAL_ENV} ]]; then
echo source \"${VIRTUAL_ENV}\"/bin/activate >> ${SHELL_SESSION_FILE}
fi
echo "}" >> $SHELL_SESSION_FILE
def read_globals():
if <handling exception>:
<read globals from exception's traceback>
else:
<read globals from globals()>
read_globals()
def unhandled_exception(...):
@Kentzo
Kentzo / main.cpp
Last active February 24, 2016 08:18
MSVC Bug?
#include "shared-header.h"
#include <iostream>
int main()
{
std::cout << "one: " << one::func() << " two: " << two::func() << std::endl;
return 0;
}
VirtualBox VM 5.0.14 r105127 darwin.amd64 (Jan 19 2016 17:52:59) release log
00:00:02.375413 Log opened 2016-02-08T16:29:36.173230000Z
00:00:02.375414 Build Type: release
00:00:02.375427 OS Product: Darwin
00:00:02.375431 OS Release: 14.5.0
00:00:02.375436 OS Version: Darwin Kernel Version 14.5.0: Wed Jul 29 02:26:53 PDT 2015; root:xnu-2782.40.9~1/RELEASE_X86_64
00:00:02.375534 DMI Product Name: MacBookPro12,1
00:00:02.375574 DMI Product Version: 1.0
00:00:02.375581 Host RAM: 16384MB total, 4866MB available
00:00:02.375582 Executable: /Applications/VirtualBox.app/Contents/MacOS/VirtualBoxVM
:/argparse.py, line 2371, in exit
:/argparse.py, line 2364, in _print_message
// Python
import ctypes
class C(ctypes.Structure):
_fields_ = [
('a', ctypes.c_double),
('b', ctypes.c_double)
my_library.f.argtypes = [ctypes.POINTER(C)]
C c
@Kentzo
Kentzo / pyqt.patch
Created September 13, 2015 03:57
PyQt 5.4 / 5.5 fix for debug builds
--- configure.py
+++ configure.py
@@ -853,6 +853,10 @@
if opts.qmakespec is not None:
self.qmake_spec = opts.qmakespec
+ if opts.debug:
+ self.debug = True
+
+