Skip to content

Instantly share code, notes, and snippets.

View accessomnath's full-sized avatar
🎯
Focusing

Somnath Mondal accessomnath

🎯
Focusing
View GitHub Profile
@accessomnath
accessomnath / Wordpress Theme extainsion
Created July 16, 2017 13:11
This file is create a extaintion for your wordpress theme option like option tree.
<?php
// create custom plugin settings menu
add_action('admin_menu', 'plugin_create_menu');
function plugin_create_menu()
{
//create new top-level menu
add_menu_page('Theme Setting', 'Theme Setting', 'administrator', __FILE__, 'theme_setting', 'dashicons-admin-settings');
jQuery(document).ready(function (a) {
a("form#login1").on("submit", function (b) {
a("form#login1 p.status").show().text(ajax_login_object.loadingmessage), a.ajax({
type: "POST",
dataType: "json",
url: ajax_login_object.ajaxurl,
data: {
action: "ajaxlogin",
username: a("form#login1 #username").val(),
password: a("form#login1 #password").val(),
<?php
/**
* Created by PhpStorm.
* User: SOMNATH
* Date: 24-03-2017
* Time: PM 12:32
* Template Name: Login
*/
if($_POST) {
<?php
/**
* Created by PhpStorm.
* User: SOMNATH
* Date: 30-03-2017
* Time: PM 12:56
* Template Name: Process
*/
global $post;
global $wpdb;
@accessomnath
accessomnath / cpt extaintion
Created August 12, 2017 14:32
Adding two extra image field in cpt in wordpress
<?php
//init the meta box
add_action('after_setup_theme', 'custom_postimage_setup');
function custom_postimage_setup()
{
add_action('add_meta_boxes', 'custom_postimage_meta_box');
add_action('save_post', 'custom_postimage_meta_box_save');
}
@accessomnath
accessomnath / getmap.js
Last active February 23, 2018 18:56
Road distance distance in two point in google maps
<script type="text/javascript"
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyAdVNlPdWIf1qPRQfkxgDsxwvcs0EO2I5c&libraries=places"></script>
<script type="text/javascript">
var autocomplete = new google.maps.places.Autocomplete($("#map")[0], {});
var autocompleteSecond = new google.maps.places.Autocomplete($("#map2")[0], {});
var autocompletethird = new google.maps.places.Autocomplete($("#map3")[0], {});
function initialize() {
google.maps.event.addListener(autocomplete, 'place_changed', function () {
fillInAddress();
@accessomnath
accessomnath / administration directory
Created December 3, 2017 17:44
I Could not get lock /var/lib/apt/lists/lock - open (11: Resource temporarily unavailable)
sudo fuser -vki /var/lib/dpkg/lock
sudo fuser -vki /var/cache/apt/archives/lock
sudo fuser -vki /var/cache/debconf/config.dat
sudo dpkg --configure -a
@accessomnath
accessomnath / up-to date node package manager
Created December 3, 2017 18:00
upgrading npm package
sudo npm install npm@latest -g
@accessomnath
accessomnath / pass
Created December 3, 2017 20:33
pass
dd@32@ata