This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
credit: https://stackoverflow.com/questions/39356413/how-to-add-a-custom-ca-root-certificate-to-the-ca-store-used-by-pip-in-windows/52961564 | |
>pip config set global.cert path/to/ca-bundle.crt | |
>pip config list # user trusted-host | |
pip.ini or pip.conf | |
[global] | |
trusted-host = pypi.python.org | |
pypi.org | |
files.pythonhosted.org | |
cert = /etc/ssl/certs/ca-bundle.crt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Baringo", | |
"capital": "Kabarnet", | |
"code": 30, | |
"sub_counties": [ | |
"Baringo central", | |
"Baringo north", | |
"Baringo south", | |
"Eldama ravine", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"slate-50": "#f8fafc", | |
"slate-100": "#f1f5f9", | |
"slate-200": "#e2e8f0", | |
"slate-300": "#cbd5e1", | |
"slate-400": "#94a3b8", | |
"slate-500": "#64748b", | |
"slate-600": "#475569", | |
"slate-700": "#334155", | |
"slate-800": "#1e293b", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// One of my new favorite React Hook patternms is to create handler | |
// functions for a custom hook using `React.useMemo` instead of | |
// `React.useCallback`, like so: | |
function useBool(initialState = false) { | |
const [state, setState] = React.useState(initialState) | |
// Instead of individual React.useCallbacks gathered into an object | |
// Let's memoize the whole object. Then, we can destructure the | |
// methods we need in our consuming component. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let strings = []; | |
numbers = []; | |
for (let i = 0; i < 1000000; i++) { | |
strings.push(`${i}`.repeat(100)); | |
numbers.push(i); | |
} | |
(() => { | |
console.time('numbers'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// No Security | |
{ | |
"rules": { | |
".read": true, | |
".write": true | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firebase.storage.TaskEvent.STATE_CHANGED, | |
snapshot => { | |
let state = {}; | |
state = { | |
...state, | |
progress: (snapshot.bytesTransferred / snapshot.totalBytes) * 100 // Calculate progress percentage | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
View, Platform, | |
} from 'react-native'; | |
import { Provider } from 'react-redux'; | |
import { Navigation } from 'react-native-navigation'; | |
import Splash from '../containers/Splash'; | |
import Auth from '../containers/Auth'; | |
import Profile from '../containers/Profile'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"parser": "@typescript-eslint/parser", | |
"parserOptions": { | |
"project": "./tsconfig.json", | |
"tsconfigRootDir": "." | |
}, | |
"env": { | |
"browser": true, | |
"jest/globals": true | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from 'react'; | |
import { | |
StyleSheet, | |
Text, | |
View, | |
TouchableOpacity, | |
Image, | |
FlatList, | |
AsyncStorage, | |
Dimensions, |
NewerOlder