Skip to content

Instantly share code, notes, and snippets.

View relliv's full-sized avatar
no time for caution

Eyüp relliv

no time for caution
View GitHub Profile
@relliv
relliv / .gitignore
Last active December 17, 2021 22:33
Build multiple apps' sass templates with webpack
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
.env
.env.backup
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
@relliv
relliv / readme.md
Last active January 5, 2022 17:07
Search file or files in folder with PHP

"/([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.

@relliv
relliv / Localize.php
Created January 27, 2022 16:02
Laravel Carbon localize middleware
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Http\Request;
use Carbon\Carbon;
@relliv
relliv / app-module-1.ts
Last active May 5, 2022 17:06
Nest + GraphQL - 1
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
@relliv
relliv / lv-installer.sh
Last active July 14, 2022 19:11
Laravel Installer Shell Script
#!/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'
@relliv
relliv / cookies.js
Last active May 28, 2022 18:01 — forked from InfamousStarFox/cookies.js
JavaScript cookie helper
/**
* Cookie utility
*
* @source https://gist.github.com/InfamousStarFox/cd246a19dcc3fec3d4e84176bb803e6d
*/
var cookie = {
get: function (cookieName) {
var cookie = document.cookie.split(";").find(function (item) {
return item.trim().startsWith(cookieName + '=');
});
@relliv
relliv / laravel.txt
Created May 29, 2022 14:31
Laravel & Package Folder Structure
src
├─> app
│ ├─> Console
│ │ └── Kernel.php
│ ├─> Exceptions
│ │ └── Handler.php
│ ├─> Http
│ │ ├─> Controllers
│ │ │ └── Controller.php
│ │ ├── Kernel.php
@relliv
relliv / unicode.controller.ts
Last active July 11, 2022 20:13
Check given emoji is supporting by headless chromium
/* eslint-disable no-var */
/* eslint-disable @typescript-eslint/no-unused-vars */
import { HttpService } from '@nestjs/axios';
import { Controller, Get, Param } from '@nestjs/common';
import { HTMLElement, Node, NodeType, parse } from 'node-html-parser';
import { catchError, map, Observable, of } from 'rxjs';
import puppeteer from 'puppeteer';
@Controller('unicode')
export class UnicodeController {
@relliv
relliv / comment-clear.regex
Last active August 1, 2022 11:29
Clear comment tags regex in HTML
// clear comment tags regex
([ \n]+.|\n)?<!--[ ]+(.*)-->
// https://regex101.com/r/W6GLaQ/1
@relliv
relliv / StorageTrait.php
Created August 5, 2022 08:46
Laravel file upload/storage trait
<?php
namespace App\Traits;
use Illuminate\Support\Facades\Storage;
use Symfony\Component\HttpFoundation\StreamedResponse;
trait StorageTrait
{
/**