Skip to content

Instantly share code, notes, and snippets.

View mariapaulinar's full-sized avatar
🐶

María Paulina Ramírez Vásquez mariapaulinar

🐶
View GitHub Profile
@SaeedPrez
SaeedPrez / LoginController.php
Created March 12, 2017 16:42
Laravel 5.4 Additional Login Conditions - Add custom error message.
<?php
// This is code to return custom error message
// for Youtube tutorial: Laravel 5.4 Additional Login Conditions
// https://www.youtube.com/watch?v=Z8s6uhhD1Pk
namespace App\Http\Controllers\Auth;
@mariapaulinar
mariapaulinar / artisan-commands
Last active January 15, 2019 16:50
Comandos Artisan
Crear un controlador:
php artisan make:controller NombreControladorController
Crear un modelo:
php artisan make:model NombreModelo
Crear un request

Production LAMP server setup on Ubuntu 16.04

Introduction

Summary of the steps to get a Ubuntu 16.04 production server running with LAMP, multiple virtual hosts and Let's Encrypt SSL.

Initial setup

@ntopulos
ntopulos / Multiple PHP versions on Ubuntu 16.04.md
Created June 10, 2016 15:00
Steps to get multiple versions of PHP running alongside on separate Apache virtual hosts using phpfarm

Multiple PHP versions on Ubuntu 16.04

Steps to get multiple versions of PHP running alongside on separate Apache virtual hosts using phpfarm.
The guide uses the example of PHP v5.4.45 and v7.0.7, but installation of any version and any number of versions will be done this same way.

Prerequisites

Update the machine:

@odan
odan / xampp_php7_xdebug.md
Last active April 17, 2024 05:36
Installing Xdebug for XAMPP
@miguelmota
miguelmota / randomDate.js
Last active December 21, 2022 16:27
Random date in JavaScript
function randomDate(start, end) {
return new Date(start.getTime() + Math.random() * (end.getTime() - start.getTime()))
}
console.log(randomDate(new Date(2012, 0, 1), new Date()))
@nixta
nixta / .htaccess
Last active March 19, 2024 22:52
.htaccess to add CORS to your website
# Add these three lines to CORSify your server for everyone.
Header set Access-Control-Allow-Origin "*"
Header set Access-Control-Allow-Methods "GET,PUT,POST,DELETE"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}