Skip to content

Instantly share code, notes, and snippets.

View jassriver's full-sized avatar
:shipit:
WordPress Today, WordPress Tomorrow, WordPress Always!

River jassriver

:shipit:
WordPress Today, WordPress Tomorrow, WordPress Always!
View GitHub Profile
@jassriver
jassriver / regex mac address php.php
Created March 9, 2021 23:48
Extrai um endereço de MAC de uma string usando Regex (Expressão regular) com PHP
<?php
// String obtida
$macAddress = '10.19.60.72 --- 0x3 Endereço IP Endereço físico Tipo 10.19.63.117 70-85-c2-f6-28-f8 dinâmico';
// Expressão regular pra extrair o MAC ADDRESS
preg_match_all('/[a-fA-F0-9-]{17}|[a-fA-F0-9]{12}$/', $macAddress, $mac);
// Printa o resultado
print_r($mac);
@jassriver
jassriver / curl_progress.php
Created October 23, 2020 21:56 — forked from bdunogier/curl_progress.php
PHP/cURL download progress monitoring
<?php
file_put_contents( 'progress.txt', '' );
$targetFile = fopen( 'testfile.iso', 'w' );
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' );
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt( $ch, CURLOPT_NOPROGRESS, false );
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' );
curl_setopt( $ch, CURLOPT_FILE, $targetFile );
@jassriver
jassriver / ResizeImage.php
Created September 20, 2020 11:17 — forked from egulhan/ResizeImage.php
Resize Image Class With PHP
<?php
// @source: http://www.paulund.co.uk/resize-image-class-php
/**
* Resize image class will allow you to resize an image
*
* Can resize to exact size
* Max width size while keep aspect ratio
* Max height size while keep aspect ratio
* Automatic while keep aspect ratio
@jassriver
jassriver / mysql li jream
Created December 19, 2019 13:46
Mysqli Class
<?php
/**
* Simple MySQLi Class 0.3
*
* @author JReam
* @license GNU General Public License 3 (http://www.gnu.org/licenses/)
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 3 of the License, or