Skip to content

Instantly share code, notes, and snippets.

View jatubio's full-sized avatar

Juan Antonio Tubio jatubio

View GitHub Profile
@jatubio
jatubio / water.sol
Created September 17, 2022 07:42
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.7+commit.e28d00a7.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
//import Open Zepplins ERC-20 contract
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
//create a sample token that inherits Open Zepplins ERC-20 contract
contract WATER is ERC20 {
uint public amountAllowed = 1000000000000000000;
javascript:document.body.innerHTML='
<h1>Right-click Link Below To Open In Incognito Window</h1>
<img src="https://www.technojudo.com/wp-content/uploads/2019/03/Right-click-For-Incognito.jpg" alt="Right-click Link For Incognito Window">
<br>
<p><a href='+location.href+'>'+location.href+'</a></p>
<img src="http://technoju.do/3MAhv">
<p style="font-size:11px">&#169; 2019 Paul Luckett, <a href="http://technoju.do/4Nspl">TechnoJudo.com</a></p>';
@jatubio
jatubio / download.js
Created March 5, 2021 11:58
Download Google Drive protected/view only document
let jspdf = document.createElement("script");
jspdf.onload = function () {
let pdf = new jsPDF();
let elements = document.getElementsByTagName("img");
for (let i in elements) {
let img = elements[i];
console.log("add img ", img);
if (!/^blob:/.test(img.src)) {
console.log("invalid src");
continue;
@jatubio
jatubio / diffminutes.php
Created June 4, 2018 15:07
Sample of difference on minutes between two hours on PHP
<?php
function diffMins($ihour, $imin, $ehour, $emin)
{
if($ehour>=$ihour)
{
$hours=$ehour-$ihour;
}
else
{
@jatubio
jatubio / subminutes.php
Created June 4, 2018 12:05
Sample of subtract minutes to hours on PHP
<?php
function subMins($ihour, $imin, $iminutes)
{
$hours=floor($iminutes/60);
$mins=$iminutes%60;
echo("Se restan $hours h + $mins m\n");
$rhours=$ihour-$hours;
@jatubio
jatubio / summinutes.php
Last active June 4, 2018 12:08
Sample of sum minutes to hours on PHP
<?php
function sumMins($ihour, $imin, $iminutes)
{
$hours=floor($iminutes/60);
$mins=$iminutes%60;
echo("Se suman $hours h + $mins m\n");
$rhours=$ihour+$hours;
@jatubio
jatubio / readable_random_string.php
Created March 3, 2017 00:28 — forked from sepehr/readable_random_string.php
PHP: Human-readable Random String
<?php
/**
* Generates human-readable string.
*
* @param string $length Desired length of random string.
*
* retuen string Random string.
*/
function readable_random_string($length = 6)
@jatubio
jatubio / cherrypick_interactive
Created June 27, 2015 18:43
Special git cherry-pick with a git rebase interactive
#!/bin/bash
# Author: Juan Antonio Tubio <jatubio@gmail.com>
# GitHub: https://github.com/jatubio
# Twitter: @jatubio
#
#
# Special git cherry-pick with a git rebase interactive
# To use on branch with the last-commit
#
@jatubio
jatubio / cloneln.bat
Last active August 29, 2015 14:23
Clone source to destination using ln.exe
@echo off
setlocal enabledelayedexpansion
setlocal
set DestinationDrive=Z
set includeDir=
goto :include
:main
@jatubio
jatubio / commit-message-template.txt
Last active February 18, 2024 19:03 — forked from Linell/.git-commit-template.txt
Git commit template for laravel projects
# Type(<scope>): <subject>
# Type: core, feat, fix, docs, style, refactor, test, chore, git, merge, composer
# Git Operations (Prefix with): Cherry-Pick To Develop: <cpd!>, Squash|Fixup|Skip|Split: <squash!|fixup!|skip!|split!>, Temp: <tmp!|temp!>
# For Cherry-Pick (Prefix with): cpick(<branch>)
# Scope: controllers, models, repositories
# Subject: (This commit) <verb: 'add, fix, delete, modify'> subject
# <body>