Skip to content

Instantly share code, notes, and snippets.

View adityaloshali's full-sized avatar
🍷
nani?!

Aditya Loshali adityaloshali

🍷
nani?!
View GitHub Profile
@adityaloshali
adityaloshali / curl.md
Created February 10, 2019 11:47 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@adityaloshali
adityaloshali / .babelrc
Created April 18, 2019 15:35
Webpack Configuration
{
"presets": ["stage-1", "react", "es2015"],
"plugins": [
"syntax-dynamic-import",
"babel-plugin-transform-decorators-legacy",
"transform-object-rest-spread"
]
}
@adityaloshali
adityaloshali / lazyComponent.js
Created April 18, 2019 15:38
Dynamic Import Component
import React, { Component } from 'react'
import { SyncLoader } from 'react-spinners'
const lazyComponent = (importComponent) => class extends Component {
constructor(props) {
super(props)
this.state = {
component: null
}
import * as React from "react";
import { render } from "react-dom";
import produce from "immer";
import { set, has } from "lodash";
import "./styles.css";
function enhancedReducer(state, updateArg) {
// check if the type of update argument is a callback function
if (updateArg.constructor === Function) {