This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import re | |
rule_regex = re.compile(r'^{$.*?^}$', re.DOTALL | re.MULTILINE) | |
def filter_suppressions(input_file, output_file): | |
''' | |
Takes the output of Valgrind, run with `--gen-suppressions=all` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
import os | |
import re | |
workspace_path = os.environ['HOME'] + '/nsight-workspace' | |
plugin_name = 'org.eclipse.cdt.ui' | |
target_width = 800 | |
target_height = 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env python3 | |
""" | |
Motivation: | |
I made a mirror of a third-party repository in Phabricator to keep track | |
of changes in specific files using Owners. I'm still trying this workflow, | |
and I still have some issues with it that might need patching Phabricator | |
to solve, so I'm not sure I recommend doing this. | |
Anyway, importing the repository to Diffusion created a few hundred |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
This is an installation/uninstallation utility for integrating | |
unpackaged software, i.e. that distributed as an archive rather than | |
a deb-package or an installation script, into the user's ~/.local/ | |
directory structure, provided that the application still follows | |
the standard directory structure (with "bin", "share", etc.). | |
Installation is performed in the form of symbolic links, i.e. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Ctrl+Win+Down - minimize active window | |
^#Down:: WinMinimize, A | |
; Ctrl+Win+Space - toggle Always On Top for the active window | |
^#Space:: Winset, Alwaysontop, , A | |
; Left "Shift" extender | |
SC056:: LShift | |
; Alt+Ctrl+M - Context Menu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ipyparallel as ipp | |
import types | |
ipp_client = ipp.Client() | |
ipp_direct = ipp_client[:] | |
def push_functions(): | |
functions = {name: val | |
for name, val in globals().items() | |
if type(val) == types.FunctionType and val.__module__ == '__main__'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import h5py | |
import numpy as np | |
def convert_item(item, file): | |
cls = item.attrs['MATLAB_class'].decode('utf-8') | |
if cls == 'char': | |
return ''.join(map(chr, item)) | |
elif cls == 'uint8': | |
return np.array(item, dtype=np.uint8) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias git-tree="git log --graph --full-history --all --color --pretty=format:\"%x1b[31m%h%x09%x1b[32m%d%x1b[0m%x20%s\"" | |
alias beep="echo -ne '\007'" | |
alias apt-install="sudo apt install $@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Set prefix to Ctrl+A | |
unbind C-b | |
set -g prefix C-a | |
bind C-a send-prefix | |
# Enable mouse interaction (for tmux version >= 2.1): | |
# select and resize panes, copy text and change window using the status line | |
set-option -g mouse on | |
# Scroll History |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from time import time | |
class FpsCounter(object): | |
def __init__(self, period=1, period_in_seconds=True): | |
self.frame_counter = None | |
self.interval_start = None | |
self.period = period | |
self.period_in_seconds = period_in_seconds | |
self.total_seconds = 0 | |
self.average = 0 |
NewerOlder