Skip to content

Instantly share code, notes, and snippets.

View ximxim's full-sized avatar
🏠
Working from home

Azim Ahmed ximxim

🏠
Working from home
View GitHub Profile
var React = require('react');
var Router = require('react-router');
var Route = Router.Route;
var DefaultRoute = Router.DefaultRoute;
var APP = require('./components/APP');
var Audience = require('./components/Audience');
var Speaker = require('./components/Speaker');
var Board = require('./components/Board');
@ximxim
ximxim / atom.config
Last active October 15, 2018 20:53
Atom configuration
a
@ximxim
ximxim / app.tsx
Created October 8, 2021 22:15
Using why-did-you-render library with DevSettings in React Native
import {DevSettings} from 'react-native';
import React, {useEffect, useState} from 'react';
if (process.env.NODE_ENV === 'development') {
const whyDidYouRender = require('@welldone-software/why-did-you-render');
whyDidYouRender(React, {trackAllPureComponents: false});
}
const App = () => {
const [trackAllPureComponents, setTrackAllPureComponents] = useState(false);
@ximxim
ximxim / app.tsx
Last active October 9, 2021 00:11
Adding custom setting to each route to trigger a dev action
import React, {FunctionComponent} from 'react';
import {DevSettings, Alert} from 'react-native';
import {enableScreens} from 'react-native-screens';
import {NavigationContainer} from '@react-navigation/native';
import {SafeAreaProvider} from 'react-native-safe-area-context';
import {createBottomTabNavigator} from '@react-navigation/bottom-tabs';
import {useFocusEffect} from '@react-navigation/native';
import {CenteredView} from './components';
@ximxim
ximxim / MintingContract.sol
Created October 24, 2021 00:23
Basic NFT minting contract init
/*
Since your contract code will be publicly available, this line
will let the readers know if you are cool with letting them use
your code. I have seen UNLICENSED and MIT so far.
*/
// SPDX-License-Identifier: UNLICENSED
/*
This line is important to let solidity know which version of the
language would this contract run on.
@ximxim
ximxim / run.js
Created October 24, 2021 00:25
Solidity contract run script explained
* We require the Hardhat Runtime Environment explicitly here. This is optional
* but useful for running the script in a standalone fashion through `node <script>`.
*
* When running the script with `npx hardhat run <script>` you'll find the Hardhat
* Runtime Environment's members available in the global scope.
*
* Check: https://hardhat.org/guides/scripts.html#standalone-scripts-using-hardhat-as-a-library
*/
const hre = require("hardhat");
@ximxim
ximxim / index.tsx
Last active October 24, 2021 00:58
Starting point of NFT minting project front end
import type { NextPage } from "next";
import Head from "next/head";
import { useState, useCallback, useEffect } from "react";
import styles from "../styles/Home.module.css";
const Home: NextPage = () => {
/**
* comments state will be used as console log
*/
@ximxim
ximxim / [id].ts
Created October 24, 2021 01:15
Nextjs handler api/tokens/[id] to send static NFT metadata
import type { NextApiRequest, NextApiResponse } from "next";
/**
*
* @param req
* @param res
*
* This endpoint will return success response with an object that complies
* with OpenSea NFT standard. The object contains an image link to a giphy
* and the name of the asset.
@ximxim
ximxim / MintingContract.sol
Last active October 24, 2021 14:12
Minting Contract Complete
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "hardhat/console.sol";
contract MintingContract is ERC721URIStorage {
/*
State variable tokenCount is used as unique identifier to generate unique number
@ximxim
ximxim / run.js
Created October 24, 2021 04:09
MintingContract run hardhat script
/**
* We require the Hardhat Runtime Environment explicitly here. This is optional
* but useful for running the script in a standalone fashion through `node <script>`.
*
* When running the script with `npx hardhat run <script>` you'll find the Hardhat
* Runtime Environment's members available in the global scope.
*
* Check: https://hardhat.org/guides/scripts.html#standalone-scripts-using-hardhat-as-a-library
*/
const hre = require("hardhat");