Skip to content

Instantly share code, notes, and snippets.

View joelibaceta's full-sized avatar
🏠
Working from home

Joel Ibaceta joelibaceta

🏠
Working from home
View GitHub Profile
<?php
require 'vendor/autoload.php';
$culqi = new Culqi\Culqi(array('api_key' => $_ENV["API_KEY"]));
// Generar el token de Tarjeta
@joelibaceta
joelibaceta / flatten.rb
Created July 9, 2019 22:34
Flatten Array
def flatten(input)
if input.any? { |n| n.is_a? Array }
return input.reduce([]) do |b, x|
x.is_a?(Array) ? b + flatten(x) : b + [x]
end
else
return input
end
end
import re
print("\n\033[38;1mCalcular +, , *, / de 2 números:\033[0m\n")
def solve(str_operation):
pattern = re.compile("([0-9]+)[\s]*([\+\-\/\*])[\s]*([0-9]+)")
match = pattern.match(str_operation)
(operator1, operation, operator2) = match.groups()
if operation == "+":
@joelibaceta
joelibaceta / logo.svg
Created June 24, 2019 23:05
Peruanos.dev Logo
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@joelibaceta
joelibaceta / _tree.py
Last active June 14, 2019 22:43
A monster code for draw a tree
c =0
""" ."""
b = 34
""" ###"""
while b > 0 \
and c < 33 :
""" ############"""
print( '\33[1;32;48m' + \
' '*b+'*'+'*'*c+'\33[0m')

Build docker image

$ cd /path/to/Dockerfile
$ sudo docker build .

View running processes

@joelibaceta
joelibaceta / SleepSort.js
Last active April 18, 2019 21:41
"Sleep Sort" a funny approach about sort algorithms
numbers = [8, 42, 38, 111, 2, 39, 1]
numbers.forEach(num => {
setTimeout(() => { console.log(num) }, num)
});
// ➜ ~ node sleepsort.js
// 1
// 2
// 8
@joelibaceta
joelibaceta / Gemfile
Created January 25, 2019 15:07
Mail Sender
source 'https://rubygems.org'
gem 'ruby-progressbar'
@joelibaceta
joelibaceta / CrearPago.cs
Created January 15, 2019 19:54 — forked from JuaniVeltri/CrearPago.cs
Creación de pago .NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using AdminLTE.Data;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using MercadoPago;
using MercadoPago.Resources;
using MercadoPago.DataStructures.Payment;
@joelibaceta
joelibaceta / installation-sdk-php.svg
Created January 4, 2019 19:48
sdk installation recording
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.