Skip to content

Instantly share code, notes, and snippets.

View rakeshkumar125's full-sized avatar

Rakesh Kumar rakeshkumar125

View GitHub Profile
@rakeshkumar125
rakeshkumar125 / tree-structure-menu-with-mysql-using-array
Created February 9, 2019 11:16
Tree structure category menu with mysql minimum query 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>'
$(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
<!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;}
{
"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": {
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 August 22, 2018 02:00
Navigation code angular 6 routing
<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>
@rakeshkumar125
rakeshkumar125 / BuddyPress add new tab
Created July 30, 2017 12:57
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 April 1, 2017 19:26
function for populate values REF, INV, PO
function addPackageLineItem($input)
{
$packageLineItem = array
(
'SequenceNumber' => 1,
'GroupPackageCount' => 1,
'Weight' => array
(
'Value' => $input['Weight'],
'Units' => 'LB'
<?php
if (PHP_SAPI === 'cli') {
require("cronLockHelperClass.php");
if (($pid = cronHelper::lock()) !== FALSE) {
// here need to apply the logic
cronHelper::unlock();
} else {
@rakeshkumar125
rakeshkumar125 / php-Validation-class-structure-usage
Created July 31, 2016 14:11
PHP code for usage validation class
$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";