Skip to content

Instantly share code, notes, and snippets.

View avinash2fly's full-sized avatar

Avinash Gupta avinash2fly

  • Sydney, Australia
View GitHub Profile
@avinash2fly
avinash2fly / Write better code in React
Created December 4, 2018 22:54
Write better code in React
Get some good linting. Use ES Lint, Airbnb’s JavaScript Style Guide, and ESLint React Plugin.
Use propTypes and defaultProps.
Know when to make new components.
Know when to write a Component, PureComponent, and a Stateless Functional Component.
Use React Dev Tools.
Use inline conditional statements in your code.
Use Snippet Libraries to save a ton of time that is usually wasted on boilerplate code.
Learn how React works with React Internals.
Use tools like Bit / StoryBook to improve your component development workflow
--configuration for downloading packages
;; load emacs 24's package system. Add MELPA repository.
(when (>= emacs-major-version 24)
(require 'package)
(add-to-list
'package-archives
;; '("melpa" . "http://stable.melpa.org/packages/") ; many packages won't show if using stable
'("melpa" . "http://melpa.milkbox.net/packages/")
t))
@avinash2fly
avinash2fly / introrx.md
Created July 18, 2018 05:44 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
def wrapImage(img, H, shape=None, resize=False):
row, col = shape
y_cor, x_cor = np.indices((row, col), dtype=np.float32)
idx1 = np.array([x_cor.ravel(), y_cor.ravel(), np.ones_like(x_cor).ravel()])
idx2 = np.linalg.inv(H).dot(idx1)
# warp(img1.img, H1, img1.img.shape[:2])
if resize:
# Calculate the size of the destination image
xmin, ymin = np.min(idx2[:-1] / idx2[-1], axis=1)
@avinash2fly
avinash2fly / API.md
Created June 5, 2018 00:28 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@avinash2fly
avinash2fly / blockchain.md
Created October 11, 2017 14:37 — forked from anhldbk/blockchain.md
Blockchain applications

What are non-Bitcoin applications of blockchain technology?

"In 2015 Uber, the world's largest taxi company owns no vehicles, Facebook the world's most popular media owner creates no content, Alibaba the most valuable retailer has no inventory, and Airbnb the world's largest accommodation provider owns no real estate."*

Through collaboration and value distribution, decentralized autonomous organizations (DAOs) will be just as disruptive to the above centralized business models.

Currency

@avinash2fly
avinash2fly / modal.jsx
Created September 1, 2017 03:59
modal react sample
<Modal show={ this.state.demoModal } onHide={ () => {this.setState({demoModal: false}) }}>
<Modal.Header>
<Modal.Title>{this.props.modalHeader}</Modal.Title>
</Modal.Header>
<Modal.Body>
<p>{this.props.modalBody}</p>
</Modal.Body>
<Modal.Footer>

Use these rapid keyboard shortcuts to control the GitHub Atom text editor on Mac OSX.

Key to the Keys

  • ⌘ : Command key
  • ⌃ : Control key
  • ⌫ : Delete key
  • ← : Left arrow key
  • → : Right arrow key
  • ↑ : Up arrow key