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 / bitcoin_to_satoshi.php
Last active April 11, 2021 23:18
bitcoin to satoshi php conversor
$btc = 0.00005; // amount
echo ($btc)*(pow(10, 8)); // bitcoin to satoshi
@placecodex
placecodex / duckdns.text
Created April 2, 2021 16:59
how make docker image duckdns updater
sudo docker create \
--name=duckdns \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/Madrid \
-e SUBDOMAINS=ejemplo1,ejemplo2 \
-e TOKEN=TOKEN HERE \
--restart unless-stopped \
linuxserver/duckdns
@placecodex
placecodex / static_ip_ubuntu.text
Created April 1, 2021 13:27
put static ip v4 ubuntu
sudo nano /etc/netplan/00-installer-config.yaml
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
@placecodex
placecodex / footer.html
Last active April 2, 2021 16:59
Footer at bottom
@placecodex
placecodex / docker-compose.yml
Created March 24, 2021 22:46
Nginx Proxy Manager restart: always
version: '3'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: always
ports:
- '80:80'
- '81:81'
- '443:443'
environment:
@placecodex
placecodex / get_ethBalance.php
Last active September 5, 2021 00:30
get balance ethereum php , guzzle, curl
try {
$url ='https://api.anyblock.tools/ethereum/ethereum/ropsten/rpc/ac-a196sasasd581576f/';
$client = new Https();
$opts = [
@placecodex
placecodex / index.php
Created February 18, 2021 22:13
obtener porcentaje de ganancia o perdida entre dos cantidades
public function obtenerPorcentaje($cantidad, $total) {
$porcentaje = ((float)$cantidad * 100) / $total; // Regla de tres
$porcentaje = round($porcentaje, 0); // Quitar los decimales
return $porcentaje;
}
@placecodex
placecodex / IndexController.php
Created February 18, 2021 21:01 — forked from juyal-ahmed/IndexController.php
Curl get request in Laravel controller with cache support.
<?php
namespace App\Http\Controllers;
class InfoController extends Controller
{
/*
*
* Checking if cache file exist
* @ param string $name cache file name
@placecodex
placecodex / Database
Created February 15, 2021 22:16 — forked from sabid/Database
Laravel + Jquery Ajax Country and City
CREATE TABLE `paises` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`nombre` varchar(50) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1;
CREATE TABLE `ciudades` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`pais_id` int(11) DEFAULT NULL,
`nombre` varchar(50) DEFAULT NULL,
@placecodex
placecodex / bitcoin_address_generator.js
Last active December 1, 2020 23:09
generate bitcoin address testnet o main
const bitcoin = require('bitcoinjs-lib');
const TestNet = bitcoin.networks.testnet;
let keyPair = bitcoin.ECPair.makeRandom({ network: TestNet });//testnet
//var keyPair = bitcoin.ECPair.makeRandom();//main
var publicKey = keyPair.publicKey
var { address } = bitcoin.payments.p2pkh({ pubkey: publicKey });
var privateKey = keyPair.toWIF();
console.log(address)