Skip to content

Instantly share code, notes, and snippets.

mak@localhost:~/dev/coala (sils/printcol) +1 ~0 -0 $ ./run_tests.py
1/81 | ApplyPatchActionTest
2/81 | BearRunningTest
3/81 | BearTest
4/81 | BuildDbusServiceTest
5/81 | BuildManPageTest
6/81 | ClangASTPrintBearTest
7/81 | ClangCloneDetectionBearTest
8/81 | ClangCountingConditionsTest
9/81 | ClangCountVectorCreatorTest
@Makman2
Makman2 / ctype_async_raise.py
Last active August 31, 2015 00:55 — forked from liuw/ctype_async_raise.py
Nasty hack to raise exception for other threads
#!/usr/bin/env python
# liuw
# Nasty hack to raise exception for other threads
import ctypes # Calm down, this has become standard library since 2.5
import threading
import time
NULL = 0
@Makman2
Makman2 / test_each.sh
Last active July 25, 2017 20:39
Allows to invoke a test-step for each commit made.
#!/bin/bash
set -e
# The test invocation.
function test_step {
echo "Updating setup.cfg..."
sed -i -e "s/ --cov//g" setup.cfg
py.test -k core
git reset --hard
}
from multiprocessing import Process, Queue
from time import sleep
import os
import ctypes
import sys
import platform
# WINDOWS ONLY!!!
@Makman2
Makman2 / process-interrupter.py
Created August 2, 2015 22:10
How to interrupt a process correctly in windows so catch and finally get executed.
from multiprocessing import Process, Queue
from time import sleep
import ctypes
# WINDOWS ONLY!!!
def interrupt_process(pid):
CTRL_C_EVENT = 0x0
ctypes.windll.kernel32.GenerateConsoleCtrlEvent(CTRL_C_EVENT, pid)
# DON'T USE THIS!!! THIS WON'T WORK AND GENERATES A COMPLETELY DIFFERENT
@Makman2
Makman2 / regex_proto.py
Last active August 29, 2015 14:16
regex_proto.py
import re
# Just a forwarding method for re.split(), that splits unescaped.
# NOTE: If max_split it a number above 0, unescaped_split() appends the
# remaining unprocessed string to the result list!
def unescaped_split(pattern,
string,
max_split = 0,
remove_empty_matches = False):
match = re.split(pattern, string, max_split)
sed -i 's/\s\+$//' `find CE3D -name "*.cpp";find CE3D -name "*.h"`