Skip to content

Instantly share code, notes, and snippets.

View apurbajnu's full-sized avatar
🏠
Working from home

Apurba Podder apurbajnu

🏠
Working from home
  • Bangladesh , Dhaka
View GitHub Profile
@apurbajnu
apurbajnu / LICENSE
Last active August 29, 2015 14:27 — forked from ourmaninamsterdam/LICENSE
Arrayzing - The JavaScript array cheatsheet
The MIT License (MIT)
Copyright (c) 2015 Justin Perry
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
@apurbajnu
apurbajnu / PhpStorm Keyboard Shortcuts.md
Created November 30, 2015 10:28 — forked from koomai/PhpStorm Keyboard Shortcuts.md
Frequently Used PhpStorm Keyboard Shortcuts

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).

<?php
function add_cat_meta_box($options){
$tax_meta = array();
$tax_meta[] = array(
'id' => 'custom_taxonomy_options',
'taxonomy' => 'doc-category', // category, post_tag or your custom taxonomy name
// begin: fields
'fields' => array(
// begin: a field
{
"Kwajalein":"(GMT-12:00) International Date Line West",
"Pacific\/Midway":"(GMT-11:00) Midway Island",
"Pacific\/Samoa":"(GMT-11:00) Samoa",
"Pacific\/Honolulu":"(GMT-10:00) Hawaii",
"America\/Anchorage":"(GMT-09:00) Alaska",
"America\/Los_Angeles":"(GMT-08:00) Pacific Time (US & Canada)",
"America\/Tijuana":"(GMT-08:00) Tijuana, Baja California",
"America\/Denver":"(GMT-07:00) Mountain Time (US & Canada)",
"America\/Chihuahua":"(GMT-07:00) Chihuahua",
@apurbajnu
apurbajnu / countries.json
Created June 2, 2018 01:11 — forked from erdem/countries.json
Country list as JSON format. fields: name, coordinates, timezones, country code and capital resource: https://github.com/mledoze/countries
[
{
"timezones": [
"America/Aruba"
],
"latlng": [
12.5,
-69.96666666
],
"name": "Aruba",
@apurbajnu
apurbajnu / test_json
Created March 11, 2020 06:29
Bid Json
'[{"270":{"bid":27},"371":{"bid":17},"421":{"bid":25},"275":{"bid":14},"366":{"bid":22}},{"270":{"name":"Arif","email":"arif@gmail.com"},"371":{"name":"robin","email":"robin@gmail.com"},"421":{"name":"sujon","email":"sujon@gmail.com"},"275":{"name":"Mike","email":"mike@gmail.com"},"366":{"name":"subal","email":"subal@gmail.com"}}]'
@apurbajnu
apurbajnu / package.json
Last active December 21, 2020 03:03
Webpack config
{
"name": "destinyflg",
"version": "1.0.0",
"description": "> A Modern WordPress Starter Theme for savvy Developers",
"main": "webpack.config.js",
"dependencies": {
"datatables.net": "^1.10.20",
"datatables.net-buttons": "^1.5.4",
"datatables.net-buttons-se": "^1.5.4",
"datatables.net-dt": "^1.10.20",
@apurbajnu
apurbajnu / webpack.config.js
Last active December 23, 2020 18:09
webpack config
var webpack = require('webpack');
const path = require('path');
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const isDevelopment = process.env.NODE_ENV === 'development'
module.exports =
{
"mode": "production",
"entry": {
"/assets/dist/js/admin/expert-jobs.js": "./assets/src/scripts/admin/expert-jobs.js",
"/assets/dist/js/admin/expert-payments.js": "./assets/src/scripts/admin/expert-payments.js",
public function do_job_report()
{
// First check the nonce, if it fails the function will break
// check_ajax_referer( 'expert-report-nonce', '_wpnonce' );
$img_id = 0;
$img_ids = [];
if(is_uploaded_file($_FILES['report_image']['tmp_name'][0])):
foreach($_FILES["report_image"]["tmp_name"] as $key=>$tmp_name) {
$file_name=$_FILES["report_image"]["name"][$key];
if($key>0){
@apurbajnu
apurbajnu / Big file upload php in chunk in ajax
Created April 21, 2020 17:13
Upload big file in chunk with ajax
if (isset($_FILES['upload'])) {
$target_path = __DIR__.'/upload/';
$tmp_name = $_FILES['upload']['tmp_name'];
$filename = $_FILES['upload']['name'];
$size = $_FILES['upload']['size'];
$target_file = $target_path.$filename;
//$num = isset($_POST['num'])?$_POST['num']:1;
$num = $_POST['num'];
uploadBigFile( $tmp_name, $num, $target_file, $_POST['size']);