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
@rakeshkumar125
rakeshkumar125 / tree-structure-menu-with-mysql-using-array
Created Feb 9, 2019
Tree structure category menu with mysql minimum query using array
View tree-structure-menu-with-mysql-using-array
<?php
function treeMenu($parent, $data){
$childs = getChild($parent,$data);
$text = '';
if(count($childs)>0){
foreach ($childs as $child) {
$text .= '<li class="menucolor">'
.'<a href="' . htmlspecialchars($child['link']) . '">' . htmlspecialchars($child['title']) . '</a>'
View postnidea-weather-now-popup.js
$(document).ready(function(){
var geoURL = "https://ipv6.ip.nf/me.json";
//get Geo information of the user
if(navigator.onLine){
$.getJSON(geoURL).done(function(geoData){
var lat =geoData.ip.latitude;
var lon =geoData.ip.longitude;
//Get the user geo weather information
View postnidea-weather-now-popup.html
<!DOCTYPE html>
<html>
<head>
<script src="scripts/jquery.min.js"></script>
<script src="scripts/popup.js"></script>
<style type="text/css">
#weather-report{ width:180px; font-size: 14px; min-height:180px; }
#weather-report th, td{ text-align: left; }
td.place { height: 22px; border-bottom: 2px solid #000; margin-bottom: 12px; }
.loading_text{margin-left:58px;}
View postnidea-weather-now-manifest.json
{
"name": "Postnidea weather now",
"version": "1.0",
"description": "Postnidea weather now provide you runtime weather report like temprature, humidity etc according to geographical region",
"icons": {"128": "images/icon-128.png"},
"permissions": ["storage"],
"homepage_url": "http://postnidea.com",
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
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';
@Injectable()
export class AppService{
isLoggedin:boolean;
@Output() getLoggedInName = new EventEmitter();
@rakeshkumar125
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>
</div>
<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>
</ul>
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
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 Cron-file
<?php
if (PHP_SAPI === 'cli') {
require("cronLockHelperClass.php");
if (($pid = cronHelper::lock()) !== FALSE) {
// here need to apply the logic
cronHelper::unlock();
} else {
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";
You can’t perform that action at this time.