You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
Hemant Arora
hemant-tivlabs
I'm a Full Stack Web Developer at TivLabs who likes to write clean and optimized code. Do check out my work on GitLab.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Use modClass instead of jQuery's `addClass` or `removeClass` to save on writing conditional if-else statements
jQuery.modClass()
In my opinion, instead of using the traditional if-else statements to switch CSS classes, using a conditional operator in conjunction with modClass makes the code simpler, easier to read and saves on code lines.
Instead of doing the traditional way:
if (i < 5) {
jQuery('ul').removeClass('many-items');
} else {
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Helps deploy a Gitlab repo to the server location (includes clone and pull upon every commit to master branch)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An .htaccess rewrite helper file that helps pass URI fragments as parameters to a single file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The "SpinerMan" PHP class is capable of processing a nested spintax (spinner text) and retrieve statistical information like max number of variations, holes, min and max words, and much more.
SpinerMan, the spintax processor
A spintax (or simply spinner text) is a specially formatted text that is capable of generating a unique articles (unique combination of words) everytime it is executed and is used popularly as an SEO measure.
SpinerMan is a PHP Class that is capable of processing a spintax and retrieve statistical information like maximum number of variations, holes, minimum and maximum number of words, and much more. It supports nested blocks and parses the input into a tree with details available at every node.
NOTE: This script was written by an unknown JavaScript developer somewhere near 2014, when spintax was a very popular thing. I'm not the original author of this wonderful script. Instead, I have merely converted the script into a PHP class and made it available to the world (thanks to GitHub!).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Execute a shell command via the PHP `shell_exec` function. Please use the file wisely and remove it from live server once the job is done, as this gives complete server shell control and makes your system vulnerable.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters