Skip to content

Instantly share code, notes, and snippets.

View shahmir811's full-sized avatar

Shahmir Khan Jadoon shahmir811

  • Pakistan
View GitHub Profile
@shahmir811
shahmir811 / ScanBarCode.vue
Created November 21, 2020 07:07
ScanBarCode with vuejs
<template>
<div>
<h1 class='scanBarCode-component-title'>ScanBarCode</h1>
<div class="row">
<div class="col-md-6 offset-md-3">
<input type="text" class="form-control" placeholder="Search" v-model="searchOrderNo" />
</div>
</div>
@shahmir811
shahmir811 / generateBarcode.js
Created November 21, 2020 06:48
This will take an order no and paste them in PDF
import { jsPDF } from 'jspdf';
import JsBarcode from 'jsbarcode';
// convert orderNo to base64Barcode
// convert base64Barcode to PNGImage
// Use PNGImage in pdf downloaded file
const generateAndDownloadBarcodeInPDF = (orderNo) => {
let makeBase64Image = convertTextToBase64Barcode(orderNo);
@shahmir811
shahmir811 / Orders.vue
Created November 21, 2020 06:45
Component uses for generating barcode and used them inside PDF file
<template>
<div>
<h1 class='orders-component-title'>Orders</h1>
<div class="row">
<div class="col-md-8 offset-md-2">
<table class="table table-hover">
<thead class="table-secondary">
<th scope="col">S No.</th>
<th scope="col">Name</th>
@shahmir811
shahmir811 / localization_app.js
Created October 5, 2020 03:48
App.js file of localization porject
import React from 'react';
import './App.css';
import { useTranslation } from 'react-i18next';
function App() {
const { t, i18n } = useTranslation();
const handleClick = (lang) => {
i18n.changeLanguage(lang);
};
@shahmir811
shahmir811 / ur_translation.json
Created October 5, 2020 03:42
Urdu language mapping JSON object
{
"Thanks": {
"1": "شکریہ"
},
"Why": {
"1": "اس ویڈیو کو دیکھنے کے لئے"
},
"Welcome to React js": "رد عمل جے ایس میں خوش آمدید"
}
@shahmir811
shahmir811 / en_translation.json
Created October 5, 2020 03:40
English language mapping JSON object
{
"Thanks": {
"1": "Thank you"
},
"Why": {
"1": "For watching this video"
},
"Welcome to React js": "Welcome to React js"
}
@shahmir811
shahmir811 / index.js
Created October 5, 2020 03:25
Added i18next.js in index.js file
import React, { Suspense } from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';
import './i18next';
ReactDOM.render(
import i18n from 'i18next';
import { initReactI18next } from 'react-i18next';
import Backend from 'i18next-http-backend';
import LanguageDetector from 'i18next-browser-languagedetector';
// don't want to use this?
// have a look at the Quick start guide
// for passing in lng and translations on init
const languages = ['en', 'ur'];