Table of Contents generated with DocToc
Say I have a route for react that looks like below route:
<Route path="/" component={Layout}>
<IndexRoute component={home}></Route>
<Route path="user" component={user}></Route>
</Route>
Where the Layout component has just the header and footer only but the main content of the webpage is loaded from the child routes. Home is the index route and /user renders the user route inside the Layout component. To display the content of the home or user component inside the Layout route, you need to include below code in the Layout route:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = [1,2, 3, [4,5,6, [45,26,25,89]], 7,8,9] | |
function flatten(myArray) { | |
return myArray.reduce(function (x, y) { | |
return x.concat(Array.isArray(y) ? flatten(y) : y); | |
}, []); | |
} | |
console.log(flatten(arr)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.composite-title, .composite-title, .vs-dark .monaco-workbench>.activitybar>.content { | |
background-color: rgba(40, 44, 52, 1) !important; | |
} | |
.tabs-container, .tab, .tab.active, .title-actions, .tablist, .tabs-container, .tabs, .composite.title { | |
background-color: rgba(40, 44, 52, 1) !important; | |
} | |
.tab.active, .tab { | |
border-right: 0px !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
root /var/www/example.com/static; | |
server_name example.com; | |
access_log /var/log/nginx/example.com.access.log; | |
error_log /var/log/nginx/example.com.error.log; | |
try_files /maintenance.html @proxy; | |
location @proxy { | |
proxy_pass http://127.0.0.1:10001; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react' | |
import Firebase from 'firebase' | |
import ReactFireMixin from 'reactfire' | |
import reactMixin from 'react-mixin' | |
const ref = new Firebase('https://<APPNAME>.firebaseio.com/users') | |
class UsersList extends Component { | |
constructor (props, context) { | |
super(props, context) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//SPDX-License-Identifier: MIT | |
pragma solidity >=0.8.0 <0.9.0; | |
abstract contract Registry { | |
function resolver(bytes32 node) external view virtual returns (address); | |
} | |
abstract contract Resolver { | |
function addr(bytes32 node) external view virtual returns (address); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useEffect, useState } from "react"; | |
import { isAddress } from "viem"; | |
import { useNetwork } from "wagmi"; | |
interface Props { | |
address?: string; | |
chainId?: number; | |
} | |
const useMySafes = ({ address = "", chainId }: Props) => { |