sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh
/** | |
* After some thoughts on this topic, I've decided to turn this gist along with other features into a library so you can zoom | |
* whatever you want, library you can find here https://github.com/Glazzes/react-native-zoom-toolkit. | |
* | |
* @author Santiago Zapata, Glazzes at Github <3 | |
* @description This gist makes part of an article I'm writing about this topic (in spanish). This solution takes into account | |
* the linear algebra concepts and geometrical interpretation of the transform-origin property specification, this solution | |
* takes heavy inspiration from William's Candillon +3 year old video in this topic, however this solution brings it to the | |
* modern day along with a huge fix that prevents the origin from being displaced by an incorrect offset calculation after | |
* the first zoom interaction. |
import { Text, View, StyleSheet, Alert } from 'react-native'; | |
navigator.__defineGetter__('userAgent', function () { | |
// you have to import rect native first !! | |
return 'react-native'; | |
}); | |
import SocketIOClient from 'socket.io-client/dist/socket.io.js'; | |
// |
import { useEffect } from "react"; | |
import { Keyboard } from "react-native"; | |
import { useState } from "./mounted"; | |
export function useKeyboardHeight() { | |
const [keyboardHeight, setKeyboardHeight] = useState(0); | |
useEffect(() => { | |
const showSubscription = Keyboard.addListener('keyboardDidShow', e => setKeyboardHeight(e.endCoordinates.height)); | |
const hideSubscription = Keyboard.addListener('keyboardWillHide', () => setKeyboardHeight(0)); |
// useful to debug js code errors | |
adb logcat "*:S" ReactNative:V ReactNativeJS:V | |
// useful to debug native errors (when the app won't even start) | |
adb logcat "*:E" |
POST https://api.authy.com/protected/json/phones/verification/start
When... | Example... | Error code | Response is... |
---|---|---|---|
all is well | { "country_code": "84", "phone_number": "0866742932", "via" : "sms" } |
{ "carrier": "Viettel Mobile", "is_cellphone": true, "message": "Text message sent to +84 86-674-2932.", "seconds_to_expire": 599, "uuid": "b07107c0-47be-0137-910b-0a4259707972", "success": true } |
|
parameter missing | { "phone_number": "0866742932", "via" : "sms"} | 60004 | { "error_code": "60004", "message": "Invalid parameter: country_code - Parameter is required", "errors": { "message": "Invalid parameter: country_code - Parameter is required" }, "success": false} |
import React from 'react'; | |
import { NetworkProvider } from './NetworkProvider'; | |
import { ExampleComponent } from './ExampleComponent'; | |
export default class App extends React.PureComponent { | |
render() { | |
return ( | |
<NetworkProvider> | |
<ExampleComponent /> |
import EXIF from 'exif-js'; | |
const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() { | |
try { | |
return Boolean(new Blob()); | |
} catch (error) { | |
return false; | |
} | |
}()); |
// check version | |
node -v || node --version | |
// list locally installed versions of node | |
nvm ls | |
// list remove available versions of node | |
nvm ls-remote | |
// install specific version of node |
[ | |
{ | |
"name": "Afghanistan", | |
"dial_code": "+93", | |
"code": "AF" | |
}, | |
{ | |
"name": "Aland Islands", | |
"dial_code": "+358", | |
"code": "AX" |