Skip to content

Instantly share code, notes, and snippets.

View monirshimul's full-sized avatar
🎯
Focusing

monirshimul monirshimul

🎯
Focusing
View GitHub Profile
@monirshimul
monirshimul / next-ssr-recoil-effects.js
Created September 12, 2021 09:30 — forked from spro/next-ssr-recoil-effects.js
Another attempt at SSR with Recoil - setting initial atom values with Next.js getServerSideProps, this time with effects
import {useEffect, useMemo} from 'react'
import {RecoilRoot, useRecoilState, atom} from 'recoil'
// User data
const user1 = {username: 'joe', bio: "You will never see me, unless of course this example is totally broken."}
const user2 = {username: 'bob', bio: "I am the one true user."}
const user3 = {username: 'fred', bio: "Just kidding, make way for the new guy."}
// A potentially dangerous mutable global variable for initial state. The main
@monirshimul
monirshimul / sw-await.js
Created May 4, 2021 15:43 — forked from bakoushin/sw-await.js
Service Worker: Promises vs Async/Await
const version = 1;
const appPrefix = 'myApp-';
const staticCacheName = appPrefix + 'static-v' + version;
const imagesCacheName = appPrefix + 'content-imgs';
var allCaches = [
staticCacheName,
imagesCacheName
];
self.addEventListener('message', event => {
@monirshimul
monirshimul / 1. docker basic.txt
Created January 23, 2019 08:18 — forked from ovichowdhury/1. docker basic.txt
Docker cheat sheet
// Running a container (run command will downlaod a and install a image)
docker run hello-world
// Running a command inside a container
docker run busybox echo hi there
docker run busybox ls
@monirshimul
monirshimul / secp256k1-example.js
Created December 12, 2018 10:09 — forked from nakov/secp256k1-example.js
ECDSA in JavaScript: secp256k1-based sign / verify / recoverPubKey
let elliptic = require('elliptic');
let sha3 = require('js-sha3');
let ec = new elliptic.ec('secp256k1');
// let keyPair = ec.genKeyPair();
let keyPair = ec.keyFromPrivate("97ddae0f3a25b92268175400149d65d6887b9cefaf28ea2c078e05cdc15a3c0a");
let privKey = keyPair.getPrivate("hex");
let pubKey = keyPair.getPublic();
console.log(`Private key: ${privKey}`);
console.log("Public key :", pubKey.encode("hex").substr(2));
from os import system
import getpass
print("1.ROCK...")
print("2.PAPER...")
print("3.SCISSIOR...")
#player1 = input("player 1 , make your move : ")
#system("cls")
#player2 = input("player 2 , make your move : ")