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
C:\multiprocessing_unittest>python -m unittest discover | |
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81] | |
. | |
---------------------------------------------------------------------- | |
Ran 1 test in 0.219s | |
OK |
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
class Stream2Logger(object): | |
def __init__(self, stream, logger, level): | |
self._stream = stream | |
self._logger = logger | |
self._level = level | |
self._buffer = [] | |
def write(self, message): | |
self._buffer.append(message) |
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 python | |
# Linux usage: ./extract_tampermonkey_script.py "/home/<USER>/.config/<BROWSER>/Default/Local Extension Settings/<EXTENSION_ID>" | |
# i.e.: ./extract_tampermonkey_script.py "/home/foo/.config/google-chrome-beta/Default/Local Extension Settings/gcalenpjmijncebpfijmoaglllgpjagf" | |
# Mac usage: ./extract_tampermonkey_script.py "/Users/<USER>/Library/Application Support/Google/Chrome/Default/Local Extension Settings/<EXTENSION_ID>/" | |
# i.e.: ./extract_tampermonkey_script.py "/Users/foo/Library/Application Support/Google/Chrome/Default/Local Extension Settings/dhdgffkkebhmkfjojejmpbldmpobfkfo/" | |
import leveldb | |
import sys | |
import re |
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 python | |
# -*- coding: utf-8 -*- | |
import urllib2 | |
import sys | |
from datetime import datetime, timedelta | |
import os | |
import time |
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
npm ls -gp --depth=0 | awk -F/node_modules/ '{print $2}' | grep -v -e '^$' -e '^npm$' | xargs npm -g rm | |
sudo rm -rf /usr/local/lib/node_modules/ | |
sudo rm -rf /usr/local/include/node/ | |
sudo rm -rf /usr/local/bin/node | |
sudo rm -rf /usr/local/bin/npm | |
sudo rm -rf /usr/local/share/man/man*/node* | |
sudo rm -rf /usr/local/share/man/man*/npm* | |
sudo rm -rf /usr/local/lib/dtrace/node.d |
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
To create a new Device ID (and reset configuration) after cloning a VM with Syncthing, just remove the content of this folder: | |
- Unix-like: $HOME/.config/syncthing | |
- Mac: $HOME/Library/Application Support/Syncthing | |
- Windows XP: %AppData%/Syncthing | |
- Windows 7+: %LocalAppData%/Syncthing |