Skip to content

Instantly share code, notes, and snippets.

View CmdrMahesh's full-sized avatar
💭
Coding

CmdrMahesh

💭
Coding
View GitHub Profile
@CmdrMahesh
CmdrMahesh / functions.php
Created November 12, 2019 08:25 — forked from corsonr/README.md
WooCommerce: redirect user upon coupon removal
<?php // Do not include this if already open! Code goes in theme functions.php.
/*
* Redirects user to a specific page upon coupon removal.
*/
function action_woocommerce_removed_coupon( $coupon_code ) {
// Redirection...
wp_redirect( $url ); // Replace $url by your page URL.
exit;
};
Key Sublime Text 3.2.1 Build 3207
----- BEGIN LICENSE -----
Member J2TeaM
Single User License
EA7E-1011316
D7DA350E 1B8B0760 972F8B60 F3E64036
B9B4E234 F356F38F 0AD1E3B7 0E9C5FAD
FA0A2ABE 25F65BD8 D51458E5 3923CE80
87428428 79079A01 AA69F319 A1AF29A4
A684C2DC 0B1583D4 19CBD290 217618CD
@CmdrMahesh
CmdrMahesh / dumpdatabases.py
Created November 17, 2019 13:37 — forked from hugowetterberg/dumpdatabases.py
Small script to dump all local mysql databases
#!/usr/bin/env python
import os
import re
import subprocess
user="onlyme"
password="xxxxxxx"
proc = subprocess.Popen(["mysql", "-u" + user, "-p" + password],
stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr = subprocess.PIPE)
@CmdrMahesh
CmdrMahesh / gist:5642e577dfe2a68a1cdf68ddb58c7c23
Created February 10, 2020 09:25 — forked from henriquemoody/http-status-codes.php
List of HTTP status codes in PHP
<?php
/**
* Content from http://en.wikipedia.org/wiki/List_of_HTTP_status_codes
**/
return array(
100 => 'Continue',
101 => 'Switching Protocols',
102 => 'Processing', // WebDAV; RFC 2518
200 => 'OK',
@CmdrMahesh
CmdrMahesh / mediaqueries.css
Created February 12, 2020 11:14 — forked from phuphighter/mediaqueries.css
Semantic UI friendly media queries
/* Mobile */
@media only screen and (max-width: 767px) {
[class*="mobile hidden"],
[class*="tablet only"]:not(.mobile),
[class*="computer only"]:not(.mobile),
[class*="large screen only"]:not(.mobile),
[class*="widescreen only"]:not(.mobile),
[class*="or lower hidden"] {
display: none !important;
}
@CmdrMahesh
CmdrMahesh / gist:062829690855e52fd42596c3301df1db
Created December 5, 2020 10:01 — forked from vxnick/gist:380904
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@CmdrMahesh
CmdrMahesh / host-react-app-on-apache-server.md
Created August 5, 2021 03:29 — forked from ywwwtseng/host-react-app-on-apache-server.md
Host react application on Apache server

Host react application on Apache server

Step 1 : Create your app

$ npm install -g create-react-app 
$ create-react-app my-app

Step 2 : Build it for production

jQuery('#ai1wm-backups-list').on('click', '.ai1wm-backup-restore', function (e) {
e.preventDefault();
var modelimport = new Ai1wm.Import();
var storage = Ai1wm.Util.random(12);
var options = Ai1wm.Util.form('#ai1wm-backups-form').concat({ name: 'storage', value: storage }).concat({ name: 'archive', value: jQuery(this).data('archive') });
// Set global params
modelimport.setParams(options);
import React, { Component } from 'react';
export default class CanvasRing extends Component {
constructor(props) {
super(props);
}
initrender(){
const canvas = ReactDOM.findDOMNode(this.refs.canvas_ring);
<?php
/**
* Plugin Name: Conditional Payment Gateway
* Description: Conditional Payment Gateway
* Version: 1.0
*/
defined( 'ABSPATH' ) || exit;
add_action( 'plugins_loaded',function(){