Skip to content

Instantly share code, notes, and snippets.

View placecodex's full-sized avatar

Maicol Romero placecodex

  • Dominican Republic
View GitHub Profile
@placecodex
placecodex / ethereum_token_ERC20_transaction.js
Created November 14, 2020 21:33
ethereum token transaction
// Dotenv javascript libraries needed
require('dotenv').config();
// Ethereum javascript libraries needed
var Web3 = require('web3');
var Tx = require('ethereumjs-tx');
// Rather than using a local copy of geth, interact with the ethereum blockchain via infura.io
// The key for infura.io is in .env
const web3 = new Web3(Web3.givenProvider || "https://ropsten.infura.io/" + process.env["INFURA_KEY"])
// Fixed-point notation for number of MFIL which is divisible to 3 decimal places
function financialMfil(numMfil) {
@placecodex
placecodex / curl_progress.php
Created September 28, 2019 02:12 — forked from stuudmuffin/curl_progress.php
PHP/cURL download progress monitoring
<?php
//output buffer
ob_start();
//create javascript progress bar
echo '<html><head>
<script type="text/javascript">
function updateProgress(percentage) {
document.getElementById(\'progress\').value = percentage;
}
@placecodex
placecodex / remote-file-copy.php
Created September 26, 2019 20:44 — forked from kongondo/remote-file-copy.php
Remote file copying with progress reporting in PHP.
<?php
/*
* Remote File Copy PHP Script 2.0.0
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/