Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am asciimo on github.
  • I am asciimo (https://keybase.io/asciimo) on keybase.
  • I have a public key whose fingerprint is FBE8 BB07 9E6F 6107 04BF 7C9D 1249 F99B DCD2 A5BC

To claim this, I am signing this object:

@asciimo
asciimo / gist:8929680
Last active August 29, 2015 13:56
Shell Goodies
# Tunneling MySQL over SSH
ssh -fNg -L 3307:127.0.0.1:3306 [email protected]
mysql -h 127.0.0.1 -P 3307 -u dbuser -p db
@asciimo
asciimo / gist:7576426
Created November 21, 2013 05:16
Filtering a list of strings against a list of compiled regular expressions, in Python.
import re
patterns = [re.compile('one'), re.compile('two'), re.compile('three')]
strings = ['one', 'fudge', 'two', 'twenty', 'three', 'something']
# To collect the matches
[s for s in strings if any(p.match(s) for p in patterns)]
#Output: ['one', 'two', 'three']
# To colelct the non-matches
[s for s in strings if not any(p.match(s) for p in patterns)]
@asciimo
asciimo / getNexus.js
Created November 27, 2012 23:46
Fill your GooglePlay cart with Nexuses and drop this script in your Chrome console.
function simulateClick(element) {
var oEvent;
oEvent = document.createEvent("MouseEvents");
oEvent.initMouseEvent("click", true, true, document.defaultView);
element.dispatchEvent(oEvent);
return element;
}
var myButton = document.getElementsByClassName("buy-button-price")[1];
var myInterval = setInterval(function(){simulateClick(myButton)}, 2000);