Skip to content

Instantly share code, notes, and snippets.

View josuealcalde's full-sized avatar

Josué Alcalde González josuealcalde

View GitHub Profile
@josuealcalde
josuealcalde / pvm
Created July 21, 2022 08:13 — forked from elipettingale/.bash_aliases
PHP Version Manager - quickly switch terminal to a specific version of php
#!/bin/bash
PVM_TMP_PATH=$(mktemp -d)
RETVAL=0
export PATH="$PVM_TMP_PATH:$PATH"
function pvm_use() {
if [ -f "/usr/bin/php${1}" ]
then
printf "Now using php $1\n"
@josuealcalde
josuealcalde / CronSchedule.php
Created April 20, 2021 14:06 — forked from m4tthumphrey/CronSchedule.php
CronSchedule.php - Allows one to parse a cron expression into human readable text.
<?php
/*
* Plugin: StreamlineFoundation
*
* Class: Schedule
*
* Description: Provides scheduling mechanics including creating a schedule, testing if a specific moment is part of the schedule, moving back
* and forth between scheduled moments in time and translating the created schedule back to a human readable form.
*
* Usage: ::fromCronString() creates a new Schedule class and requires a string in the cron ('* * * * *', $language) format.
@josuealcalde
josuealcalde / sql_backup.sh
Created September 15, 2016 08:16 — forked from niraj-shah/sql_backup.sh
Amazon S3 Backup Script for MySQL Databases
#!/bin/bash
# Shell script to backup MySql database
# CONFIG - Only edit the below lines to setup the script
# ===============================
MyUSER="root" # USERNAME
MyPASS="password" # PASSWORD
MyHOST="localhost" # Hostname