Skip to content

Instantly share code, notes, and snippets.

View Frondor's full-sized avatar
🤝

Federico Vázquez Frondor

🤝
  • Sr. Software Engineer @ Mercado Libre
  • Montevideo, Uruguay
View GitHub Profile
@Frondor
Frondor / Laravel-Container.md
Created June 8, 2020 06:27
Laravel's Dependency Injection Container in Depth

Laravel's Dependency Injection Container in Depth

Translations: Korean (by Yongwoo Lee)

Laravel has a powerful Inversion of Control (IoC) / Dependency Injection (DI) Container. Unfortunately the official documentation doesn't cover all of the available functionality, so I decided to experiment with it and document it for myself. The following is based on Laravel 5.4.26 - other versions may vary.

Introduction to Dependency Injection

I won't attempt to explain the principles behind DI / IoC here - if you're not familiar with them you might want to read What is Dependency Injection? by Fabien Potencier (creator of the Symfony framework).

@Frondor
Frondor / envsubst-multi.sh
Created June 23, 2018 06:51 — forked from zburgermeiszter/envsubst-multi.sh
Envsubst render multiple files.
for f in $(find deploy/templates -regex '.*\.ya*ml'); do envsubst < $f > "./deploy/generated/$(basename $f)"; done
@Frondor
Frondor / nginx.conf
Created May 9, 2018 09:22 — forked from chrisallenlane/nginx.conf
This is an nginx configuration that does the following: - Implements a RESTful API using CORS between `example.com` and `api.example.com` - Uses SSL - Reverse-proxies SSL traffic from port 443 to a NodeJS application running on port 8000 Adapted from this page, with thanks to the original author: http://enable-cors.org/server_nginx.html
# Configure the reverse-proxy on port 443
server {
# general configs
keepalive_timeout 30;
listen 127.0.0.1:443 ssl;
server_name api.example.com;
# ssl configs
ssl_certificate /path/to/api.crt;
ssl_certificate_key /path/to/api.key;
@Frondor
Frondor / sqlsrv_test.php
Created February 16, 2017 16:59 — forked from MCF/sqlsrv_test.php
PDO sqlsrv PHP driver, connect and query SQL Server database - reduced test case.
<?php
$serverName = "sqlserver.example.com";
$database = "myDbName";
$uid = 'sqlserver_username';
$pwd = 'password';
try {
$conn = new PDO(
"sqlsrv:server=$serverName;Database=$database",
$uid,
@Frondor
Frondor / backup.php
Last active January 31, 2017 07:21 — forked from toddsby/backup.php
backup.php
<?php
/*
* PHP: Recursively Backup Files & Folders to ZIP-File
* (c) 2012-2014: Marvin Menzerath - http://menzerath.eu
* contribution: Drew Toddsby
*/
// Make sure the script can handle large folders/files
ini_set('max_execution_time', 600);
ini_set('memory_limit','1024M');