Skip to content

Instantly share code, notes, and snippets.

View pyadav's full-sized avatar
🐢
learning new stuff

Praveen Yadav pyadav

🐢
learning new stuff
View GitHub Profile
@pyadav
pyadav / D3Adapter.js
Created April 18, 2019 19:19 — forked from robatwilliams/D3Adapter.js
Framework adapters: D3-for-React + React-for-D3
import * as d3 from 'd3';
import PropTypes from 'prop-types';
import React, { PureComponent } from 'react';
/**
* Adapter for using D3 components in React.
*
* To be compatible, D3 components must follow the reusable component convention
* as proposed by Mike Bostock: https://bost.ocks.org/mike/chart/
*
// Unity C# Cheat Sheet
// I made these examples for students with prior exerience working with C# and Unity.
// Too much? Try Unity's very good tutorials to get up to speed: https://unity3d.com/learn/tutorials/topics/scripting
@pyadav
pyadav / formik.tsx
Created January 30, 2019 11:49 — forked from tgriesser/formik.tsx
Formik w/ Hooks
import React, {
useContext,
createContext,
createElement,
useEffect,
useRef,
useCallback,
useState,
} from 'react';
import isEqual from 'react-fast-compare';
@pyadav
pyadav / vanilla-js-cheatsheet.md
Created December 14, 2018 02:10 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet
@pyadav
pyadav / event-loop.md
Created October 16, 2018 10:44 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@pyadav
pyadav / sketch-never-ending.md
Last active July 14, 2018 06:33 — forked from Bhavdip/sketch-never-ending.md
Modify Sketch to never ending trial

###Sketch trial non stop

Open hosts files:

$ open /private/etc/hosts

Edit the file adding:

127.0.0.1 backend.bohemiancoding.com

127.0.0.1 bohemiancoding.sketch.analytics.s3-website-us-east-1.amazonaws.com

import { LayoutAnimation, Keyboard, Platform } from 'react-native';
export default class KeyboardEventListener {
static subscribe(callback) {
const listener = new KeyboardEventListener(callback);
return () => {
listener.unsubscribe();
};
}
import React from 'react';
import { Image, View, Text, TextInput, LayoutAnimation } from 'react-native';
import KeyboardEventListener from '../util/KeyboardEventListener';
export default class AuthenticationScreen extends React.Component {
state = {
keyboardHeight: 0,
}
componentDidMount() {
@pyadav
pyadav / The Technical Interview Cheat Sheet.md
Created May 1, 2017 15:29 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@pyadav
pyadav / pr.md
Created April 14, 2017 04:38 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: