Skip to content

Instantly share code, notes, and snippets.

View kenkaigu's full-sized avatar

kenkaigu

  • nairobi
View GitHub Profile
?php
/**
* Code: Hide A Particular Admin Account From Wordpress User List
* Description: Hide user from other users list. Useful for secuity purpose
* Author: Aadarsh K Jajoria
* Site URL: https://adlivetech.com/blog
* Requires at least: 3.5
* Tested up to: 4.7
*/
@kenkaigu
kenkaigu / node_nginx_ssl.md
Created June 30, 2022 22:18 — forked from bradtraversy/node_nginx_ssl.md
Node app deploy with nginx & SSL

Node.js Deployment

Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt

1. Sign up for Digital Ocean

If you use the referal link below, you get $10 free (1 or 2 months) https://m.do.co/c/5424d440c63a

2. Create a droplet and log in via ssh

I will be using the root user, but would suggest creating a new user

@kenkaigu
kenkaigu / notify-on-new-post.php
Created January 15, 2022 18:27 — forked from vdite/notify-on-new-post.php
Send an email notification to the Wordpress administrator when a new post is published.
<?php
/**
Plugin Name: Alert Admin on new Post
Plugin URI: http://wordpress.stackexchange.com/questions/19040/alert-email-when-any-post-or-page-is-changed
Description: Send an email notification to the administrator when a new post is published.
Author: TheDeadMedic, transfered by Viktor Dite
Version: 1.0
Copyright CC share alike
* @param string $new_status
@kenkaigu
kenkaigu / wp-hide-install-plugin.php
Created January 10, 2022 04:12 — forked from sanraul/wp-hide-install-plugin.php
How to Hide Specific plugin from installed plugin list n Wordpress
<?php
/**
* How to Hide Specific plugin from installed plugin list n Wordpress.
*
* @see https://webcusp.com/how-to-hide-specific-plugin-from-installed-plugin-list/
*/
function appc_secret_plugins() {
global $wp_list_table;
@kenkaigu
kenkaigu / functions.php
Created March 7, 2021 00:57 — forked from nayemDevs/functions.php
Add new field on vendor product upload form in Dokan
/*
* Adding extra field on New product popup/without popup form
*/
add_action( 'dokan_new_product_after_product_tags','new_product_field',10 );
function new_product_field(){ ?>
<div class="dokan-form-group">
@kenkaigu
kenkaigu / functions.php
Created January 31, 2021 10:55 — forked from nayemDevs/functions.php
Change Bank withdraw method fields in vendor dashboard settings in Dokan
<?php
/*
You can change any field title or remove any feild for the vendor -> settings -> payment -> bank transfer method. Please note that this
code need to be placed on your child-theme functions.php file
*/
add_filter( 'dokan_withdraw_methods', 'wp1923_change_whithdraw_callback', 12 );
function wp1923_change_whithdraw_callback( $methods ) {
@kenkaigu
kenkaigu / function.php
Created August 6, 2020 05:57 — forked from thebengalboy/function.php
Hide Dokan News Updates on Dashboard
<?php
if ( ! defined( 'ABSPATH') ) exit;
add_action( 'admin_head', 'dokan_dashboard_hide_tab' );
function dokan_dashboard_hide_tab() {
if ( ! is_admin() ) return;
?>
<style type="text/css">
@kenkaigu
kenkaigu / Android Read SMS
Last active January 6, 2020 18:46 — forked from mcobunga/Android Read SMS
Code for reading SMS in android
//add permission Read SMS in android manifest to enable this code to work
// AndroidManifest.xml:
<uses-permission android:name="android.permission.READ_SMS" />
StringBuilder smsBuilder = new StringBuilder();
final String SMS_URI_INBOX = "content://sms/inbox";