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
@ssi-anik
ssi-anik / composer.json
Created July 9, 2017 12:53 — forked from andyshinn/composer.json
Docker Compose PHP Composer Example
{
"require": {
"mfacenet/hello-world": "v1.*"
}
}
@ssi-anik
ssi-anik / PageLockerMiddleware.php
Last active July 10, 2017 06:31
Middleware for locking page
<?php
namespace App\Http\Middleware;
use Closure;
class PageLockerMiddleware
{
/**
* Handle an incoming request.
@ssi-anik
ssi-anik / Readme.md
Last active November 25, 2017 15:54
Install PHPStorm, Webstorm, PyCharm on Ubuntu 16.04 - Through terminal/bash/zsh

Remove OpenJDK and install Oracle JAVA

  1. sudo apt-get remove openjdk*
  2. sudo add-apt-repository ppa:webupd8team/java
  3. sudo apt-get update
  4. sudo apt-get install java-common oracle-java8-installer
  5. sudo apt-get install oracle-java8-set-default source /etc/profile

Install PhpStorm

  1. tar xvf PhpStorm-VERSION_NUMBER.tar.gz
Route::get('redis', array('as' => 'cache', 'do' => function()
{
$redis = Redis::connection();
//STRING
$redis->set('name', 'Taylor');
$name = $redis->get('name');
// LIST
// A list is a series of ordered values. Some of the important commands for interacting with lists are RPUSH, LPUSH, LLEN, LRANGE, LPOP, and RPOP.
@ssi-anik
ssi-anik / PhpStorm Keyboard Shortcuts.md
Created August 10, 2017 13:15 — forked from koomai/PhpStorm Keyboard Shortcuts.md
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

@ssi-anik
ssi-anik / Dockerfile
Created August 30, 2017 12:15
apache-docker-php
FROM php:7.1.8-apache
RUN apt-get update && apt-get install -y mcrypt
# Configuring Apache
ADD apache/apache2.conf /etc/apache2/sites-available/000-default.conf
RUN /bin/ln -sf ../sites-available/000-default.conf /etc/apache2/sites-enabled/000-default.conf
# Enable rewrite module
RUN a2enmod rewrite
version: '2'
services:
nginx:
image: nginx:1.13.3
ports:
- 8001:80
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
volumes_from:
@ssi-anik
ssi-anik / Egghead-Downloader.md
Last active April 20, 2018 09:45
Egghead video downloader
  1. Go to your expected directory where you want your files to be downloaded.
  2. Open the directory in terminal.
  3. Run lynx -dump http://EGGHEADURL.tld | awk '/lessons\//{print $2}' | awk '!a[$0]++' | sed '/\?/d' > links1.txt replace the URL.
  4. Run youtube-dl -c -i -o "%(autonumber)s-%(title)s.%(ext)s" -a links.txt --external-downloader aria2c --external-downloader-args "-j1 -x16 -s16 -k1M" in your terminal.
  5. Wait for the download to finish.

Moreover, BUY egghead subscriptions.

Source:

<?php
namespace App\Providers;
use App\Extensions\AccessTokenGuard;
use App\Extensions\TokenToUserProvider;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Illuminate\Support\Facades\Auth;
class AuthServiceProvider extends ServiceProvider
<?php namespace App\Extensions;
use Illuminate\Auth\GuardHelpers;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Contracts\Auth\UserProvider;
use Illuminate\Http\Request;
class AccessTokenGuard implements Guard
{
use GuardHelpers;