Skip to content

Instantly share code, notes, and snippets.

View savankaneriya's full-sized avatar
💻
Working on Something

savan kaneriya savankaneriya

💻
Working on Something
View GitHub Profile
@savankaneriya
savankaneriya / Middleware\Role.php
Last active December 28, 2018 07:50
Role middleware which accepts more than one role in laravel
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class Role
{
/**
* Handle an incoming request.
*
@savankaneriya
savankaneriya / clean-special-characters-or-garbage-characters-from-string.php
Last active June 29, 2018 10:53
clean special characters or garbage characters from string to UTF-8 encoding
function cleanString($text) {
$utf8 = array(
'/[áàâãªä]/u' => 'a',
'/[ÁÀÂÃÄ]/u' => 'A',
'/[ÍÌÎÏ]/u' => 'I',
'/[íìîï]/u' => 'i',
'/[éèêë]/u' => 'e',
'/[ÉÈÊË]/u' => 'E',
@savankaneriya
savankaneriya / Install-ImageMagick
Last active July 14, 2018 06:49
Install ImageMagick in windows , ubuntu or mac
Installing ImageMagick
In this topic you will find the basic steps you need to take in order to make sure all KTML image editing features are working fine. This includes the installation of the ImageMagick library for both Unix and Windows systems.
Note: The steps depicted in this topic are accurate and available at the time of this writing. For up-to-date instructions on how to install the latest ImageMagick version available, check out the product's installation instructions - online, or in the downloaded package.
Installing ImageMagick on Windows-based systems
@savankaneriya
savankaneriya / bash-command-to-desable-creative-cloud-in-mac
Last active September 14, 2018 09:14
Command to disable Adobe Creative Cloud in mac
Command to disable Adobe Creative Cloud running automatically on Mac startup:
launchctl unload -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
Command to re-enable:
launchctl load -w /Library/LaunchAgents/com.adobe.AdobeCreativeCloud.plist
@savankaneriya
savankaneriya / add_bootstrap_V4_to_plugin_or_theme.php
Created October 22, 2018 07:21
Enqueue bootstrap-V4.1 to plugin or theme
/* Enqueue bootstrap-V4.1 to plugin or theme */
function addBootStrapSupport($hook,$pageSlugs=array()){
//dd($hook,$pageSlugs);
if(is_array($pageSlugs)&& !empty($pageSlugs)){
$page = explode('_',$hook);
if(!in_array(end($page),$pageSlugs)){
return;
}
}
wp_enqueue_style(
@savankaneriya
savankaneriya / add_bootstrap_support_in_wordpress_plugin_or_theme.php
Created October 22, 2018 07:25
Enqueue bootstrap-V4.1 to plugin or theme
/* Enqueue bootstrap-V4.1 to plugin or theme */
function addBootStrapSupport($hook,$pageSlugs=array()){
//dd($hook,$pageSlugs);
if(is_array($pageSlugs)&& !empty($pageSlugs)){
$page = explode('_',$hook);
if(!in_array(end($page),$pageSlugs)){
return;
}
}
wp_enqueue_style(
@savankaneriya
savankaneriya / update-PHP-70-to-72.sh
Last active November 21, 2018 05:28 — forked from jakeydevs/update.sh
script to Update PHP 7.0 to 7.2
#! /bin/bash
# Please only run IF YOU ARE SURE YOU SHOULD!
#
# This script will remove PHP and attempt to install the latest
# "Stable" version! To help me with LARAVEL installations, it'll
# also install composer and turn on mod_rewrite as well if it cannot
# be sure it is installed
#
# @author @JakeLPrice
@savankaneriya
savankaneriya / install memcached
Created January 23, 2019 04:48
How to install memcached in php 7.2
pecl install memcached
When you are shown the prompt :
libmemcached directory [no] :
answer with :
no --disable-memcached-sasl
@savankaneriya
savankaneriya / git-live-server-deployment.md
Last active September 12, 2020 13:44 — forked from noelboss/git-deployment.md
Simple automated GIT Deployment using Hooks

Simple automated GIT Deployment using GIT Hooks

Here are the simple steps needed to create a deployment from your local GIT repository to a server based on this in-depth tutorial.

How it works

You are developing in a working-copy on your local machine, lets say on the master branch. Most of the time, people would push code to a remote server like github.com or gitlab.com and pull or export it to a production server. Or you use a service like deepl.io to act upon a Web-Hook that's triggered that service.