Skip to content

Instantly share code, notes, and snippets.

View rohitdaryanani's full-sized avatar
🍣

Rohit Daryanani rohitdaryanani

🍣
  • Versent
  • Melbourne
View GitHub Profile
import React, { useEffect, useState, useRef } from 'react';
import axios from 'axios';
import Pokemon from './pokemon';
const Pokedex = () => {
const [pokemonList, setPokemonList] = useState([]);
const [nextUrl, setNextUrl] = useState(null);
const [nu, setNu] = useState('https://pokeapi.co/api/v2/pokemon?limit=151');
const loadingRef = useRef(null);
const options = {
@rohitdaryanani
rohitdaryanani / plugins
Last active April 6, 2018 05:14
vs code setting
code --install-extension CoenraadS.bracket-pair-colorizer
code --install-extension PaulOlteanu.theme-railscasts
code --install-extension PeterJausovec.vscode-docker
code --install-extension TwentyChung.jsx
code --install-extension bradgashler.htmltagwrap
code --install-extension christian-kohler.npm-intellisense
code --install-extension dbaeumer.vscode-eslint
code --install-extension dracula-theme.theme-dracula
code --install-extension dzannotti.vscode-babel-coloring
code --install-extension eg2.vscode-npm-script
const locations = [
{
parent_id: 2,
type: 'country',
name: 'Afghanistan',
id: 'AF'
},
{
parent_id: 0,
type: 'country',
PRIMARY_INDUSTRIES = (
("1001", "Business Services"),
("1002", "Aviation and Defense"),
("1003", "Professional Services"),
("1004", "Pharmaceuticals"),
("1005", "Media"),
("1006", "Entertainment"),
("1007", "Clothing and Cosmetics"),
("1008", "Construction"),
("1009", "Art and Design"),
# all country codes present, except GB.
# GB has been changed to UK
COUNTRIES = (
("AD", "Andorra"),
("AE", "United Arab Emirates"),
("AF", "Afghanistan"),
("AG", "Antigua and Barbuda"),
("AI", "Anguilla"),
("AL", "Albania"),
("AM", "Armenia"),
@rohitdaryanani
rohitdaryanani / 0_reuse_code.js
Created March 8, 2017 09:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
'use strict';
module.exports = function CreateGroupKeyController ( $scope, $modalInstance, ToasterService, ApiService, collection ) {
var self = this;
var groupid, newData, key;
self.disableCreateGroupKey = true;
self.disableGroupKeyField = false;
self.errorDuplicategroupKey = false;
@rohitdaryanani
rohitdaryanani / health.md
Last active July 12, 2016 05:17
Eating and workout recorder

Height - 5'11"

Starting Weight - 217lbs / 98.6kg (226.2lbs / 103kg with clothes)

Ideal Weight - 193lbs / 87kg

To Lose - 29.2 lbs / 13.2kg

Week 1

#Programming Manifesto

##Books Ruby

  • Learn to Program by Chris Pine
  • The Well-Grounded Rubyist by David Black
  • Eloquent Ruby by Russ Olsen
  • Practical Object-Oriented Design in Ruby by Sandi Metz
  • Confident Ruby by Avdi Grimm

Objects

To create a new object, use the new keyword followed by a call to a constructor function. Javascript provides the Object() constructor out-of-the-box:

var toilet = new Object();

Properties

Once you have an object, you can set and get properties on it, like this: