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
/** | |
* Override getter and setter for the img DOM element | |
* so we could change it in our mocked interface | |
*/ | |
const createElement = document.createElement; | |
document.createElement = (...args) => { | |
const element = createElement.apply(document, args); | |
if (args[0] === 'img') { |
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
import config from './config/xmlhttprequest.config'; | |
const debug = require('debug')('app:xhr-mock'); | |
const XMLHttpRequest = window.XMLHttpRequest; | |
/** | |
* Retrieve the mock corresponding to the method / url couple | |
* | |
* @param {string} method | |
* @param {string} url |
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
# Add multimedia source | |
echo "deb http://http.us.debian.org/debian sid main non-free contrib" >> /etc/apt/sources.list | |
echo "deb-src http://http.us.debian.org/debian sid main non-free contrib" >> /etc/apt/sources.list | |
apt-get update | |
# Go to local source directory | |
cd /tmp | |
# Become root | |
su - |
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
var serialport = require('node-serialport') | |
var sp = new serialport.SerialPort("/dev/ttyO3", { | |
parser: serialport.parsers.raw, | |
baud: 9600 | |
}) | |
sp.on('data', function(chunk) { | |
console.log(chunk.toString('hex'), chunk.toString(), chunk) | |
}) |