Skip to content

Instantly share code, notes, and snippets.

View timetorock's full-sized avatar
🇺🇦
#StandWithUkraine

timetorock

🇺🇦
#StandWithUkraine
View GitHub Profile
@timetorock
timetorock / php
Created September 2, 2022 13:09
StrAPI client with authentification
<?php
namespace App\Core\Infrastructure\Clients\Strapi\Http;
use App\Core\Infrastructure\Cache\RedisKeys;
use App\Core\Infrastructure\Clients\Strapi\Exceptions\InvalidArgumentException;
use App\Core\Infrastructure\Clients\Strapi\Exceptions\UnknownErrorException;
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Exception\GuzzleException;
@timetorock
timetorock / Laravel Memory Exhausted
Created March 17, 2021 23:00
Laravel memory exhausted investigation
If you in the same story as me:
- Laradock or other Docker containers
- No errors
- No logs
- Laravel request eats our all your memory in docker and killed silently
- You even tried to debug your code with xDebug and nothing happened after Exception
The reason is `xDebug 3.0` with `develop` enabled,
it prints detailed info about the exceptions and in the case of Laravel take a lot of memory,
even 3GB not enough, it dies, without printing any info about it.
@timetorock
timetorock / Laravel DigitalOcean Spaces S3 Config
Created February 3, 2021 22:15
Laravel 6.x, 7.x, 8.x, DigitalOcean Spaces S3 Config
If you want to setup DigitalOcean spaces in Laravel, use next config:
(also this config will help you if AWS PHP SDK make HTTP requests instead of HTTPS)
'do_spaces' => [
'driver' => 's3',
'key' => env('DO_SPACES_ACCESS_KEY_ID'),
'secret' => env('DO_SPACES_SECRET_ACCESS_KEY'),
'endpoint' => 'https://' . env('DO_SPACES_BUCKET') . '.' . env('DO_SPACES_ENDPOINT'),
'region' => env('DO_SPACES_REGION'),
@timetorock
timetorock / vowelsReverse.go
Created June 11, 2019 16:28
Vowels reverse
package main
import (
"errors"
"fmt"
)
const (
minStringLength = 3
maxStringLength = 10
@timetorock
timetorock / jquery.nice-select-with-search-multiple.js
Created February 24, 2019 14:35
nice-select-with-search-multiple
/* jQuery Nice Select - v1.1.0
https://github.com/hernansartorio/jquery-nice-select
Made by Hernán Sartorio */
(function($) {
$.fn.niceSelect = function(method) {
// Methods
if (typeof method == 'string') {
@timetorock
timetorock / SSL-certs-OSX.md
Created February 14, 2019 10:53 — forked from croxton/SSL-certs-OSX.md
Generate ssl certificates with Subject Alt Names

Generate ssl certificates with Subject Alt Names on OSX

Open ssl.conf in a text editor.

Edit the domain(s) listed under the [alt_names] section so that they match the local domain name you want to use for your project, e.g.

DNS.1   = my-project.dev

Additional FQDNs can be added if required:

@timetorock
timetorock / README.md
Created April 6, 2016 12:00 — forked from alex7kom/README.md
Steam Donation Bot

Steam Donation Bot

A Steam bot that accepts item donations.

Basically, it accepts any offer that doesn't ask for any items from its inventory.

Feel free to use if you want to accept item donations for your project, or modify it as you see fit.

This bot does not support mobile auth as of yet.