Skip to content

Instantly share code, notes, and snippets.

View Janaka-Steph's full-sized avatar
🎯
Focusing

Janaka-Steph

🎯
Focusing
View GitHub Profile
@joshuayoes
joshuayoes / new-architecture.md
Created October 5, 2022 23:51
A collection of documentation, repositories, and videos about the New Architecture in React Native

JAMTIS

This document describes a new addressing scheme for Monero.

Chapters 1-2 are intended for general audience.

Chapters 3-7 contain technical specifications.

Table of Contents

@ef4
ef4 / examples.md
Last active April 2, 2024 17:38
Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 5 Node Polyfills Upgrade Cheatsheet

Webpack 4 automatically polyfilled many Node APIs in the browser. This was not a great system, because it could lead to surprisingly giant libraries getting pulled into your app by accident, and it gave you no control over the exact versions of the polyfills you were using.

So Webpack 5 removed this functionality. That means you need to make changes if you were relying on those polyfills. This is a quick reference for how to replace the most common patterns.

List of polyfill packages that were used in webpack 4

For each automatically-polyfilled node package name on the left, this shows the name of the NPM package that was used to polyfill it on the right. Under webpack 5 you can manually install these packages and use them via resolve.fallback.

@hacknlove
hacknlove / useStorage.js
Created July 2, 2019 11:51
Custom react hook useStorage for browser extension developers
import browser from 'webextension-polyfill'
import { useState, useEffect } from 'react'
function isDiferent (a, b) {
if (typeof a !== typeof b) {
return true
}
if (Array.isArray(a)) {
return arrayIsDifferent(a, b)
}

Document

Toggle Me

This content is revealed when the "Toggle Me" label is clicked.

@jsdevtom
jsdevtom / frontend-ws-connection.ts
Last active April 17, 2024 07:35
kubernetes-ingress websockets with nodejs
export const ws = webSocket<WebsocketMessage>(`wss://${location.hostname}:${location.protocol === 'https:' ? 443 : 80}/ws/`);
export const wsObserver = ws
.pipe(
retryWhen(errors =>
errors.pipe(
delay(1000)
)
)
);
@khaledosman
khaledosman / Create a PWA in React.js
Last active March 10, 2020 18:24
create-react-app PWA example with epilog to update autogenerated service worker to skipInstall and show notifications using material-ui
We couldn’t find that file to show.
@lorefnon
lorefnon / package.json
Created August 18, 2018 19:44
Integrating next.js, Apollo Server and Koa
{
"main": "server/index.js",
"scripts": {
"dev": "nodemon --watch server server/index.js",
"build": "next build",
"start": "NODE_ENV=production node server/index.js"
},
"dependencies": {
"apollo-boost": "^0.1.13",
"apollo-server": "^2.0.4",
@Stadicus
Stadicus / 20-thundroid-welcome
Last active November 21, 2021 12:36
Thundroid: System overview MotD
#!/bin/sh
# by Stadicus
# make executable and copy script to /etc/update-motd.d/
# root must be able to execute bitcoin-cli and lncli
# set colors
color_red='\033[0;31m'
color_green='\033[0;32m'
color_yellow='\033[0;33m'
color_gray='\033[0;37m'
@sipa
sipa / covert_ecdh.md
Last active January 4, 2023 10:31
Covert ECDH over secp256k1