Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>AllowClipboardAccess</key>
<true/>
<key>AlternateMouseScroll</key>
<true/>
<key>AppleAntiAliasingThreshold</key>
<integer>1</integer>
@Tech-Emiretus
Tech-Emiretus / FileStorage.php
Created December 11, 2020 08:03
FileStorage Wrapper for a SFTP server for a multitenant system.
<?php
namespace FileStorage;
use File;
use Config;
use Storage;
use Exception;
use App\Helpers\MimeType;
use InvalidArgumentException;
@Tech-Emiretus
Tech-Emiretus / plucking.php
Created May 23, 2018 22:03
Get only the product_name in a new array
<?php
$data = Product::where('type', 'Ring')->get();
return $data->pluck('product_name');
@Tech-Emiretus
Tech-Emiretus / data_filter.php
Created May 23, 2018 21:57
Filter data to display only entries made in July
<?php
$data = [
(object) [
'name' => 'Ring [A0123]',
'price' => 25,
'created_at' => '2016-07-20'
],
(object) [
@Tech-Emiretus
Tech-Emiretus / cloudSettings
Last active October 23, 2020 10:07
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-09-18T09:55:06.042Z","extensionVersion":"v3.4.3"}
@Tech-Emiretus
Tech-Emiretus / cloudSettings
Last active February 8, 2018 09:31
Visual Studio Code Settings Sync Gist
{"lastUpload":"2018-02-08T09:31:34.535Z","extensionVersion":"v2.8.7"}
@Tech-Emiretus
Tech-Emiretus / flatten_array.php
Created August 23, 2016 05:23
Flattening an Array
<?php
$initialArray = [[1, 2, [3]], 4];
/**
* This function is used to flatten arrays and also even nested arrays.
*
* It first loops through each element of the array and if the element is an
* integer it adds it as an element of the flattened array (flat 1). Else if the
* element is an array, it passes the already flatened array to the function and then
* it flattens that array too (flat 2). It then assigns the new flattend array together
* with the already existing elements of the array to the flattened array (which contains