Skip to content

Instantly share code, notes, and snippets.

View Blazing-Mike's full-sized avatar
👷
Focusing

Michael Adebambo Blazing-Mike

👷
Focusing
View GitHub Profile
export const OfflineStatusModal = () => {
return (
<div className="justify-center items-center bg-black/80 flex overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none">
<div className="relative w-auto my-6 mx-auto max-w-3xl">
{/*content*/}
<div className="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-background outline-none focus:outline-none">
import { useState, useEffect } from 'react';
async function performNetworkCheck() {
const endpoint = 'https://www.google.com';
try {
const response = await fetch(endpoint, {
method: 'HEAD',
cache: 'no-cache',
mode: 'no-cors',
{
"workbench.startupEditor": "none",
"window.autoDetectColorScheme": true,
"workbench.preferredDarkColorTheme": "Min Dark",
"workbench.preferredLightColorTheme": "Min Light",
"editor.minimap.enabled": false,
"breadcrumbs.enabled": false,
"editor.renderWhitespace": "all",
"emmet.includeLanguages": {
"javascript": "javascriptreact"
@Blazing-Mike
Blazing-Mike / loop-over-obj.ts
Created December 4, 2022 23:52
Loop over JSON object with angular ngfor
<ng-container *ngFor="let item of APIresponse | keyvalue: indexOrderAsc">
{{item.key.replaceAll('_', ' ') | titlecase}}:{{item.value}}
</ng-container>
function constructEndpoint(lnRequest) {
if (lnRequest.includes("@")) {
return DECODE_LN_ADDRESS;
}
if (lnRequest.startsWith("lnurl") && lnRequest.includes("lnurl")) {
return DECODE_LNURL;
}
if (lnRequest.startsWith("ln")) {
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
// https://vitejs.dev/config/
export default defineConfig({
server: {
proxy: {
"/api": {
target: "http://localhost:3001",
changeOrigin: true,
from bitcoinlib.wallets import Wallet
from bitcoinlib.mnemonic import *
passphrase = Mnemonic().generate()
print(passphrase)
w = Wallet.create("MyFirstWallet", witness_type='segwit', keys=passphrase, network='bitcoin')
WalletKeys = (w.get_keys(number_of_keys=10))
for k in WalletKeys:
def setup_network(self):
"""Setup the test network topology"""
def run_test(self):
"""Main test logic"""
self.log.info("Starting test!")
"""Let the user know the test has started"""
self.sync_all(self.nodes)
@Blazing-Mike
Blazing-Mike / counter.jsx
Created July 19, 2022 13:53
Implemented counter in react class
class Counter extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0
};
this.decrement = this.decrement.bind(this);
this.increment = this.increment.bind(this);
this.reset = this.reset.bind(this);
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
const style = {
table: {
borderCollapse: 'collapse'
},
tableCell: {
border: '1px solid gray',
margin: 0,