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 / yt-skipper.js
Last active November 25, 2020 14:34
Abrir una playlist > copypastear en Chrome Dev Tools > Sources > new Snippet y darle plaaay
(($adsContainer, skipBtnClass, addOverlayClass) => {
const handler = (mutationsList, observer) => {
mutationsList.some((mutation) => {
if (mutation.type !== 'childList') return;
const $btn = $adsContainer.querySelector(skipBtnClass);
if ($btn) {
$btn.click();
return true;
}
@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 / testa.js
Created November 1, 2019 05:52
suite
const a = () => {};
module.exports = a;
@Frondor
Frondor / binder-recipe-webpack.js
Last active November 11, 2018 01:08
Use webpack's require.context to auto-load configuration files from a given directory, and resolve a singleton object with the contents from the container
// ./config/app.js
export default {
version: "6.6.6"
}
// ./container.js (service container)
import Binder from "binder";
export default new Binder();
// ./index.js (app bootstrap module)
@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 / a.conf
Created May 16, 2018 05:44
nginx.conf file, included from another http context
# Based on:
# https://www.netguru.co/codestories/nginx-tutorial-performance
# https://www.netguru.co/codestories/nginx-tutorial-ssl-setup
# https://www.digitalocean.com/community/tutorials/understanding-nginx-http-proxying-load-balancing-buffering-and-caching
gzip on; # enable gzip
gzip_http_version 1.1; # turn on gzip for http 1.1 and higher
gzip_disable "msie6"; # IE 6 had issues with gzip
gzip_comp_level 5; # inc compresion level, and CPU usage
gzip_min_length 256; # minimal weight to gzip file (files below this in bytes are not compressed)
@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');