Skip to content

Instantly share code, notes, and snippets.

View EXayer's full-sized avatar
🧿
Focusing

Vitalii Honcharuk EXayer

🧿
Focusing
  • SoftHouseGroup
  • Vinnytsia, Ukraine
  • 21:25 (UTC +02:00)
View GitHub Profile
@semiherdogan
semiherdogan / LogResponseTimeMiddleware.php
Created November 14, 2023 13:04
Laravel log response time middleware
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Log;
use Symfony\Component\HttpFoundation\Response;
class LogResponseTimeMiddleware
{
@marcoarment
marcoarment / S3.php
Last active June 18, 2024 14:15
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@waska14
waska14 / FileHelper.php
Last active September 26, 2024 21:11
Laravel: create UploadedFile object from base64 string (autoremove temp file)
<?php
namespace App\Helpers\File;
use Illuminate\Http\File;
use Illuminate\Http\UploadedFile;
use Illuminate\Support\Arr;
class FileHelper
{
@slinkardbrandon
slinkardbrandon / Dockerfile
Last active June 13, 2023 13:00
Serverless in docker example
FROM node:12-alpine
WORKDIR /app
COPY tsconfig.json ./
COPY serverless.yml ./
COPY package.json ./
COPY package-lock.json ./
RUN npm ci
@m-cakir
m-cakir / CustomPasswordTokenResponseClient.java
Last active April 4, 2023 02:02
Add User-Agent header on Oauth2 Client - Spring Boot
package *;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.core.convert.converter.Converter;
import org.springframework.http.HttpHeaders;
import org.springframework.http.RequestEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.http.converter.FormHttpMessageConverter;
import org.springframework.http.converter.HttpMessageConverter;
import org.springframework.security.oauth2.client.endpoint.OAuth2AccessTokenResponseClient;