Skip to content

Instantly share code, notes, and snippets.

View louicoder's full-sized avatar
🏠
Working remotely

Musanje Louis Michael louicoder

🏠
Working remotely
View GitHub Profile
@Glazzes
Glazzes / App.tsx
Last active April 12, 2025 11:24
React Native pinch to zoom advanced
/**
* 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.
@louicoder
louicoder / sockets-react-native.js
Created October 14, 2021 10:26
React native websocket connection
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';
//
@n1snt
n1snt / Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md
Last active April 24, 2025 13:33
Oh my ZSH with zsh-autosuggestions zsh-syntax-highlighting zsh-fast-syntax-highlighting and zsh-autocomplete.md

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@btoo
btoo / useKeyboardHeight.ts
Last active June 12, 2024 04:43
react native keyboard height hook
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));
@giacomocerquone
giacomocerquone / adbCommands.txt
Last active April 6, 2025 09:44
Useful adb logcat commands when working with react native
// 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"

Twilio errors

Start Verification

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}
@jvandenaardweg
jvandenaardweg / App.jsx
Last active November 19, 2020 22:41
Use React's Context API in React Native (0.59.0) to have network connectivity status globally available. Gist for Medium article: https://medium.com/@jvandenaardweg/easily-manage-connection-status-updates-in-react-native-28c9b4b0647f
import React from 'react';
import { NetworkProvider } from './NetworkProvider';
import { ExampleComponent } from './ExampleComponent';
export default class App extends React.PureComponent {
render() {
return (
<NetworkProvider>
<ExampleComponent />
@SagiMedina
SagiMedina / ImageTools.js
Last active September 7, 2024 04:39
Resize and crop images in the Browser with orientation fix using exif
import EXIF from 'exif-js';
const hasBlobConstructor = typeof (Blob) !== 'undefined' && (function checkBlobConstructor() {
try {
return Boolean(new Blob());
} catch (error) {
return false;
}
}());
@chranderson
chranderson / nvmCommands.js
Last active April 24, 2025 18:42
Useful NVM commands
// 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
@anubhavshrimal
anubhavshrimal / CountryCodes.json
Last active April 23, 2025 18:31 — forked from Goles/CountryCodes.json
Country and Dial or Phone codes in JSON format
[
{
"name": "Afghanistan",
"dial_code": "+93",
"code": "AF"
},
{
"name": "Aland Islands",
"dial_code": "+358",
"code": "AX"