A rather dirty way to patch module code at runtime.
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
Java.perform(function(){ | |
let ThreadDef = Java.use('java.lang.Thread'); | |
let ThreadObj = ThreadDef.$new(); | |
function stackTrace() { | |
console.log('------------START STACK---------------') | |
let stack = ThreadObj.currentThread().getStackTrace(); | |
for (let i = 0; i < stack.length; i++) { | |
console.log(i + ' => ' + stack[i].toString()); | |
} | |
console.log('------------END STACK---------------'); |
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
# taken from http://raspberrypihell.blogspot.pt/2013/07/pyaudio-and-how-to-install.html | |
sudo apt-get install git | |
sudo git clone http://people.csail.mit.edu/hubert/git/pyaudio.git | |
sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev | |
sudo apt-get install python-dev | |
cd pyaudio | |
sudo python setup.py 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
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |