Skip to content

Instantly share code, notes, and snippets.

Optimise your code by caching!

Let's say you have a function that is a super-slow function. Now there is no way you can optimize the function, what you can do instead is that you can store results from a previous computation and reuse those results in a new computation to find solutions to other problem.

What we are gonna see in this article?

We'll implement finding n-th Fibonacci number problem We'll find out how much time it takes to compute the 40th Fibonacci number. and in the end, we'll make our code 400k times faster. (and yeah you are reading it right)

@pushpak1300
pushpak1300 / txt.txt
Created August 29, 2020 13:37
Project Resources
https://github.com/spytensor/plants_disease_detection
@pushpak1300
pushpak1300 / demo.txt
Last active August 9, 2020 04:57
Resources for Web Development Workshop
Resouces for HTML,CSS and Bootstrap
https://www.w3schools.com/
https://developer.mozilla.org/en-US/
https://getbootstrap.com/
https://www.youtube.com/watch?v=NDcfKNQBqAk
Resources for Git and Github
https://github.github.com/training-kit/downloads/github-git-cheat-sheet.pdf
https://lab.github.com/ (Github tutorials)
https://education.github.com/pack (GitHub Student Developer Pack)
@pushpak1300
pushpak1300 / index.html
Created August 8, 2020 02:45
web development workshop
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<script src="https://kit.fontawesome.com/ac0330eb2d.js" crossorigin="anonymous"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css"
integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<link href="https://fonts.googleapis.com/css2?family=Pangolin&display=swap" rel="stylesheet">
<html translate="no" lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><base href="/"><!--[if IE]><link rel="icon" href="/favicon.ico"><![endif]--><link href="https://api.mapbox.com/mapbox-gl-js/v1.11.0/mapbox-gl.css" rel="stylesheet"><script src="https://cdn.weglot.com/weglot.min.js"></script><script>Weglot.initialize({ api_key: 'wg_eb9045c5d030ea1f675b4f91200897a52' });</script><meta name="google" content="notranslate"><title>jalprawah</title><link href="/css/chunk-b711e328.4bcfda71.css" rel="prefetch"><link href="/js/chunk-2d22497b.9993747e.js" rel="prefetch"><link href="/js/chunk-38b46f65.fc0c075d.js" rel="prefetch"><link href="/js/chunk-3a13e6dc.7084a2f9.js" rel="prefetch"><link href="/js/chunk-b711e328.e596aacc.js" rel="prefetch"><link href="/css/app.311829a2.css" rel="preload" as="style"><link href="/js/app.35c9edcf.js" rel="preload" as="script"><link href="/js/chunk-vendors.1794830f.js" rel="pre

Keybase proof

I hereby claim:

  • I am pushpak1300 on github.
  • I am pushpak1300 (https://keybase.io/pushpak1300) on keybase.
  • I have a public key whose fingerprint is E12C 894C 8CA7 D989 5CE6 B946 9BC0 0994 1885 8FE5

To claim this, I am signing this object:

{'dam': <Dam: Ganguwala , 035-UYDDEL>, 'levels': {'normal': 1.0, 'warning': None, 'danger': None, 'hfl': 0.0}}
{'dam': <Dam: NATHPA , 003-SHDSIM>, 'levels': {'normal': 1.0, 'warning': None, 'danger': None, 'hfl': 0.0}}
{'dam': <Dam: Koteshwar , 009-HGDDDN>, 'levels': {'normal': 1.0, 'warning': 0.0, 'danger': 0.0, 'hfl': 0.0}}
{'dam': <Dam: MATATILA DAM , 030-LYDAGRA>, 'levels': {'normal': None, 'warning': None, 'danger': None, 'hfl': None}}
{'dam': <Dam: Vishnuprayag , 036-HGDDDN>, 'levels': {'normal': 1.0, 'warning': None, 'danger': None, 'hfl': 0.0}}
{'dam': <Dam: Ukai Dam , 021-TDSURAT>, 'levels': {'normal': 1.0, 'warning': 0.0, 'danger': 0.0, 'hfl': 0.0}}
{'dam': <Dam: Kadana Dam , 007-MAHGAND>, 'levels': {'normal': None, 'warning': None, 'danger': None, 'hfl': None}}
{'dam': <Dam: Sardar Sarovar Dam(Duplicate) , 66>, 'levels': {'normal': 1.0, 'warning': 0.0, 'danger': 0.0, 'hfl': 0.0}}
{'dam': <Dam: INDIRASAGAR DAM , NBO-1-046-1247>, 'levels': {'normal': None, 'warning': None, 'danger': None, 'hfl': None
Verifying my Blockstack ID is secured with the address 1Ep7Ye9wtC1ZG3rZMUpwZ6ngxWa3quuPGW https://explorer.blockstack.org/address/1Ep7Ye9wtC1ZG3rZMUpwZ6ngxWa3quuPGW
sudo apt-get update -y
sudo apt-get install nginx -y
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install software-properties-common -y
sudo add-apt-repository ppa:ondrej/php -y
sudo apt-get update -y
sudo apt-get install php7.3 php7.3-xml php7.3-gd php7.3-opcache php7.3-mbstring php7.3-curl php7.3-mysql php7.3-intl -y
sudo apt-get purge apache2 apache2-utils apache2-bin apache2.2-common -y
sudo apt-get install mysql-server -y
sudo mkdir /var/www/laravel