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 / script
Created September 13, 2022 06:21
Create symlink for plugin in wordpress development
/*
* Given the repository for the 'WordPress Plugin Boilerplate' and knowing that the actual
* plugin resides in the `plugin-name` directory, then you'd need to do the following:
*
* 1. Navigate to `wp-content/plugins`
* 2. Execute the following terminal command:
*/
> ln -s WordPress-Plugin-Boilerplate/plugin-name/ plugin-name
@savankaneriya
savankaneriya / pdf_2_html.py
Created September 9, 2022 12:22 — forked from ivandeex/pdf_2_html.py
convert pdf to html or xml
# https://github.com/scraperwiki/pdfminer/blob/scraperwiki/tools/pdf2html.cgi
import pdfminer
from pdfminer.pdfinterp import PDFResourceManager, process_pdf
from pdfminer.converter import HTMLConverter, TextConverter
from pdfminer.layout import LAParams
rsrcmgr = PDFResourceManager()
laparams = LAParams()
converter = HTMLConverter if format == 'html' else TextConverter
device = converter(rsrcmgr, out_file, codec='utf-8', laparams=laparams)
process_pdf(rsrcmgr, device, in_file, pagenos=[1,3,5], maxpages=9)
@savankaneriya
savankaneriya / gzip.conf
Created October 30, 2021 08:25
GZIP configuration for nginx
# enables GZIP compression
gzip on;
# compression level (1-9)
# 6 is a good compromise between CPU usage and file size
gzip_comp_level 6;
# minimum file size limit in bytes to avoid negative compression outcomes
gzip_min_length 256;
@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.

@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 / 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 / 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 / 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 / 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