Skip to content

Instantly share code, notes, and snippets.

View bssanchez's full-sized avatar

Brandon Sanchez bssanchez

View GitHub Profile
@bssanchez
bssanchez / docker-compose.yml
Created September 4, 2025 22:51
Docker Compose N8N config
services:
postgres:
image: postgres:15-alpine
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-n8n}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-n8n}
POSTGRES_DB: ${POSTGRES_DB:-n8n}
volumes:
- postgres_data:/var/lib/postgresql/data
@bssanchez
bssanchez / wp-install.sh
Created September 3, 2019 15:57
Bash script for install lastest version of wordpress
#!/bin/bash -e
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
echo "Database Name: "
read -e dbname
read -sp "Database root password: " rootpassdb
echo
@bssanchez
bssanchez / gfont-dl.py
Created August 22, 2019 17:50
simple GoogleFont downloader in python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import basename
from urllib import request
import sys, re, os
header = """
################################################################################
@bssanchez
bssanchez / gulpfile.js
Created May 16, 2019 15:18
Config for development plain HTML site with GULP, BrowserSync and SASS
'use strict';
// Just changes directory names for yout folder distribution and run gulp
const { src, dest, series, watch } = require('gulp');
const sourcemaps = require('gulp-sourcemaps');
const cssnano = require('cssnano');
const sass = require('gulp-sass');
const postcss = require('gulp-postcss');
const autoprefixer = require('autoprefixer');
@bssanchez
bssanchez / get-twimage.php
Created March 7, 2018 21:47
Get orginal profile image from twitter with curl
<?php
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => "https://twitter.com/[CUENTA]/profile_image?size=original",
CURLOPT_HEADER => false,
CURLOPT_RETURNTRANSFER => 1
));
curl_exec($ch);
$redirect = curl_getinfo($ch, CURLINFO_REDIRECT_URL);
@bssanchez
bssanchez / gd_fixrotate.php
Created September 26, 2017 18:53
PHP function for fix rotate exif and delete exif information using GD
<?php
/**
* Función que crea un clon de la imagen que se pase como argumento
* arreglándo la rotación y removiendo la información EXIF usando GD
*
* @param string $ruta ruta de la imagen
*/
function removeRotation($ruta)
{
@bssanchez
bssanchez / dependent-select.html
Last active September 26, 2017 18:51
Dependent form select in vanilla javascript
<!Doctype html>
<html>
<head>
<title>Selects dependientes</title>
<meta charset="utf-8">
</head>
<body>
<h1>Prueba selects</h1>
<!-- Select padre -->
<div>
@bssanchez
bssanchez / http_methods.pl
Created September 26, 2017 18:48
Perl script for consulting webpages by multiple HTTP methods
#!/bin/perl
use warnings;
use strict;
use LWP::UserAgent;
use HTTP::Request;
my $lol = 0;
my $mtd = 0;
my $menu = 0;
@bssanchez
bssanchez / Num2TextEng.php
Created September 26, 2017 18:46
Collection of PHP functions to convert a number into English text
<?php
/**
* English Number Converter - Collection of PHP functions to convert a number
* into English text.
*
* This exact code is licensed under CC-Wiki on Stackoverflow.
* http://creativecommons.org/licenses/by-sa/3.0/
*
* @link http://stackoverflow.com/q/277569/367456
@bssanchez
bssanchez / Num2Text.php
Last active September 26, 2017 18:45
script en PHP para convertir número a su forma de texto
<?php
/**
* Tomado de:
* Copyright 2007-2008 Brenton Fletcher. http://bloople.net/num2text
* @link http://stackoverflow.com/q/277569/367456
* @question Is there an easy way to convert a number to a word in PHP?
*
* Bajo la licencia de CC-Wiki on Stackoverflow.
* http://creativecommons.org/licenses/by-sa/3.0/