Skip to content

Instantly share code, notes, and snippets.

View rake7h's full-sized avatar
πŸ˜€

Rakesh rake7h

πŸ˜€
View GitHub Profile
@rake7h
rake7h / index.html
Created January 11, 2020 14:00
Print all prototypes of Object [add your bin description] // source https://jsbin.com/hekiqaq/2
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[add your bin description]">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Print all prototypes of Object</title>
</head>
<body>
@rake7h
rake7h / event-loop.md
Created August 1, 2020 17:15 — forked from jesstelford/event-loop.md
What is the JS Event Loop and Call Stack?

Regular Event Loop

This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)


Given the code

@rake7h
rake7h / self-sign-ssl
Created September 8, 2020 12:34
Generate self signed server certificate
1. openssl genrsa -des3 -out rootCA.key 2048
2. openssl req -x509 -new -nodes -key rootCA.key -sha256 -days 1024 -out rootCA.pem
3. Add certificate in keychain - certifiactes
4. In v3.ext
authorityKeyIdentifier=keyid,issuer
basicConstraints=CA:FALSE
keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment
subjectAltName = @alt_names
@rake7h
rake7h / redux-thunk-examples.js
Created October 8, 2020 07:22 — forked from markerikson/redux-thunk-examples.js
Redux-Thunk examples
// The classic AJAX call - dispatch before the request, and after it comes back
function myThunkActionCreator(someValue) {
return (dispatch, getState) => {
dispatch({type : "REQUEST_STARTED"});
myAjaxLib.post("/someEndpoint", {data : someValue})
.then(
response => dispatch({type : "REQUEST_SUCCEEDED", payload : response}),
error => dispatch({type : "REQUEST_FAILED", error : error})
);
@rake7h
rake7h / ApacheHTTPSConfig.md
Created October 13, 2020 17:12 — forked from nrollr/ApacheHTTPSConfig.md
Enable SSL in Apache for 'localhost' (OSX, El Capitan)

Enable SSL in Apache (OSX)

The following will guide you through the process of enabling SSL on a Apache webserver

  • The instructions have been verified with OSX El Capitan (10.11.2) running Apache 2.4.16
  • The instructions assume you already have a basic Apache configuration enabled on OSX, if this is not the case feel free to consult Gist: "Enable Apache HTTP server (OSX)"

Apache SSL Configuration

Create a directory within /etc/apache2/ using Terminal.app: sudo mkdir /etc/apache2/ssl
Next, generate two host keys:

@rake7h
rake7h / isFirstRender
Created December 8, 2020 16:51
set is first render react function component
function MyComponent() {
const isFirstRef = useRef(true);
const [count, setCounter] = useState(0);
useEffect(() => {
if (isFirstRef.current) {
isFirstRef.current = false;
return;
}
console.log('The counter increased!');
setTimer(time) {
if (this.timerHandle) {
// Exception?
return;
}
// Remember the timer handle
this.timerHandle = setTimeout(() => {
this.closePopover();
this.timerHandle = 0;
}, time);
@rake7h
rake7h / gist:55f17c4b0f3681301bf9d183253cc049
Created January 12, 2021 09:25 — forked from paulirish/gist:5558557
a brief history of detecting local storage

A timeline of the last four years of detecting good old window.localStorage.


Jan Lenhart, bless his heart contributed the first patch for support:

October 2009: 5059daa

Setup MinIO on Ubuntu 20.04 LTS with Let's Encrypt SSL

✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨
SUPPORT MY WORK - Everything Helps Thanks
YouTube πŸ”— https://YouTube.GetMeTheGeek.com
Buy Me a Coffee β˜• https://www.buymeacoffee.com/getmethegeek
Hire US πŸ”— https://getmethegeek.com
Digital Ocean referral πŸ”— https://tiny.cc/plxdigitalocean
✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨✨