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 / gist:44c7e46b53dab6df99364f20f0bae549
Created February 21, 2023 10:09
Shopify Product Import Graphql
mutation {
productCreate(input: {
title: "Demo Product",
descriptionHtml: "This is a demo product description.",
productType: "Demo Product Type",
vendor: "Demo Vendor",
handle: "demo-product",
published: true,
options: [
{ name: "Size", values: ["Small", "Medium", "Large"] },
@apurbajnu
apurbajnu / timezone.js
Created November 28, 2021 15:44
GMT timezone Json file
const Timezone = [
{ value: "Pacific/Niue", label: "(GMT-11:00) Niue" },
{ value: "Pacific/Pago_Pago", label: "(GMT-11:00) Pago Pago" },
{ value: "Pacific/Honolulu", label: "(GMT-10:00) Hawaii Time" },
{ value: "Pacific/Rarotonga", label: "(GMT-10:00) Rarotonga" },
{ value: "Pacific/Tahiti", label: "(GMT-10:00) Tahiti" },
{ value: "Pacific/Marquesas", label: "(GMT-09:30) Marquesas" },
{ value: "America/Anchorage", label: "(GMT-09:00) Alaska Time" },
{ value: "Pacific/Gambier", label: "(GMT-09:00) Gambier" },
{ value: "America/Los_Angeles", label: "(GMT-08:00) Pacific Time" },
This file has been truncated, but you can view the full file.
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@babel/runtime/regenerator/index.js":
/*!**********************************************************!*\
!*** ./node_modules/@babel/runtime/regenerator/index.js ***!
\**********************************************************/
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
module.exports = __webpack_require__(/*! regenerator-runtime */ "./node_modules/regenerator-runtime/runtime.js");
@apurbajnu
apurbajnu / gist:941e7e4d9ef83f93aa4103491236841e
Last active June 18, 2021 22:18
Upload imgur image process with authentication
Get Access token with client _id ------------
method get
https://api.imgur.com/oauth2/authorize?client_id=Your_Client_ID&response_type=token&state=APPLICATION_STATE
response get access token and refresh token
https://imgur.com/?state=APPLICATION_STATE#access_token=ACCESS_TOKEN&expires_in=315360000&token_type=bearer&refresh_token=REFRESH_TOKEN&account_username=USERNAME&account_id=ACCOUNTID
@apurbajnu
apurbajnu / jquery-plugin.js
Created March 13, 2021 07:36 — forked from benjasHu/jquery-plugin.js
ES6 Module jQuery Plugin Definition
import pluginify from 'pluginify';
class Plugin {
constructor() {
/* ... */
}
}
/*
Convert plugin class into a jQuery plugin
@apurbajnu
apurbajnu / EDD Software License Activating Class
Created November 9, 2020 17:57
Easy Digital Download Automatic class.
<?php
/**
* Created by PhpStorm.
* User: apurbapodder
* Date: 11/9/20
* Time: 2:56 PM
*/
class BDS_License_For_PPU {
@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']);
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 / 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",
@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",