Skip to content

Instantly share code, notes, and snippets.

View juliancantillo's full-sized avatar
:octocat:

Julian Cantillo juliancantillo

:octocat:
View GitHub Profile
@juliancantillo
juliancantillo / otp.js
Last active September 19, 2019 21:01
A otp library took from internet. https://cdnjs.com/libraries/jsSHA
import JsSHA from 'jssha';
export default function getToken(key, period = 30, otp_length = 6) {
let epoch, time, shaObj, hmac, offset, otp;
key = base32tohex(key);
epoch = Math.round(Date.now() / 1000.0);
time = leftpad(dec2hex(Math.floor(epoch / period)), 16, '0');
shaObj = new JsSHA('SHA-1', 'HEX');
shaObj.setHMACKey(key, 'HEX');
shaObj.update(time);
import JsSHA from 'jssha';
export default function getToken(key, period = 30, otp_length = 6) {
let epoch, time, shaObj, hmac, offset, otp;
key = base32tohex(key);
epoch = Math.round(Date.now() / 1000.0);
time = leftpad(dec2hex(Math.floor(epoch / period)), 16, '0');
shaObj = new JsSHA('SHA-1', 'HEX');
shaObj.setHMACKey(key, 'HEX');
shaObj.update(time);
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>First Mockup</title>
<meta name="description" content="Mi primer página">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src="js/jquery-3.3.1.min.js"></script>

Keybase proof

I hereby claim:

  • I am juliancantillo on github.
  • I am juliancantillo (https://keybase.io/juliancantillo) on keybase.
  • I have a public key whose fingerprint is C5A6 7F8D B952 C680 BF21 88A3 FCE3 7E9F 4145 4963

To claim this, I am signing this object:

@juliancantillo
juliancantillo / eventos_example.html
Created September 27, 2016 02:42
Un ejemplo de eventos
<html>
<head>
</head>
<body>
<button id="btnEmisor">Llenar vaso</button>
<button id="btnVaciar">Vaciar vaso</button>
<div id="eventos">
</div>
@juliancantillo
juliancantillo / example_fr_security_flaw_2.html
Created September 22, 2016 21:39
Piece of data form Fincaraiz page
<!-- view-source:http://www.fincaraiz.com.co/apartamento-en-arriendo/bogota/cedritos_usaquen-det-2252109.aspx -->
<script>
var sfAdvert = {"AdvertId" : "2252109", "AdvertWASId" : "2252109", "AdvertExternalId" : "ARRI-20168972", "ClientId" : "28819", "ClientName" : "Inmobiliaria Bogotá S.A.S", "ClientURL" : "inmobiliaria-inmobiliaria-bogota-sas-28819.aspx", "AdvertCategoryId" : "2", "AdvertType" : "Used", "TransactionId" : "2", "TransactionType" : "Arriendo", "Category1Id" : "8", "Category2Id" : "0", "Category3Id" : "0", "Category1" : "Apartamento", "Category2" : "", "Category3" : "", "OriginId" : "23", "Location1Id" : "67", "Location2Id" : "3630001", "Location3Id" : "3630102", "Location4Id" : "0", "Location1" : "Cundinamarca", "Location2" : "Bogotá", "Location3" : "Zona Noroccidente", "Location4" : "", "Title" : "Apartamento en Arriendo - Bogotá Cedritos Usaquén", "Description" : "Exclusivo apartamento ubicado en el sector de Cedritos, a pocas cuadras de la avenida 9 y calle 140, cercano a parques y centro
@juliancantillo
juliancantillo / example_fr_security_flaw_1.html
Created September 22, 2016 21:36
Piece of data form Fincaraiz page
<!-- view-source:http://www.fincaraiz.com.co/apartamento-en-arriendo/bogota/cedritos_usaquen-det-2252109.aspx -->
<script type="text/javascript">
utag_data = JSON.parse('{"environment":"Prod","user_id":"28819","user_role_id":"1","user_role":"Particular","page_type":"AdView","page_type_id":"3","event_name":"AdView","ad_type_id":"2","ad_type":"Arriendo","ad_title":"Apartamento en Arriendo - Bogotá Cedritos Usaquén","ad_id":"2252109","ad_source_id":"2","neighborhood":"cedritos usaquen","region_level1":"Cundinamarca","region_level2":"Bogotá","region_level3":"Zona Noroccidente","region_level1_id":"67","region_level2_id":"3630001","region_level3_id":"3630102","category_level1":"Apartamento","category_level1_id":"8","action_type":"Navigation","client_type":"2","price":"2100000.0","num_pictures":"19","is_video":"true","admin_price":"381000","status":"0","stratum":"4","stratum_id":"0","features":"180,263,139","num_bathrooms":"2","seller_id":"28819","seller_name":"Inmobiliaria Bogotá S.A.S","rooms":"3","surface":"77.0
@juliancantillo
juliancantillo / nginx.conf
Created March 1, 2016 20:31 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@juliancantillo
juliancantillo / comment.php
Created January 29, 2016 21:51 — forked from Meroje/comment.php
TimeDiff For Humans
<?php
use Carbon\Carbon;
class Comment extends Eloquent {
protected $guarded = array();
protected $softDelete = true;
public static $rules = array();
@juliancantillo
juliancantillo / CarbonLocale.php
Created January 29, 2016 21:51 — forked from IsraelOrtuno/CarbonLocale.php
Carbon Locale - Use Carbon diffForHuman in different languages with Laravel Lang class
<?php
/**
- * Carbon diffForHumans multi-language.
- * Inspired in a code made by Meroje (https://gist.github.com/Meroje/7783731)
- * This code has been improved as in that original version was only showing
- * past date differences. Not it's able to show differences in past and future.
- *
- * Use it this way:
- *