Skip to content

Instantly share code, notes, and snippets.

View pablorsk's full-sized avatar

Pablo Reyes pablorsk

View GitHub Profile
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-nginx
spec:
# ACME issuer configuration
# `email` - the email address to be associated with the ACME account (make sure it's a valid one)
# `server` - the URL used to access the ACME server’s directory endpoint
# `privateKeySecretRef` - Kubernetes Secret to store the automatically generated ACME account private key
acme:
@pablorsk
pablorsk / README.md
Last active March 3, 2021 00:12
devspace common problems

Common problems

DevSpace still couldn't find any Pods that...

Problem

$ devspace dev
[...]
DevSpace still couldn't find any Pods that match the selector. DevSpace will continue waiting, but this operation might timeout
@pablorsk
pablorsk / allpdftotext.sh
Created October 13, 2018 15:47
Convert all pdf to text file
#!/bin/bash
#
# Recorre todos los archivos .pdf del directorio actual y genera el .txt correspondiente
#
for file in ./*.pdf
do
echo "Converting $file to $file.txt"
pdftotext -layout "$file" "$file.txt"
done
@pablorsk
pablorsk / bitbucket-pipelines.yml
Created May 16, 2018 11:24
Nanobox on Bitbucket Pipeline
## WARNING!!!
## DONT WORK YET
image: susa4ostec/bitbucket-pipelines-php7.1-mysql
options:
docker: true
pipelines:
default:
@pablorsk
pablorsk / Dockerfile
Last active August 27, 2019 09:14
Kubernetes: Helm + Node “Hello world”
FROM busybox
ADD app/index.html /www/index.html
EXPOSE 8005
CMD httpd -p 8005 -h /www; tail -f /dev/null
@pablorsk
pablorsk / typescript_decorator_example_constructor.ts
Last active January 26, 2023 15:17
TypeScript Decorator: Run code before and after class constructor()
function ClassWrapper() {
return function(target: any) {
// save a reference to the original constructor
var original = target;
// the new constructor behaviour
var f: any = function (...args) {
console.log('ClassWrapper: before class constructor', original.name);
let instance = original.apply(this, args)
console.log('ClassWrapper: after class constructor', original.name);
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET,POST,OPTIONS,DELETE,PUT';
add_header 'Access-Control-Allow-Headers' 'authorization,content-type,DNT,X-CustomHeader,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control';
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Access-Control-Allow-Credentials' true;
add_header 'Content-Security-Policy' 'default-src "self"';
@pablorsk
pablorsk / Simple-MercadoPago-PHP.md
Last active December 18, 2017 12:19
MercadoPago with PHP --> SIMPLE!

Send your users to https://www.mercadopago.com/mla/checkout/pay?pref_id=$pref_id

@pablorsk
pablorsk / .htaccess
Last active December 4, 2017 00:12
apache .htaccess cors buster
<IfModule mod_headers.c>
RewriteCond %{REQUEST_METHOD} OPTIONS [NC]
# Only paths starting with /api/
RewriteCond %{REQUEST_URI} ^/api/ [NC]
RewriteRule ^(.*)$ $1 [L,R=204,ENV=CORS:true]
Header always set X-Content-Type-Options "nosniff"
Header always set X-XSS-Protection "1; mode=block"
Header always set Access-Control-Max-Age 1728000 env=CORS
@pablorsk
pablorsk / CorsMiddleware.php
Last active August 15, 2020 20:23
CORS middleware for Lumen and PSR-7
<?php
namespace App\Http\Middleware;
use Closure;
class CorsMiddleware
{
/**
* Handle an incoming request.