Skip to content

Instantly share code, notes, and snippets.

View nabeel-shakeel's full-sized avatar
:electron:
Focusing and Learning

Nabeel Shakeel nabeel-shakeel

:electron:
Focusing and Learning
View GitHub Profile
@thebinaryfelix
thebinaryfelix / ProviderComposer.tsx
Last active December 31, 2022 12:58
Component for composing providers in React v18 with Typescript
export interface IProviderComposerProps extends React.PropsWithChildren {
/**
* Providers list
* */
with: React.FC<React.PropsWithChildren>[]
}
const ComposerFragment: React.FC<React.PropsWithChildren> = ({
children,
}): JSX.Element => <>{children}</>
import { ComponentProps, JSXElementConstructor } from 'react';
export const provider = <C extends JSXElementConstructor<unknown>>(
provider: C,
props: Partial<ComponentProps<C>> = {}
) => [provider, props];
export const ProviderComposer = ({ providers, children }) => {
for (let i = providers.length - 1; i >= 0; --i) {
const [Provider, props] = providers[i];
@milon87
milon87 / api.js
Created September 9, 2017 05:37
how to use x-www-form-urlencoded in react native
var details = {
'userName': 'test@gmail.com',
'password': 'Password!',
'grant_type': 'password'
};
var formBody = [];
for (var property in details) {
var encodedKey = encodeURIComponent(property);
var encodedValue = encodeURIComponent(details[property]);
@pandafulmanda
pandafulmanda / Python3 Virtualenv Setup.md
Last active March 12, 2024 15:59 — forked from akszydelko/Python3 Virtualenv Setup.md
Setting up and using Python3 Virtualenv on Mac

Python3 Virtualenv Setup

Requirements
  • Python 3
  • Pip 3
$ brew install python3