Skip to content

Instantly share code, notes, and snippets.


Md_ZubairAhmed M-ZubairAhmed

View GitHub Profile
M-ZubairAhmed /
Created Jul 6, 2020
A simple description on how to use svg in react

If the app uses custom webpack configuration, then loader is needed to handle svgs in your app. Lets use SVGR webpack loader.

yarn add @svgr/webpack --dev

and then in your webpack config file add the following rule :

  test: /\.svg$/,
M-ZubairAhmed / prettier.config.js
Created May 2, 2019
My default personal opiniated prettier config
View prettier.config.js
module.exports = {
endOfLine: 'lf',
semi: false,
singleQuote: true,
tabWidth: 2,
printWidth: 80,
trailingComma: 'all',
jsxBracketSameLine: true,
arrowParens: 'always',
M-ZubairAhmed / translation-strings-to-ids.js
Created Jul 10, 2018
Simple node program that normalizes string of react int to be used as ids in translation json file
View translation-strings-to-ids.js
const readline = require('readline');
var ncp = require('copy-paste');
const inputMessage = readline.createInterface({
input: process.stdin,
output: process.stdout,
// Promt to enter the string eg.
// This ain't your username, is it?
M-ZubairAhmed /
Last active May 9, 2018
Apps i use on my Linux

List of must apps i use in my Linux PC

Sorted from top to down in order of installation

Package managers


repo image

Styling Readme

Hit Raw to copy the content

Divider line

A clean divider line to segregate your sections.


M-ZubairAhmed /
Last active Feb 19, 2018
Deploying React app bootstrapped with CRA to Heroku

Creating heroku app with cli

heroku create $APP_NAME --buildpack

with npx

npx heroku-cli create $APP_NAME --buildpack
View task.js
const inputString =
'[ "AND", ["<", "var1", "var2"], [ "OR", [">", "var3", "var4"], ["==", "var5", "var6"] ] ]'
let cleanedString = ''
for (var i = 0; i < inputString.length; i++) {
if (
inputString[i] !== '[' &&
inputString[i] !== ']' &&
inputString[i] !== '"'
) {
M-ZubairAhmed /
Last active Nov 28, 2017
Markdown syntax for centering logo, title and subtitle in a repository's readme

Repo's title

repo's subtitle/moto

M-ZubairAhmed / translator.js
Created Oct 7, 2017
Extracting all strings from react-intl to single json file
View translator.js
console.log('Extracted all strings from program ', '\n')
import * as fs from 'fs'
import { sync as globSync } from 'glob'
import { sync as mkdirpSync } from 'mkdirp'
const filePattern = './build/messages/**/*.json'
const outputLanguageDataDir = './build/locales/'
console.log('Piping followings ids :')
You can’t perform that action at this time.