This file contains 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 | |
$folderPath = __DIR__ . '/path/to/folder/'; | |
try { | |
$dirIterator = new \RecursiveDirectoryIterator($folderPath); | |
/** @var \RecursiveDirectoryIterator | \RecursiveIteratorIterator $it */ | |
$it = new \RecursiveIteratorIterator($dirIterator); | |
// the valid() method checks if current position is valid eg there is a valid file or directory at the current position |
This file contains 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 | |
// using array syntax | |
Route::group([ | |
'middleware' => [ | |
'auth:api', | |
\App\Http\Middleware\RedirectIfAuthenticated::class, | |
], | |
'prefix' => 'heyaa', // adding url prefix to all routes in this group | |
'as' => 'users.', // adding route name prefix to all routes in this group | |
'namespace' => "\App\Http\Controllers", |
This file contains 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
# in ~/.bashrc | |
# !! Contents within this block are managed by 'conda init' !! | |
__conda_setup="$(CONDA_REPORT_ERRORS=false '/home/sam/anaconda3/bin/conda' shel$ | |
if [ $? -eq 0 ]; then | |
\eval "$__conda_setup" | |
else |
This file contains 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
import { createApp, h } from 'vue'; // import components from Vue 3 | |
import App from './App.vue'; | |
// importing vue 3 web component wrapper | |
// https://www.npmjs.com/package/vue3-webcomponent-wrapper | |
import wrapper from "vue3-webcomponent-wrapper"; | |
// This line will mount our component to the dom. This is only used in local development. | |
// but it is not necessary for the webcomponent wrapper to work. | |
// You can comment this out |
This file contains 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
#!/usr/bin/env sh | |
# abort on errors | |
set -e | |
# build | |
npm run build | |
# navigate into the build output directory | |
cd build |
This file contains 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
// payload to send in the API request | |
const payload = { | |
email: "[email protected]", | |
recipients: [ | |
'[email protected]', | |
'[email protected]', | |
], | |
attachment: fileObject, | |
} |
This file contains 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 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" | |
php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" | |
sudo php composer-setup.php --install-dir=/usr/bin --filename=composer | |
php -r "unlink('composer-setup.php');" |
This file contains 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; | |
class Composer extends \Illuminate\Support\Composer | |
{ | |
public function run(array $command) | |
{ |
This file contains 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\Http\Resources\SiteSearchResource; | |
use App\Models\Comment; | |
use Illuminate\Database\Eloquent\Model; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\Facades\File; |
This file contains 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 | |
$uri = 'https://test.com/api/users/{user}?page=4&size=5'; | |
$route = new SymfonyRoute( | |
preg_replace('/\{(\w+?)\?\}/', '{$1}', $uri), [], [], ['utf8' => true, 'action' => []], | |
'', [], [] | |
); | |
$compiled = $route->compile(); |
NewerOlder