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 / scripts.js
Last active October 23, 2018 18:57
A basic three.js setup
(function(){
var camera, scene, renderer;
var geometry, material, mesh;
// Set the scene size.
const WIDTH = window.innerWidth;
const HEIGHT = window.innerHeight;
// Set some camera attributes.
const VIEW_ANGLE = 70; // FOV (field of view)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Beginning with Three.js</title>
<meta name="description" content="Beginning with Three.js">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<meta name="author" content="Praveen Yadav">
<!-- INTERNAL CSS WITH RESET -->
<style>
@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() {