Skip to content

Instantly share code, notes, and snippets.

View abimaelmartell's full-sized avatar

Abimael Martell abimaelmartell

View GitHub Profile
@abimaelmartell
abimaelmartell / Dockerfile
Created March 31, 2020 21:01
Docker for Rails
FROM ruby:2.7.0-alpine
ENV PORT=80
RUN apk add --no-cache \
build-base \
libxml2-dev \
libxslt-dev \
postgresql-dev \
tzdata
@abimaelmartell
abimaelmartell / 🍝.php
Created January 28, 2021 06:07
Ejemplo de Espaghetti
<?php
$servername = "127.0.0.1";
$username = "user";
$password = "password";
$dbname = "db";
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
@abimaelmartell
abimaelmartell / FantasticFour.java
Last active February 15, 2021 03:32
Clase para Tarea de Programación Orientada a Objetos
import learning.business.superAnimals.ElasticHuman;
import learning.business.superAnimals.HomoSapiens;
import learning.business.superAnimals.Superman;
import learning.business.superAnimals.Invisible;
import learning.basicGUI.BaseAppGUI;
import learning.basicGUI.ImagePanel;
import learning.basicGUI.InternalButton;
import learning.basicGUI.FlowPanel;
import learning.basicGUI.GridPanel;
import java.awt.TextArea;
@abimaelmartell
abimaelmartell / closestNumbers.js
Created March 13, 2021 00:23
Given an array of distinct integers, determine the minimum absolute difference between any two elements. Return all element pairs with that minimal absolute difference in ascending order.
/*
* Complete the 'closestNumbers' function below.
*
* The function accepts INTEGER_ARRAY numbers as parameter.
*/
const closestNumbers = (numbers) => {
let result = [];
let minimalDistance = Infinity;
numbers.sort((a, b) => a - b);
ffmpeg -i input.mov -q:v 1 -q:a 1 output.wmv
axios.interceptors.response.use(
(response) => response,
(error) => {
if (defaultAxios.isAxiosError(error)) {
throw new Error(
`Failed Request to ${error.config.url} with ${JSON.stringify(
error.config.data
)} with status ${error.response?.status} and data ${JSON.stringify(
error.response?.data