Skip to content

Instantly share code, notes, and snippets.

View masterfermin02's full-sized avatar
🌎
Hello world!

Fermin Perdomo masterfermin02

🌎
Hello world!
View GitHub Profile
<?php
enum Grade: string
{
case PASS = 'pass';
case FAIL = 'fail';
case A = 'A';
case F = 'F';
case INVALID = 'Invalid grade!\n';
@masterfermin02
masterfermin02 / solve.js
Created March 5, 2023 12:44
Domino Tiling - M x N Board with Holes
class Queue {
constructor() {
this.list = []
this.head = 0
}
push(e) { this.list.push(e) }
pop() { return this.list[this.head++] }
empty() { return this.list.length == this.head }
}
@masterfermin02
masterfermin02 / originate_call.php
Created February 8, 2022 20:06 — forked from anpel/originate_call.php
Originate a call from Asterisk using PHP and Asterisk Manager Interface
/**
* Once this scipt is executed it will connect to the local port you have assigned to
* Asterisk (default: 5038) and send an authentication request. If successfull, it will
* send a second request to originate your call.
*
* The internal SIP line $internalPhoneline will be dialed, and when picked up the
* $target phone will be dialed using your outbound calls context ($context).
*
* Of course, you can modify the commands sent to the asterisk manager interface to suit your needs.
* you can find more about the available options at:
@masterfermin02
masterfermin02 / README.md
Last active March 27, 2021 17:33
Vicidial Google Chrome and Javascript Throttling fix

Fix google chrome and Javascript Throttling.

Fix

You need to add this code to the agc/vicidial.php file:

1- Add this variable around line 4708

var source = null

@masterfermin02
masterfermin02 / ChessBoard-8_x_8.cpp
Last active August 25, 2020 05:04
C++ exercises
/******************************************************************************
Online C++ Compiler.
Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.
*******************************************************************************/
// Example program
#include <iostream>
@masterfermin02
masterfermin02 / my_first_test_at_collage.cpp
Created July 6, 2020 20:15
One of my first cpp script when I started software development 10 year ago.
#include <stdio.h>
#include <conio.c>
/*
Elabore un algoritmo y un programa que permite la entrada de la cantidad de articulo
comprado y la descrpcion de dicho articulo, el sudtotal, itbis y monto a pagar tomando
encuenta que el precio sera 10.20 y el itbis sera 16%.
El Algoritmo:
P1: Inicio
function formatCedulaNumber(str) {
if (str.length < 3 && str.length < 11) {
return str;
}
if (str.length === 3) {
return str + '-';
}
if (str.length === 11) {
<?php
function searchMultiDimensionalArray($array, $key, $value) {
if(!is_array($array)) {
return preg_match("/$value/i", $array);
}
return array_filter($array, function($item) use ($key, $value){
return (isset($item[$key]) && !is_array($item[$key]) && preg_match("/$value/i", $item[$key]))
<?php
$data = json_decode('[
{
"id": 1,
"value1": 5,
"value2": 10
},
{
"id": 2,
<!-- The grid: four columns -->
<div class="row">
<div class="column">
<img src="https://cdn.pixabay.com/photo/2016/03/05/23/02/barbecue-1239434__480.jpg" alt="Nature" content="testing" onclick="myFunction(this);">
</div>
<div class="column">
<img src="https://cdn.pixabay.com/photo/2014/12/21/23/40/steak-575806__480.png" alt="Snow" content="testing" onclick="myFunction(this);">
</div>
<div class="column">
<img src="https://cdn.pixabay.com/photo/2020/02/02/15/07/meat-4813261__480.jpg" alt="Mountains" content="testing" onclick="myFunction(this);">