"/([0-9]+)-([0-9]+)(.*)\.wav/"
the regex pattern depends to your case and $matches[1] == $needle
part in if block should be change to instead given pattern.
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
src | |
├─> app | |
│ ├─> Console | |
│ │ └── Kernel.php | |
│ ├─> Exceptions | |
│ │ └── Handler.php | |
│ ├─> Http | |
│ │ ├─> Controllers | |
│ │ │ └── Controller.php | |
│ │ ├── Kernel.php |
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
#!/bin/sh | |
# false condititon on if statement | |
# sudo apt-get purge --auto-remove php | |
# Colorize given text | |
colorize() { | |
local defaultcolor='\033[0m' | |
local textColor='\033[0m' |
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
import { Module } from '@nestjs/common'; | |
import { GraphQLModule } from '@nestjs/graphql'; | |
import { ApolloDriver, ApolloDriverConfig } from '@nestjs/apollo'; | |
@Module({ | |
imports: [ | |
GraphQLModule.forRoot<ApolloDriverConfig>({ | |
driver: ApolloDriver, // <-- this is the driver we want to use | |
debug: true, // enable graphql debug | |
playground: true, // enable graphql playground |
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\Middleware; | |
use Closure; | |
use Illuminate\Contracts\Foundation\Application; | |
use Illuminate\Http\Request; | |
use Carbon\Carbon; |
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
/node_modules | |
/public/hot | |
/public/storage | |
/storage/*.key | |
/vendor | |
.env | |
.env.backup | |
.phpunit.result.cache | |
docker-compose.override.yml | |
Homestead.json |
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\Providers; | |
use Illuminate\Support\ServiceProvider; | |
use Illuminate\Support\Facades\Blade; | |
use Illuminate\Support\Facades\File; | |
class AppServiceProvider extends ServiceProvider | |
{ |
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\Helpers; | |
/** | |
* Numbers more readable for humans | |
* It intends to change numbers as 1000 as 1K or 1200000 as 1.2M | |
* This code is heavly base in this one: https://gist.github.com/RadGH/84edff0cc81e6326029c | |
* How to use \NumberFormat::readable(1000); | |
* |
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 src="Chart.bundle.js"></script> | |
<?php | |
$host = 'localhost'; | |
$username = 'root'; | |
$password = ''; | |
$db_name = 'tes'; | |
$conn = new PDO("mysql:host={$host};dbname={$db_name}", $username, $password); | |
$conn->exec("set names utf8"); | |
$conn->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); |