Skip to content

Instantly share code, notes, and snippets.

View mayomi1's full-sized avatar
🦀

Mayomi Ayandiran mayomi1

🦀
View GitHub Profile
@jimode
jimode / context-and-localstorage-using-hooks.js
Last active October 8, 2024 05:58
Providing Context and Local Storage Using Hooks
// Providing Context
// ==================
import React, {useState, useEffect} from "react"
const Context = React.createContext()
function ContextProvider({children}) {
const [allPhotos, setAllPhotos] = useState([])
const [cartItems, setCartItems] = useState([])
@jastisriradheshyam
jastisriradheshyam / rsa_oaep_decrypt.js
Created August 17, 2019 19:06
RSA OAEP, encryption with Golang and decryption with NodeJS (node-rsa)
const nodeRSA = require('node-rsa');
/**
* return the decrypted Data (RSA OAEP Encryption)
* @param {string} RSAPrivateKey
* @param {string} EncrypteDataBuffer
* @returns {string} Data decrypted data
*/
var RSA_OAEP_Decrypt = function(RSAPrivateKey, EncrypteDataBuffer){
@rylev
rylev / learn.md
Created March 5, 2019 10:50
How to Learn Rust

Learning Rust

The following is a list of resources for learning Rust as well as tips and tricks for learning the language faster.

Warning

Rust is not C or C++ so the way your accustomed to do things in those languages might not work in Rust. The best way to learn Rust is to embrace its best practices and see where that takes you.

The generally recommended path is to start by reading the books, and doing small coding exercises until the rules around borrow checking become intuitive. Once this happens, then you can expand to more real world projects. If you find yourself struggling hard with the borrow checker, seek help. It very well could be that you're trying to solve your problem in a way that goes against how Rust wants you to work.

@john-doherty
john-doherty / javascript-trim-svg-whitespace.js
Created October 21, 2016 13:39
Trim whitespace from SVG elements
function trimSvgWhitespace() {
// get all SVG objects in the DOM
var svgs = document.getElementsByTagName("svg");
// go through each one and add a viewbox that ensures all children are visible
for (var i=0, l=svgs.length; i<l; i++) {
var svg = svgs[i],
box = svg.getBBox(), // <- get the visual boundary required to view all children
@yoavniran
yoavniran / ultimate-ut-cheat-sheet.md
Last active July 16, 2025 06:32
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai, Sinon, and Jest
@adamloving
adamloving / temporary-email-address-domains
Last active July 9, 2025 03:03
A list of domains for disposable and temporary email addresses. Useful for filtering your email list to increase open rates (sending email to these domains likely will not be opened).
0-mail.com
0815.ru
0clickemail.com
0wnd.net
0wnd.org
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com