Skip to content

Instantly share code, notes, and snippets.

Rakesh Kumar rakeshkumar125

Block or report user

Report or block rakeshkumar125

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wodpress-add-jquery
function my_init() {
if (!is_admin()) {
wp_register_script('jquery', '', false, '1.3.2', true);
View custom-parameter-wordpress-template
function add_query_vars($aVars) {
$aVars[] = "user_id";
return $aVars;
// hook add_query_vars function into query_vars
add_filter('query_vars', 'add_query_vars');
function add_rewrite_rules($aRules) {
View get-parameter-in-wordpress-template
Template Name: User Template
echo $user_id = ($wp_query->query_vars['user_id'] ? $wp_query->query_vars['user_id'] : '0');
rakeshkumar125 / php-Validation-class-structure
Last active Jul 31, 2016
this class include all rule that can be used for the form validation.
View php-Validation-class-structure
// Class Defination starts here.
// above class include for connect datbase connection
class validator{
var $array_to_validate = "";
var $email = "";
View php-Validation-class-structure-usage
$config = array();
$config['array_to_validate'] = $_POST or array_need_to_validate;
$config['email'] = "email,forgot_email";
$config['required'] = "date_birth,phone,mobile";
$config['numeric'] = "mobile";
$config['positive_numeric'] = "positive_number";
$config['positive_integer'] = "positive_integer";
$config['url'] = "url";
$config['alpha'] = "name";
$config['alphanumeric'] = "user_password";
View Cron-file
if (PHP_SAPI === 'cli') {
if (($pid = cronHelper::lock()) !== FALSE) {
// here need to apply the logic
} else {
rakeshkumar125 / gist:5d33bb1b769f863f61616e651eb7ef58
Created Apr 1, 2017
function for populate values REF, INV, PO
View gist:5d33bb1b769f863f61616e651eb7ef58
function addPackageLineItem($input)
$packageLineItem = array
'SequenceNumber' => 1,
'GroupPackageCount' => 1,
'Weight' => array
'Value' => $input['Weight'],
'Units' => 'LB'
View BuddyPress add new tab
Plugin Name: BuddyPress add new tab
Description: Test case for a bug. When using the Admin subnav, select "Test" and "Test 2" will disappear
Version: 0.6
Author: Rakesh Kumar
function bptt_init() {
class Groups_Test_Tab extends BP_Group_Extension {
rakeshkumar125 / angular 6 navigation
Created Aug 22, 2018
Navigation code angular 6 routing
View angular 6 navigation
<nav class="navbar navbar-inverse navbar-fixed-top">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#">WebSiteName</a>
<ul class="nav navbar-nav navbar-right">
<li routerLinkActive="active"><a routerLink='home'>Home</a></li>
<li routerLinkActive="active"><a routerLink='about'>About</a></li>
<li routerLinkActive="active"><a routerLink='contact'>Contact</a></li>
View angular 6 service file
import { Injectable, EventEmitter, Output } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { Response } from "@angular/http";
import { Observable } from 'rxjs';
import 'rxjs/add/operator/map';
export class AppService{
@Output() getLoggedInName = new EventEmitter();
You can’t perform that action at this time.