Skip to content

Instantly share code, notes, and snippets.

Avatar

Md_ZubairAhmed M-ZubairAhmed

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

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
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
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
M-ZubairAhmed / mustApps.md
Last active May 9, 2018
Apps i use on my Linux
View mustApps.md

List of must apps i use in my Linux PC

Sorted from top to down in order of installation

Package managers

View styling-readme.md

repo image

Styling Readme

Hit Raw to copy the content

Divider line

A clean divider line to segregate your sections.

color-line

@M-ZubairAhmed
M-ZubairAhmed / react-heroku.md
Last active Feb 19, 2018
Deploying React app bootstrapped with CRA to Heroku
View react-heroku.md

Creating heroku app with cli

heroku create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git

with npx

npx heroku-cli create $APP_NAME --buildpack https://github.com/mars/create-react-app-buildpack.git
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
M-ZubairAhmed / center.md
Last active Nov 28, 2017
Markdown syntax for centering logo, title and subtitle in a repository's readme
View center.md

Repo's title

repo's subtitle/moto

@M-ZubairAhmed
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.