Skip to content

Instantly share code, notes, and snippets.

View neps-in's full-sized avatar

Napoleon Arouldas neps-in

View GitHub Profile
@neps-in
neps-in / expertrec-embed-code.html
Last active December 25, 2021 16:07
Expertrec custom search embed code
<!-- paste the entire code where you would be using your search box -->
<script type="text/javascript">
(function() {
// Get your API Key at expertrec.com by creating a free account.
var id = 'your_api_key';
var ci_search = document.createElement('script');
ci_search.type = 'text/javascript';
ci_search.async = true;
ci_search.src = 'https://cse.expertrec.com/api/js/ci_common.js?id=' + id;
@neps-in
neps-in / rdempty.cmd
Created December 19, 2021 17:35
rdempty.cmd Delete empty directory
for /f "usebackq" %%d in (`"dir /ad/b/s | sort /R"`) do rd "%%d"
@neps-in
neps-in / changemode.bat
Last active December 19, 2021 17:29
changemode.bat Change console mode to display as in old DOS Mode to 25 Lines and 80 Columns.
@ECHO OFF
REM ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
REM
REM FILENAME : DOSMODE.BAT
REM
REM DESCRIPTION : Change console mode to display as in old DOS Mode
REM
REM AUTHOR : Napoleon Arouldas S. ([email protected])
REM
REM WEB : http://neps.in
@neps-in
neps-in / explode-cool.php
Created October 7, 2019 05:15
explode can use words as delimiters
<?php
//Even words can be use as delimiters in php explode function.
$s = 'Napoleon and Arouldas';
$s_pieces = explode('and', $s);
$rating = $s_pieces[0];
$review_count = $s_pieces[1];
@neps-in
neps-in / change_baseurl_wordpress
Last active September 23, 2019 09:35
set base_url of wordpress using mysql commandline or phpmyadmin
-- Mysql commandline option to change the baseurl or siteur or home url of a wordpress website
-- This option will be handy, when you are not able to loging to admin panel of wordpress website.
update wp_options set option_value='http://newwebsite.com' where option_name = 'siteurl';
update wp_options set option_value='http://newwebsite.com' where option_name = 'home';
/* Courtesy : https://dev.to/gajus/my-favorite-css-hack-32g3 */
* { background-color: rgba(255,0,0,.2); }
* * { background-color: rgba(0,255,0,.2); }
* * * { background-color: rgba(0,0,255,.2); }
* * * * { background-color: rgba(255,0,255,.2); }
* * * * * { background-color: rgba(0,255,255,.2); }
* * * * * * { background-color: rgba(255,255,0,.2); }
@neps-in
neps-in / viewport-info.js
Created September 7, 2019 12:43
How to find viewport height, viewport width using JavaScript
// This snippet will get the width, height of the viewport everytime you resize the browser window.
// The weight, height will be displayed on console window.
$(document).ready(function(){
var viewportWidth = $(window).width();
var viewportHeight = $(window).height();
console.info('Viewport W = ' + viewportWidth);
console.info('Viewport H = ' + viewportHeight);
@neps-in
neps-in / sampleREADME.md
Created June 21, 2019 17:49 — forked from FrancesCoronel/sampleREADME.md
A sample README for all your GitHub projects.

FVCproductions

INSERT GRAPHIC HERE (include hyperlink in image)

Repository Title Goes Here

Subtitle or Short Description Goes Here

@neps-in
neps-in / privacy-policy-woocommerce.php
Last active May 29, 2019 17:08
PHP Snippet: Add Privacy Policy Acceptance Checkbox @ WooCommerce Checkout
/**
* @snippet Add privacy policy tick box at checkout
* @how-to Watch tutorial @ https://businessbloomer.com/?p=19055
* @author Rodolfo Melogli
* @compatible WooCommerce 3.6.3
* @donate $9 https://businessbloomer.com/bloomer-armada/
*/
// Add this code where ?
// You can place PHP snippets at the bottom of your child theme functions.php file (before "?>
@neps-in
neps-in / delete-all-woocommerce-products.php
Created May 29, 2019 11:16 — forked from mikaelz/delete-all-woocommerce-products.php
Remove all WooCommerce products from database via SQL
<?php
require dirname(__FILE__).'/wp-blog-header.php';
$wpdb->query("DELETE FROM wp_terms WHERE term_id IN (SELECT term_id FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%')");
$wpdb->query("DELETE FROM wp_term_taxonomy WHERE taxonomy LIKE 'pa_%'");
$wpdb->query("DELETE FROM wp_term_relationships WHERE term_taxonomy_id not IN (SELECT term_taxonomy_id FROM wp_term_taxonomy)");
$wpdb->query("DELETE FROM wp_term_relationships WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation'))");
$wpdb->query("DELETE FROM wp_posts WHERE post_type IN ('product','product_variation')");