Skip to content

Instantly share code, notes, and snippets.

View enishant's full-sized avatar

Nishant Vaity enishant

View GitHub Profile
@enishant
enishant / .gitignore
Created January 17, 2024 13:49
.gitignore for WordPress
# Ignore Mac DS_Store files
.DS_Store
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except:
# plugins, and themes directories
wp-content/*
[Rasa]
Referece:
https://docs.anaconda.com/anaconda/install/linux/
{Prerequisites}
sudo apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6
{Anaconda}
conda create --name restabot python=3.7
wp core download --path=/var/www/html/wordpress --locale=en_US
cd /var/www/html/wordpress
wp config create --dbname=wordpress --dbuser=root --dbpass=root --locale=en_US
wp core install --url=http://localhost/wordpress --title=wordpress --admin_user=admin --admin_password=admin --admin_email=user@example.com
wp plugin delete hello akismet
@enishant
enishant / algos.php
Created October 28, 2022 05:23
Algos PHP
<?php
$string = 'Lorem Ipsum is simply dummied text of the printing and typesetting industry.';
echo $algo . ' # ' . hash('sha256', $string) . '<hr>';
foreach(hash_algos() as $algo)
{
echo $algo . ' # ' . hash($algo, $string) . '<br>';
}
?>
@enishant
enishant / wait-function.js
Created June 29, 2022 08:30 — forked from ramonvictor/wait-function.js
Fancy setTimeout wrapper using native Promise.
var wait = function(ms) {
ms = ms || 500;
return new Promise(function(resolve, reject){
window.setTimeout(function() {
resolve();
}, ms);
});
};
// USAGE
<?php
function ngrok_fetch($request='',$apiKey='',$method='GET', $postdata=array())
{
$headers = [
'authorization: Bearer ' . $apiKey,
'ngrok-version: 2'
];
if(empty($postdata) === false)
{
@enishant
enishant / phpcs.sh
Created April 6, 2022 11:44
Looping phpcbf & phpcs for Magento2 standard
#!/bin/bash
while :
do
echo "Press [CTRL+C] to stop.."
~/magento-coding-standard/vendor/bin/phpcbf --standard=Magento2 .
~/magento-coding-standard/vendor/bin/phpcs --standard=Magento2 .
sleep 60
clear
done
@enishant
enishant / outline-text.css
Created March 11, 2022 07:58
Outline Text CSS
.outline-text {
font-size: 200px;
-webkit-text-stroke: 1px #FFF;
color: transparent;
-webkit-font-smoothing: subpixel-antialiased;
-webkit-text-fill-color: transparent;
}
@enishant
enishant / magento.sh
Last active March 15, 2023 13:23
Magento:Upgrade modules, Compile code, Deploy static content, Flush cache
#!/bin/bash
echo "---| Set base directory path |---"
MAGENTO=$(basename $(pwd))
cd /Applications/MAMP/htdocs/magento/$MAGENTO
echo "---| Set PHP base path |---"
PHP_BASE_PATH="/Applications/MAMP/bin/php"
echo "---| Updating PHP path |---"
@enishant
enishant / internet.js
Created October 18, 2020 01:40
Connect / Disconnect internet (for changing IP address) and open URL and exit it (written for iBall Baton)
var myWindow;
function connectInternet() {
var mainFrame = document.getElementsByName('mainFrame');
var childFrame = mainFrame[0].contentDocument;
childFrame.getElementById('Connect').click();
}
function disconnectInternet() {
var mainFrame = document.getElementsByName('mainFrame');