Skip to content

Instantly share code, notes, and snippets.


Juyal Ahmed tojibon

View GitHub Profile
tojibon /
Created Jan 27, 2022 — forked from tomysmile/
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
tojibon / AppServiceProvider.php
Created Dec 13, 2021 — forked from simonhamp/AppServiceProvider.php
A pageable Collection implementation for Laravel
View AppServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Collection;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
public function boot()
tojibon /
Last active Mar 20, 2020 — forked from skynet/
Upgrade PHP to 7.3 on Amazon Linux (specifically for Elastic Beanstalk but should work elsewhere)
#!/usr/bin/env bash
# Upgrade an Amazon Linux EC2 to PHP 7.3
# Last tested w/ PHP 7.2 AWS Linux version 2.8.5
# Must be ran as sudo:
# sudo bash
# Can be added to ./.ebextensions/20_php.config like so:
# container_commands:
tojibon /
Created Apr 1, 2019 — forked from JamesMGreene/
A comparison of using `git flow` commands versus raw `git` commands.


gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

View app.dockerfile
FROM php:7.0.4-fpm
RUN apt-get update && apt-get install -y libmcrypt-dev \
mysql-client libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick \
&& docker-php-ext-install mcrypt pdo_mysql
apt-key adv --keyserver hkp:// --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
apt-add-repository 'deb ubuntu-xenial main'
apt-get update
apt-get install -y docker-engine
systemctl enable docker
usermod -aG docker ubuntu
curl -o /usr/local/bin/docker-compose -L "$(uname -s)-$(uname -m)"
chmod +x /usr/local/bin/docker-compose
docker-compose -v
tojibon / auto-login-from-reg-email.php
Created Nov 14, 2017 — forked from butlerblog/auto-login-from-reg-email.php
WordPress auto login from native registration email
View auto-login-from-reg-email.php
This code snippet can be added to your functions.php file (without the <?php)
to add a query string to the login link emailed to the user upon registration
which when clicked will validate the user, log them in, and direct them to
the home page.
* This first function is hooked to the 'user_register' action which fires
tojibon / envato-screenshots-downloader.php
Created Nov 14, 2017 — forked from hasinhayder/envato-screenshots-downloader.php
Download large preview images from the envato item's screenshots page
View envato-screenshots-downloader.php
#!/usr/bin/env php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
$dir = $argv[1];
$source = $argv[2];
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';
tojibon / gist:27d5b82ed5d32100d18cbada0bf2e669
Created Aug 4, 2016 — forked from jcsrb/gist:1081548
get avatar from google profiles, facebook, gravatar, twitter, tumblr
View gist:27d5b82ed5d32100d18cbada0bf2e669
function get_avatar_from_service(service, userid, size) {
// this return the url that redirects to the according user image/avatar/profile picture
// implemented services: google profiles, facebook, gravatar, twitter, tumblr, default fallback
// for google use get_avatar_from_service('google', profile-name or user-id , size-in-px )
// for facebook use get_avatar_from_service('facebook', vanity url or user-id , size-in-px or size-as-word )
// for gravatar use get_avatar_from_service('gravatar', md5 hash email@adress, size-in-px )
// for twitter use get_avatar_from_service('twitter', username, size-in-px or size-as-word )
// for tumblr use get_avatar_from_service('tumblr', blog-url, size-in-px )
// everything else will go to the fallback
// google and gravatar scale the avatar to any site, others will guided to the next best version
tojibon / indexed.php
Created Jun 24, 2016 — forked from qsun/indexed.php
Check if URL is indexed by Google
View indexed.php
function indexed($url) {
$url = '' . urlencode($url);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false);
curl_setopt($ch, CURLOPT_NOBODY, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'Chrome 10');