Skip to content

Instantly share code, notes, and snippets.

Sumit Pore sumitpore

Block or report user

Report or block sumitpore

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View email-link-issue.patch
View nginx-service.sh
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@sumitpore
sumitpore / .env
Last active Oct 26, 2019
Postcss Based Project Starter Kit. I name primary postcss file as 'main.pcss' or index.pcss. Files ending with pcss extension are converted to css file
View .env
NODE_ENV=development
View class-nonce.php
<?php
/**
* This class does the operations related to Nonce
*
* It takes care of creating a nonce & verifying a nonce
*
* Example
*
* STEP 1 - CREATION OF NONCE:
* <code>
@sumitpore
sumitpore / readme.md
Last active Jun 5, 2019
Image with Caption in Github Readme
View readme.md
| ![Image Alt Text](https://image_url) |
|:--:|
| *Image Caption* |
@sumitpore
sumitpore / convert-zip-structure-to-associative-array.php
Last active May 11, 2019
Convert Zip Structure to Associative Array using PHP
View convert-zip-structure-to-associative-array.php
<?php
/**
* Borrowed from https://stackoverflow.com/a/38407568/1994640
*
* Fixed fatal errors and unwanted creation of empty arrays
*/
$filePath = 'hello.zip';
$za = new ZipArchive();
if ($za->open($filePath) !== true) { // check for the zip archive
View xdebug.ini
zend_extension=xdebug.so
xdebug.profiler_enable=0
xdebug.profiler_enable_trigger=1
xdebug.trace_enable_trigger=1
xdebug.trace_format=1
xdebug.collect_params=4
xdebug.collect_return=1
xdebug.show_mem_delta=1
xdebug.auto_trace=0
xdebug.profiler_output_dir=/tmp
View gist:73ec89098f4c5ac4f9befcaca89b7287
<?php
if ( !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' )
{
# Ex. check the query and serve requested data
}
@sumitpore
sumitpore / gist:1777cbf54693091d95f1f1ee231eeb34
Created Apr 14, 2019
Keywords to use in code to ignore WordPress rules when it makes no sense
View gist:1777cbf54693091d95f1f1ee231eeb34
// @codingStandardsIgnoreLine. -> Ignore One Line
// @codingStandardsIgnoreStart. -> Start Ignoring Piece of Code
// @codingStandardsIgnoreEnd. -> End Ignoring Piece of Code. #2 & #3 are used in conjunction to ignore a block of code.
// WPCS: XSS OK. -> Suppress XSS warning. Use only when you know that the text is safe
@sumitpore
sumitpore / gist:f23c0532eb06af0cd8aea71c3beb72b6
Created Mar 22, 2019
Command to list all Services Running on Different Ports
You can’t perform that action at this time.