Skip to content

Instantly share code, notes, and snippets.

View x746e's full-sized avatar

Kirill Spitsyn x746e

View GitHub Profile
@x746e
x746e / gist:a37e234b115619698a311087a5010434
Created February 22, 2021 19:30
exploring tmux hooks
set-hook -g client-attached "run-shell 'echo -e ''++++ #{hook}\\\\n client_name: #{client_name}\\\\n client_pid: #{client_pid}\\\\n client_session: #{client_session}\\\\n hook: #{hook}\\\\n hook_session: #{hook_session}\\\\n hook_session_name: #{hook_session_name}\\\\n host: #{host}\\\\n pid: #{pid}\\\\n session_group: #{session_group}\\\\n session_id: #{session_id}\\\\n session_name: #{session_name}\\\\n socket_path: #{socket_path}\\\\n'' >> /tmp/tmux.hooks.log'"
set-hook -g after-client-attached "run-shell 'echo -e ''++++ #{hook}\\\\n client_name: #{client_name}\\\\n client_pid: #{client_pid}\\\\n client_session: #{client_session}\\\\n hook: #{hook}\\\\n hook_session: #{hook_session}\\\\n hook_session_name: #{hook_session_name}\\\\n host: #{host}\\\\n pid: #{pid}\\\\n session_group: #{session_group}\\\\n session_id: #{session_id}\\\\n session_name: #{session_name}\\\\n socket_path: #{socket_path}\\\\n'' >> /tmp/tmux.hooks.log'"
set-hook -g client-detached "run-shell 'echo -e ''++++ #
ksp@ksp0 (venv-xdis-python3)~/src/python-xdis/pytest
% pytest ? master
========================================================================== test session starts ==========================================================================
platform linux -- Python 3.4.3, pytest-3.0.6, py-1.4.32, pluggy-0.4.0
rootdir: /usr/local/google/home/ksp/src/python-xdis, inifile:
collected 20 items
test_bytecode.py .
test_disasm.py ...
test_load.py .
% python setup.py test
running pytest
running egg_info
writing top-level names to xdis.egg-info/top_level.txt
writing xdis.egg-info/PKG-INFO
writing dependency_links to xdis.egg-info/dependency_links.txt
reading manifest file 'xdis.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'xdis.egg-info/SOURCES.txt'
running build_ext
% python setup.py test
running pytest
running egg_info
writing dependency_links to xdis.egg-info/dependency_links.txt
writing xdis.egg-info/PKG-INFO
writing top-level names to xdis.egg-info/top_level.txt
reading manifest file 'xdis.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'xdis.egg-info/SOURCES.txt'
running build_ext
# To print a str variable.
x/s ((PyStringObject*)str_var)->ob_sval
define ppstr
printf "%s\n", ((PyStringObject*)$arg0)->ob_sval
end
define ppr
printf "%s\n", ((PyStringObject*)PyObject_Repr($arg0))->ob_sval
end
@x746e
x746e / README.md
Created December 31, 2015 01:16 — forked from mbostock/.block
Curved Links

This variation of a force-directed graph uses intermediate nodes in links to create aesthetically-pleasing Bézier curves.

tn@debian ~/src % sudo apt-get install openjdk-7-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
ca-certificates-java dbus-x11 gconf-service gconf2 gconf2-common gnome-mime-data java-common libasound2 libasound2-data libasyncns0 libatk-wrapper-java libatk-wrapper-java-jni libavahi-glib1 libbonobo2-0
libbonobo2-common libcanberra0 libdbus-glib-1-2 libflac8 libgconf-2-4 libgconf2-4 libgif4 libgnome-2-0 libgnome2-0 libgnome2-bin libgnome2-common libgnomevfs2-0 libgnomevfs2-common libgnomevfs2-extra libltdl7
libnspr4 libnss3 libogg0 liborbit-2-0 libpulse0 libsctp1 libsndfile1 libtdb1 libvorbis0a libvorbisenc2 libvorbisfile3 libxtst6 lksctp-tools openjdk-7-jre-headless tzdata-java
Suggested packages:
gconf-defaults-service default-jre equivs libasound2-plugins alsa-utils libbonobo2-bin libcanberra-gtk0 libcanberra-pulse desktop-base libgnomevfs2-bin pulseaudio icedtea-7-plugin icedtea-7-jre-jamvm
diff --git a/ripdb/__init__.py b/ripdb/__init__.py
index 5c1df1d..ce24e7b 100644
--- a/ripdb/__init__.py
+++ b/ripdb/__init__.py
@@ -7,9 +7,12 @@ __version__ = "0.1.0"
import IPython.core.debugger as pdb
from IPython.utils import io
+import multiprocessing
+import os
@x746e
x746e / SimpleSemaphore.java
Last active August 29, 2015 14:02
Is using fair lock enough to make a fair semaphore?
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.Condition;
public class SimpleSemaphore {
private final ReentrantLock lock;
private final Condition permitsAvailable;
private int permits;
public SimpleSemaphore(int permits, boolean fair) {
this.lock = new ReentrantLock(fair);
@x746e
x746e / task.py
Last active December 27, 2015 01:49
import unittest
class MaybeCls:
def __repr__(self):
return 'Maybe'
Maybe = MaybeCls()
def pour(wall):