Skip to content

Instantly share code, notes, and snippets.

@silvenon
silvenon / mocha-jsdom-test.js
Last active December 20, 2017 22:28
Mocha setup I use for testing React with jsdom.
import jsdom from 'jsdom';
import assert from 'assert';
describe('suite', () => {
let React, utils, Component;
before(() => {
global.document = jsdom.jsdom('<!DOCTYPE html><html><head></head><body></body></html>');
global.window = document.parentWindow;
global.navigator = {userAgent: 'node.js'};
@johntyree
johntyree / getBlockLists.sh
Last active June 4, 2024 12:30
Make one large blocklist from the bluetack lists on iblocklist.com
#!/usr/bin/env sh
# Download lists, unpack and filter, write to stdout
curl -s https://www.iblocklist.com/lists.php \
| sed -n "s/.*value='\(http:.*=bt_.*\)'.*/\1/p" \
| xargs wget -O - \
| gunzip \
| egrep -v '^#'
@phoboslab
phoboslab / mousemove.py
Created June 26, 2012 19:44
Python script to move the mouse cursor in windows with constant speed
import sys
import time
import win32api
if (len(sys.argv) < 4):
print "Usage: python mousemove.py dx dy speed"
sys.exit()
current = win32api.GetCursorPos()
cx = sx = current[0]