Skip to content

Instantly share code, notes, and snippets.

View vish448's full-sized avatar
🏠
Working Remotely

Vishang vish448

🏠
Working Remotely
View GitHub Profile
@vish448
vish448 / Install Express to local dev env
Last active June 9, 2018 02:42
Express Skeleton using Express Generator
npm install express-generator -g
express --view=pug myApp
@vish448
vish448 / passingPropsBetweenClassComponents.txt
Last active March 19, 2019 00:59
How to pass props to one class components to another
//Parent component
class Parent extends React.Component {
render() {
return (
<Child example="foo" />
)
}
}
## commands from terminal
mkdir my-app
cd my-app
npm init -y -- creates package.json file with default configurations
npm install react react-dom -- install react and react-dom dependencies
vim .gitignore -- creates gitigonre file
mkdir app --create app folder in your project folder
cd app
touch index.js index.css -- creates two files in app directory
npm install --save-dev @babel/core @babel/preset-env @babel/preset-react webpack webpack-cli webpack-dev-server babel-loader css-loader style-loader html-webpack-plugin -- adding all require depnendincies to the project
@vish448
vish448 / Simple Example
Created May 11, 2019 17:49
Creating a promise
function onSuccess(){
console.log('Success ✌️')
}
function onError(){
console.log('Error 💩')
}
var promise = new Promise((resolve, reject)=>{
resolve(); // will execute the On success method
@vish448
vish448 / .babelrc
Last active May 30, 2019 20:28
Setting up environment presets
{
"presets": [
"env"
]
}
@vish448
vish448 / pxToVw.scss
Created December 19, 2019 15:51
scss Px to Vw function
@function pxToVw($px, $viewport) {
@return ($px * 100vw / $viewport);
}
@vish448
vish448 / index.html
Last active April 8, 2020 16:12
Terminal Commands for reference to create a jamstack registration form
Create an empty folder -- mkdir jamstack-registration-form
set jamstack app -- yarn init -y
create a folder -- mkdir src
create a html file -- index.html
creating a nee package with yarn -- yarn init -y
To server your application in real time -- npx serve FOLDER_NAME
To deploy site on netlify -- netlify init