Skip to content

Instantly share code, notes, and snippets.

View ssi-anik's full-sized avatar
💻
Open to remote work!

Syed Sirajul Islam Anik ssi-anik

💻
Open to remote work!
View GitHub Profile
<?php
require './app/App.php';
require './src/Source.php';
require './Current.php';
echo (new Current())->sayHello('anik');
<?php
function autoload_src($file): bool
{
echo sprintf('autoload_src: Looking for "%s".%s', $file, PHP_EOL);
if (strtolower(($extract = explode('\\', $file))[0]) === 'source') {
return loadFileIfExists('./src', $extract[1] ?? '');
}
@ssi-anik
ssi-anik / gdrive_get_large_file.sh
Created September 26, 2021 03:47 — forked from hershkoy/gdrive_get_large_file.sh
Download large file from Google Drive (2020)
#!/bin/bash
if [ $# != 2 ]; then
echo "Usage: googledown.sh ID save_name"
exit 0
fi
confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id='$1 -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
echo $confirm
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$confirm&id=$1" -O $2 && rm -rf /tmp/cookies.txt
@ssi-anik
ssi-anik / Dockerfile
Created July 18, 2021 09:16
xdebug 3, docker integrate with PhpStorm
FROM sirajul/php74-fpm:latest
RUN pecl install xdebug
#RUN docker-php-ext-enable xdebug
RUN mkdir -p /home/xdebug
COPY ./docker/php/xdebug-debug.ini /home/xdebug/xdebug-debug.ini
COPY ./docker/php/xdebug-default.ini /home/xdebug/xdebug-default.ini
COPY ./docker/php/xdebug-off.ini /home/xdebug/xdebug-off.ini
COPY ./docker/php/xdebug-profile.ini /home/xdebug/xdebug-profile.ini
CREATE TEMPORARY TABLE kvstore (
table_name TEXT PRIMARY KEY,
pk_field TEXT,
seq_name TEXT,
skip BOOLEAN default false
);
INSERT into kvstore values ('password_resets', '', '', TRUE); -- skip
INSERT into kvstore values ('permission_role', '', '', TRUE); -- skip
INSERT into kvstore values ('role_user', '', '', TRUE); -- skip
@ssi-anik
ssi-anik / .travis.yml
Last active January 19, 2022 09:36 — forked from willprice/.travis.yml
How to set up TravisCI for projects that push back to github
# Ruby is our language as asciidoctor is a ruby gem.
lang: ruby
before_install:
- sudo apt-get install pandoc
- gem install asciidoctor
script:
- make
after_success:
- .travis/push.sh
env:
@ssi-anik
ssi-anik / AuthServiceProvider.php
Created July 22, 2020 17:05
A: jwt-auth with otp
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
public function register () {
$this->app['auth']->provider('otp-based-auth-provider', function ($app, array $config) {
@ssi-anik
ssi-anik / MemberUserProvider.php
Created July 22, 2020 16:14
A: jwt-auth with otp
<?php
namespace App\Providers;
use App\Models\Member;
use Exception;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Contracts\Auth\UserProvider;
class MemberUserProvider implements UserProvider
@ssi-anik
ssi-anik / Member.php
Created July 22, 2020 16:08
A: jwt-auth with otp
<?php
namespace App\Models;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Tymon\JWTAuth\Contracts\JWTSubject;
class Member extends Model implements JWTSubject, Authenticatable
{
@ssi-anik
ssi-anik / docker-compose.yml
Last active July 10, 2020 21:03
docker compose for Elasticsearch, Kibana, APM 6.8 & APM 7.8
version: "2"
services:
php:
build:
dockerfile: php.dockerfile
context: .
volumes:
- .:/app
ports: