Skip to content

Instantly share code, notes, and snippets.

:octocat:
Living my best life

Bardia Rastin bardiarastin

:octocat:
Living my best life
Block or report user

Report or block bardiarastin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bardiarastin
bardiarastin / useApi.js
Last active Jul 25, 2019
simple React custom hook for api access
View useApi.js
import { useState, useEffect } from 'react'
import { PersonsApi } from '../Api/PersonsApi'
const ApiNameMapper = {
PersonsApi,
}
const useApi = (apiName, apiMethod, initialData = null) => {
const [response, setResponse] = useState(null)
View proxy.js
const ProxyChain = require('proxy-chain');
const server = new ProxyChain.Server({
port: 8000,
verbose: false,
prepareRequestFunction: ({ request, username, password, hostname, port, isHttp }) => {
return {
requestAuthentication: username !== 'myusername' || password !== 'mypassword'
};
},
});
@bardiarastin
bardiarastin / cloudSettings
Last active Dec 17, 2017
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2017-12-17T09:12:16.943Z","extensionVersion":"v2.8.7"}
You can’t perform that action at this time.