Skip to content

Instantly share code, notes, and snippets.

View ArielMejiaDev's full-sized avatar
🐘
Focusing

ArielMejiaDev ArielMejiaDev

🐘
Focusing
View GitHub Profile
@ArielMejiaDev
ArielMejiaDev / gist:503a0214321854fe395a0072c7e45c75
Created April 17, 2018 06:24 — forked from oscar-broman/gist:3653399
UTF8 encode array/object structure in PHP
<?php
function utf8_encode_deep(&$input) {
if (is_string($input)) {
$input = utf8_encode($input);
} else if (is_array($input)) {
foreach ($input as &$value) {
utf8_encode_deep($value);
}
unset($value);
@ArielMejiaDev
ArielMejiaDev / passwordRegex.js
Created May 18, 2018 15:49 — forked from HarishChaudhari/passwordRegex.js
Password validation RegEx for JavaScript
/**
* Password validation RegEx for JavaScript
*
* Passwords must be
* - At least 8 characters long, max length anything
* - Include at least 1 lowercase letter
* - 1 capital letter
* - 1 number
* - 1 special character => !@#$%^&*
*
@ArielMejiaDev
ArielMejiaDev / has-characters.php
Created July 5, 2018 22:09 — forked from cferdinandi/has-characters.php
Test strings for letters, numbers, and special characters. Returns true if they exist, false if they don't. Forked from http://stackoverflow.com/a/9588010/1293256
<?php
// Does string contain letters?
function _s_has_letters( $string ) {
return preg_match( '/[a-zA-Z]/', $string );
}
// Does string contain numbers?
function _s_has_numbers( $string ) {
return preg_match( '/\d/', $string );
@ArielMejiaDev
ArielMejiaDev / main.dart
Created March 30, 2019 07:48 — forked from branflake2267/main.dart
Flutter fonts example use.
import 'package:flutter/material.dart';
const String words1 = "Almost before we knew it, we had left the ground.";
const String words2 = "A shining crescent far beneath the flying vessel.";
const String words3 = "A red flair silhouetted the jagged edge of a wing.";
const String words4 = "Mist enveloped the ship three hours out from port.";
void main() {
runApp(new MyApp());
}
@ArielMejiaDev
ArielMejiaDev / oneliners.js
Created April 2, 2019 15:29 — forked from mikowl/oneliners.js
👑 Awesome one-liners you might find useful while coding.
// By @coderitual
// https://twitter.com/coderitual/status/1112297299307384833
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@ArielMejiaDev
ArielMejiaDev / README-español.md
Created July 14, 2019 00:01 — forked from Villanuevand/README-español.md
Una plantilla para hacer un buen README.md. Inspirado en el gist de @PurpleBooth => https://gist.github.com/PurpleBooth/109311bb0361f32d87a2

Título del Proyecto

Acá va un párrafo que describa lo que es el proyecto

Comenzando 🚀

Estas instrucciones te permitirán obtener una copia del proyecto en funcionamiento en tu máquina local para propósitos de desarrollo y pruebas.

Mira Deployment para conocer como desplegar el proyecto.

@ArielMejiaDev
ArielMejiaDev / AppServiceProvider.php
Created August 7, 2019 20:36 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
<?php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
@ArielMejiaDev
ArielMejiaDev / deployment_guide.md
Created September 5, 2019 06:42 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@ArielMejiaDev
ArielMejiaDev / Kernel.php
Created April 29, 2020 19:38 — forked from JuanDMeGon/Kernel.php
A small Laravel command to collect the sessions garbage if applicable to the current session driver
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
//...
@ArielMejiaDev
ArielMejiaDev / Laravel classic SPA with Passport, VueJS+Vuerouter+Vuex+TailwindCSS in a single project.md
Last active May 10, 2024 01:03
A setup guide to create an Classic SPA with Laravel, Laravel passport & VueJS, Vuerouter, Vuex and TailwindCSS

Setup

Install a new laravel project

laravel new project-name

Create a database