This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Custom Upload Folder | |
| Description: Force all network uploads to reside in "wp-content/uploads", and by-pass "files" URL rewrite for site-specific directories. | |
| Version: 1.0 | |
| Author: Aby | |
| */ | |
| function ab_shared_media_uploads( $dirs ) { | |
| $dirs['baseurl'] = network_site_url( '/wp-content/uploads' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Creates an images containing the specified text. | |
| * Useful for sending errors back to the client. | |
| * Source : https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F380-php-text-to-image.html | |
| * @package core | |
| * @param string $text The text to include in the image. | |
| * @param int $target_size The target width to aim for when creating | |
| * the image. Not not specified, a value is | |
| * determined automatically. | |
| * @return resource The handle to the generated GD image. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # --------------------------------------------------- | |
| # Binance | |
| # --------------------------------------------------- | |
| 3.165.190.67 academy.binance.com | |
| 3.165.190.62 academy.binance.com | |
| 3.165.190.41 academy.binance.com | |
| 3.165.190.45 academy.binance.com | |
| 18.165.183.45 accounts.binance.com | |
| 18.165.183.97 accounts.binance.com | |
| 18.165.183.80 accounts.binance.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 1. Generate SSH key | |
| ssh-keygen -t rsa -b 4096 -f /root/.ssh/id_rsa_1 | |
| 2. Create config file in /root/.ssh/config | |
| Host github.com-id_rsa_1 | |
| HostName github.com | |
| IdentityFile /root/.ssh/id_rsa_1 | |
| IdentitiesOnly yes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class EMLParser { | |
| private $headers = []; | |
| private $body = ''; | |
| public function __construct($emlFilePath) { | |
| $emlContent = file_get_contents($emlFilePath); | |
| $this->parseEMLContent($emlContent); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Mix n match single dimension array to associative array | |
| $sourceArray = ['banana', 'apple', 'strawberry']; | |
| do { | |
| $array = mixnmatch($sourceArray); | |
| } while(count($array) < count($sourceArray)); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Put this file into your *.MOV directory | |
| $list = glob(__DIR__ ."/*.MOV"); | |
| foreach($list as $item) { | |
| $name = basename($item); | |
| $output = str_replace('MOV', 'mp4', $name); | |
| $command = "ffmpeg -i " . $name . " -an -vcodec h264 -acodec aac " . $output; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Http\Controllers; | |
| use App\Models\TwitterApp; | |
| use Illuminate\Http\Request; | |
| use App\Http\Controllers\Controller; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Config; | |
| use Illuminate\Support\Facades\Session; | |
| use Laravel\Socialite\Facades\Socialite; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <script language='Javascript'> | |
| (function(window, location) { | |
| history.replaceState(null, document.title, location.pathname+"#!/history"); | |
| history.pushState(null, document.title, location.pathname); | |
| window.addEventListener("popstate", function() { | |
| if(location.hash === "#!/history") { | |
| history.replaceState(null, document.title, location.pathname); | |
| setTimeout(function(){ | |
| location.replace("https://your-url-here-blablabla.com/"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| array_merge_recursive with unique value | |
| Reference : https://stackoverflow.com/questions/25712099/php-multidimensional-array-merge-recursive | |
| */ | |
| function array_merge_recursive_ex(array $array1, array $array2) | |
| { | |
| $merged = $array1; |
NewerOlder