Skip to content

Instantly share code, notes, and snippets.

View jgrossi's full-sized avatar
👨‍💻
probably writing code

Junior Grossi jgrossi

👨‍💻
probably writing code
View GitHub Profile
<?php
namespace App;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Relations\Relation;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
@millermedeiros
millermedeiros / osx_setup.md
Last active April 12, 2024 12:40
Mac OS X setup

Setup Mac OS X

I've done the same process every couple years since 2013 (Mountain Lion, Mavericks, High Sierra, Catalina) and I updated the Gist each time I've done it.

I kinda regret for not using something like Boxen (or anything similar) to automate the process, but TBH I only actually needed to these steps once every couple years...

@mayconbordin
mayconbordin / progress_bar.php
Created June 2, 2012 23:55
PHP CLI progress bar in 5 lines of code
<?php
function progress_bar($done, $total, $info="", $width=50) {
$perc = round(($done * 100) / $total);
$bar = round(($width * $perc) / 100);
return sprintf("%s%%[%s>%s]%s\r", $perc, str_repeat("=", $bar), str_repeat(" ", $width-$bar), $info);
}
@getsource
getsource / WP_Bag_of_Tricks.txt
Created October 26, 2011 21:07 — forked from boogah/WP_Bag_of_Tricks.txt
Things I've learned by being DreamHost's resident WordPress nerd.
WP Bag of Tricks
1. Helpful Scripts/Plugins:
Hacks:
http://wordpress.org/extend/plugins/tac/
http://wordpress.org/extend/plugins/exploit-scanner/ (Can be extremely resource intensive.)
http://wordpress.org/extend/plugins/wp-malwatch/
@bdunogier
bdunogier / curl_progress.php
Created June 16, 2011 22:31
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 );