Skip to content

Instantly share code, notes, and snippets.

<?php
interface Fowl
{
public function layEgg() : Egg;
}
class Egg
{
private $hatched;
@allaniftrue
allaniftrue / laravel-echo.conf
Created April 30, 2020 09:05
Working laravel echo supervisor config
[program:laravel-echo]
directory=/var/www/html
process_name=%(program_name)s_%(process_num)02d
command=laravel-echo-server start --dir=/var/www/html
autostart=true
#autorestart=true
user=www-data
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/echo.log
(^|\.)youtube\.com$
(^|\.)www\.youtube\.com$
(^|\.)m\.youtube\.com$
(^|\.)googlevideo\.com$
(^|\.)youtu\.be$
(^|\.)ytimg\.l\.google\.com$
@allaniftrue
allaniftrue / permission.sh
Created January 10, 2020 02:01
Laravel Logs Permission With NGinx
sudo chgrp -R www-data ./storage
sudo chmod -R ug+rwx ./storage
sudo chmod g+s ./storage
@allaniftrue
allaniftrue / .env
Last active March 25, 2020 00:52
Notes on websocket implementation using Laravel-Websocket
BROADCAST_DRIVER=pusher
#PUSHER_APP_ID, PUSHER_APP_KEY, PUSHER_APP_SECRET, PUSHER_APP_CLUSTER values can be any value
PUSHER_APP_ID=5987234
PUSHER_APP_KEY=dl52342352342334
PUSHER_APP_SECRET=bc092348k625434e
PUSHER_APP_CLUSTER=local
MIX_PUSHER_APP_KEY=${PUSHER_APP_KEY}
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
<?php
namespace Tests\Feature;
use Tests\TestCase;
use File;
use Symfony\Component\Process\Process;
use Illuminate\Support\Facades\Storage;
class FetchVideoTest extends TestCase
@allaniftrue
allaniftrue / DateOrPresent.php
Created September 16, 2019 00:38
Testing Laravel Rules
<?php
namespace App\Rules;
use DateTime;
use Illuminate\Contracts\Validation\Rule;
use Illuminate\Validation\Concerns\ValidatesAttributes;
class DateOrPresent implements Rule
{
#!/bin/sh
export HOST_IP=`hostname -I | cut -d' ' -f1`
docker rm lancache-dns
docker run --restart=unless-stopped --name lancache-dns -d -p 192.168.10.253:53:53/udp -e USE_GENERIC_CACHE=true -e LANCACHE_IP=192.168.10.253 lancachenet/lancache-dns:latest &
docker rm lancache
docker run --restart=unless-stopped --name lancache -d -v /cache/data:/data/cache -v /cache/logs:/data/logs -p 80:80 lancachenet/monolithic:latest
@allaniftrue
allaniftrue / Drawer.vue
Created June 9, 2019 20:58
A drawer component for vue.js
<template>
<div
class="drawer"
:class="{'rotate': !isShow}"
>
<div
class="drawer__knob"
@click="isShow = !isShow"
v-if="!isShow"
>
@allaniftrue
allaniftrue / axios.unverify.ssl.js
Last active August 18, 2022 11:30
axios configuration to disable certificate verification
import axios from 'axios';
import https from 'https';
axios.create({
baseURL: 'https://localhost:3001',
httpsAgent: new https.Agent({
rejectUnauthorized: false,
}),
});