Skip to content

Instantly share code, notes, and snippets.

View sahilrajput03's full-sized avatar
💭
Eating, Sleeping, Coding, Repeat.

Sahil Rajput sahilrajput03

💭
Eating, Sleeping, Coding, Repeat.
View GitHub Profile
@sahilrajput03
sahilrajput03 / commentary 721.md
Last active November 14, 2022 04:56
commentary ERC721.md

Commentary on ERC721

Source: ethereum.org

Implementation on Openzeppelin:

Every ERC-721 compliant contract must implement the ERC721 and ERC165 interfaces:

  • Methods:

Commentary on ERC20

Source: ethereum.org

  • Methods:
  - name(): OPTIONAL, Returns the name of the token - e.g. "MyToken". ALSO: `function name() public view returns (string)`
  - symbol(): OPTIONAL, Returns the symbol of the token. E.g. “HIX”. ALSO: `function symbol() public view returns (string)`
  - decimals(): OPTIONAL, Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation. ALSO: `function decimals() public view returns (uint8)`
  - totalSupply(): Returns the total token supply. ALSO: `function totalSupply() public view returns (uint256)`
@sahilrajput03
sahilrajput03 / setup-ssl.md
Created October 16, 2022 14:53 — forked from pedrouid/setup-ssl.md
Setup SSL with NGINX reverse proxy

Get a Free SSL Certificate With Let’s Encrypt

Let’s Encrypt is a free, automated, and open Certificate Authority.

  1. Install tools for using the Let's Encrypt certificates using Certbot
  sudo apt-get update \
  sudo apt-get install software-properties-common
@sahilrajput03
sahilrajput03 / TODO-Draft-why-mediatation.md
Last active October 12, 2022 08:23
TODO: Publish to sahilrajput.ml

Why meditation?

Everything I write in this article is my perception of this mental techniquet which we all broadly refer to as term "meditation".

Doing more work doesn't mean any good if the other choice is doing same work with lesser thinking noise(concise thinking) or some more important work. Similarly, thinking fast at the level of mind isn't any good if the other choice is doing same work with concised thinking or thinking of some more important element. Meditation helps you have the other choice available to you and kind of makes you disabled to the first way coz it just don't make any sense to you now. Stimulators: Coffee can be good stimulator to help you condition and have ease with the meditation. Coffee must be milk-less and you may add sugar if you feel like that.

Why don't we progress on the way of evolution of spiritual level of the mind? I think the way we handle the phase of emotional needyness plays an important role. That means if you meditate on those moments and practise to give yours

# THIS FILE IS REFERENCED AT - https://github.com/sahilrajput03/sahilrajput03/blob/main/mail-server.md
# cat /etc/postfix/main.cf
smtpd_banner = $myhostname ESMTP $mail_name ($mail_version)
biff = no
append_dot_mydomain = no
readme_directory = no
compatibility_level = 2
mailbox_size_limit = 0
module.exports = {
data: [
{
type: 'hotel-offers',
hotel: {
type: 'hotel',
hotelId: 'XKLON321',
chainCode: 'XK',
dupeId: '501108165',
name: 'Hotel London Allocation',
@sahilrajput03
sahilrajput03 / gist:a691c18b3d8b3fc6dbca919a73dd99ba
Last active August 25, 2022 16:48
chat application in nextjs using socket.io
import io from 'socket.io-client';
import {useState, useEffect, useRef} from 'react';
import Header from 'components/header';
import Image from 'next/image';
import desiredChat from '../assets/desired-chat.png';
import Avatar from '@mui/material/Avatar';
import SendMessageIcon from '../assets/send-message-icon.png';
import MessageInputGalleryIcon from '../assets/message-input-gallery-icon.png';
import MessageInputSmileyIcon from '../assets/message-input-smiley-icon.png';
import ClientOnly from 'components/ClientOnly';
import io from 'socket.io-client';
import {useState, useEffect, useRef} from 'react';
import Header from 'components/header';
import Image from 'next/image';
import desiredChat from '../assets/desired-chat.png';
import Avatar from '@mui/material/Avatar';
import SendMessageIcon from '../assets/send-message-icon.png';
import MessageInputGalleryIcon from '../assets/message-input-gallery-icon.png';
import MessageInputSmileyIcon from '../assets/message-input-smiley-icon.png';
import ClientOnly from 'components/ClientOnly';
@sahilrajput03
sahilrajput03 / index.html
Last active August 4, 2022 13:43
rpc-demo snippet FRONTEND
<!-- File: index.html -->
<!-- In <body> of you html, you can use rpc like that -->
<div class="desc">Use below buttons to call appropriate function on server:</div>
<button onclick="btn1()">rpc.test()</button>
<button onclick="btn2()">rpc.yoy("God loves all")</button>
<button onclick="btn3()">rpc.cat({say: "meoww"})</button>
<button onclick="btn4()">rpc.love("donald", "pikachu")</button>
<button onclick="btn5()">rpc.someNonExistingFunction("pokemons")</button>
<button onclick="btn6()">rpc.rain("Charlizard", "Nobita")</button>