Skip to content

Instantly share code, notes, and snippets.

View ibayazit's full-sized avatar
🎯
Focusing

İbrahim Bayazit ibayazit

🎯
Focusing
View GitHub Profile
@ibayazit
ibayazit / Dockerfile
Last active March 10, 2024 13:25
Laravel 5.7 dockerize
FROM php:7.4.0-cli
WORKDIR /var/www/html
RUN apt-get update && apt-get install -y \
git \
zip \
unzip \
libmcrypt-dev \
libonig-dev \
@ibayazit
ibayazit / main.js
Created November 10, 2023 10:36
Sample DI
const UserTypes = Object.freeze({
DEFAULT: "DEFAULT",
MANAGER: "MANAGER",
ADMIN: "ADMIN",
});
class DefaultService {
run() {
console.log(DefaultService.name);
}
@ibayazit
ibayazit / serialize.interceptor.ts
Created April 13, 2023 08:58
NestJS format outgoing response
import {
UseInterceptors,
NestInterceptor,
ExecutionContext,
CallHandler
} from "@nestjs/common";
import { Observable } from "rxjs";
import { map } from "rxjs";
import { plainToInstance } from "class-transformer";
@ibayazit
ibayazit / mongo-export-import.md
Created November 15, 2022 08:47
Mongodb exporting a database with all collections and importing

Export

mongodump -d DATABASENAME -o EXPORTDIR

Import

mongorestore --uri CONNECTIONSTRONG -d NEWDATABASENAME EXPORTEDDIR
@ibayazit
ibayazit / migration-users.php
Created October 7, 2022 08:45
Laravel uuid migration. pros and cons : With this way you can create UUID easily but the created user model doesn't return UUID or i couldn't find a way
<?php
...
use Illuminate\Database\Query\Expression;
...
return new class extends Migration
{
/**
* Run the migrations.
@ibayazit
ibayazit / migration-users.php
Created October 7, 2022 08:44
Laravel uuid migration.
<?php
...
use Illuminate\Database\Query\Expression;
...
return new class extends Migration
{
/**
* Run the migrations.
@ibayazit
ibayazit / Procfile
Created October 3, 2022 10:46
Bitbucker Deploy to Heroku
web: vendor/bin/heroku-php-apache2 public/

Project structure

  • app.js
  • routes/route.js
  • layouts/Default.vue
  • components
    • Home.vue
    • About.vue

App.js

@ibayazit
ibayazit / Laravel custom notification channel
Created July 27, 2022 10:03
Laravel custom notification channel. Example sms notification
#channel -------------------
<?php
namespace App\Channels;
use Illuminate\Notifications\Notification;
class SmsChannel
{
public function send($notifiable, Notification $notification)
@ibayazit
ibayazit / php_version
Last active November 7, 2021 12:35
Switching php versions on macOs
- List php versions
brew list | grep php
- Installing wanted php version
brew install [email protected]
- Linking wanted php version
brew unlink php
brew link [email protected] --force