Skip to content

Instantly share code, notes, and snippets.

View juslintek's full-sized avatar
🎯
Focusing

Linas juslintek

🎯
Focusing
View GitHub Profile
@juslintek
juslintek / Handler.php
Created September 26, 2023 10:18
Allows to passover exception that is derivative of ApiException its message and code as response code and error payload
<?php
use Illuminate\Http\JsonResponse;
use Throwable;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
@juslintek
juslintek / ConfigRepo.php
Created February 21, 2023 18:25
Fluent Configs Setter Getter and Availability Checker
<?php
namespace App;
use Illuminate\Support\Str;
class ConfigRepo extends \Illuminate\Config\Repository
{
public function __call($method, array $parameters)
{
$verb = Str::lcfirst($method);
@juslintek
juslintek / task.md
Last active February 5, 2021 11:59 — forked from Neophen/task.md
Alna task

Alna Software task

The tasks do not require full completion. Do as much as you can. This test is a full-stack test with a little DevOps. We understand that you might not know how to use some of the tools. It's completely ok.

  • When applying for frontend only, you can simulate the backend however you desire.
  • When applying for backend only, you can simulate the frontend however you desire.
  • If you're a full-stack developer, it would be nice to demonstrate knowledge of vue-js.

DevOps:

You can skip this part if you don't know docker, and create a default Laravel project. Setup two projects:

@juslintek
juslintek / build_docker_Dockerfile
Created January 26, 2020 22:52
openlitespeed docker
FROM phpearth/php:7.3-litespeed as base
RUN apk add --no-cache composer bash
FROM base as vendor
COPY ./app/composer.json /var/vendor_install/composer.json
RUN cd /var/vendor_install && composer install --prefer-dist --no-interaction
@juslintek
juslintek / rewrite_example.php
Created May 30, 2019 16:43
I've made this on one plugin
<?php
class Config {
public function __construct() {
add_action( 'init', array( $this, '_wpSoapGetEndPoint' ) );
add_action( 'template_redirect', array( $this, '_wpSoapGetEndPointData' ) );
}
/**
* Idnetify Soap Request Endpoint and Perform URL Pattern Rewrite Rules Validation Checks
@juslintek
juslintek / docker-compose-problem.md
Created July 3, 2018 21:47
docker-compose.yml problem

Hi, I get

ERROR: Version in "./docker-compose.yml" is unsupported. You might be seeing this error because you're using the wrong Compose file version. Either specify a supported version (e.g "2.2" or "3.3") and place your service definitions under the `services` key, or omit the `version` key and place your service definitions at the root of the file to use version 1.
For more on the Compose file format versions, see https://docs.docker.com/compose/compose-file/

on

docker -v
Docker version 18.03.1-ce, build 9ee9f40
@juslintek
juslintek / blacklist.conf
Created April 10, 2018 00:37
Ka blokuoja servas
map $http_user_agent $bad_bot {
default 0;
"~*Baidu" 1;
"~*slurp" 1;
"~*Spaidu" 1;
"~*YandexBot" 1;
"~*YandexImages" 1;
"~*80legs" 1;
"~*360Spider" 1;
"~*Aboundex" 1;
(function ($) {
/**
* @var object uptimeArgs
* @var object monitor = {
* all_time_uptime_ratio: "100.000",
* average_response_time: "94.647",
* create_datetime: 1501761134,
* friendly_name: "Hostinger",
* http_password: "",
* http_username: "",
@juslintek
juslintek / hosting_companies_listing.php
Created March 1, 2018 13:07
LC module for outputting live-composer
<?php
/**
* Plugin Name: Hosting Companies Listing
* Description: Lists Hostinger Post Types In Chosen Formats.
* Version: 1.0
*/
if ( defined( 'DS_LIVE_COMPOSER_URL' ) ) {
@juslintek
juslintek / file_sizes.log
Created February 26, 2018 08:50
Sizes of files to be stored in database
This file has been truncated, but you can view the full file.
Juslintek-MAC:~ juslintek$ ssh amazon2 du -shc public_html/wp-content/uploads/*
164K public_html/wp-content/uploads/000webhost-main-1024x500.png
140K public_html/wp-content/uploads/000webhost-main-1024x500.png.webp
160K public_html/wp-content/uploads/000webhost-main-1024x500.webp
8.0K public_html/wp-content/uploads/000webhost-main-135x66.png
8.0K public_html/wp-content/uploads/000webhost-main-135x66.png.webp
8.0K public_html/wp-content/uploads/000webhost-main-135x66.webp
12K public_html/wp-content/uploads/000webhost-main-150x150.png
12K public_html/wp-content/uploads/000webhost-main-150x150.png.webp