Skip to content

Instantly share code, notes, and snippets.

View Maxoos's full-sized avatar

Maxoos

  • Melbourne, Australia
View GitHub Profile
@tranquan
tranquan / CountryPickerApp.tsx
Last active September 26, 2024 05:02
Strong typed-check event listener, can be use to passing callback between scenes with react-navigation
import { StatusBar } from "expo-status-bar";
import React from "react";
import { StyleSheet, Text, View } from "react-native";
import { NavigationContainer } from "@react-navigation/native";
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import ProfileScene from "./ProfileScene";
import CountryPickerScene from "./CountryPickerScene";
const Stack = createNativeStackNavigator();
@devtanc
devtanc / App.js
Last active September 2, 2022 09:07
How to have `onXYZ` event hooks in a ReactNative Native UI Component in Swift
// This file is from an actual react app that would install the library outlined in the rest of these files
import React from 'react'
import { SafeAreaView, StyleSheet, View } from 'react-native'
import RichTextEditor from 'react-native-rich-text-editor'
const styles = StyleSheet.create({
body: {
flex: 1,
},
inputContainer: {
@hervenivon
hervenivon / config.yml
Last active June 23, 2021 04:22
circleci config file for node8 and dynamodb on localstack
version: 2
references:
base_container_config: &base_container_config
docker:
- image: circleci/node:8
working_directory: ~/repo
test_container_config: &test_container_config
docker:
@chourobin
chourobin / 0-bridging-react-native-cheatsheet.md
Last active April 22, 2025 14:27
React Native Bridging Cheatsheet
@mpkuse
mpkuse / XYZ_2_latlong.py
Last active May 2, 2025 13:46
Convert GPS (Latitude and Longitude) to XYZ
""" Give a) points in localcoordinate system b) a gps lat long of the origin of the local coordinate system,
this script helps to convert XYZ to latlong.
Beware that the transformation will be off by an yaw angle. This is because the local cordinate frame is may/or may not align with the East-North-Up frame.
The way it works is XYZ --> ECEF --> geodedic (latlong)
main reference is still the wiki https://en.wikipedia.org/wiki/Geographic_coordinate_conversion#From_ECEF_to_ENU.
However the procedure to convert from ECEF to geodedic in wikip does not give accurate results. Instead the algorithm
@renganatha10
renganatha10 / AccessReactSubView.m
Last active October 17, 2024 10:38
Basic Native UI component Bridging Code
//RCTListViewManger.h
#import <UIKit/UIKit.h>
@interface RCTNativeListView : UIView
@property (nonatomic) NSArray * colors;
@end
--------------------------------------------------------------------------------
//RCTListViewManger.m
@bgreenlee
bgreenlee / UIImage+Resize.swift
Created November 23, 2015 05:24
Swift port of UIImage+Resize, UIImage+Alpha, and UIImage+RoundedCorner, from http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
//
// UIImage+Resize.swift
// Port of UIImage+Resize.m
// from http://vocaro.com/trevor/blog/2009/10/12/resize-a-uiimage-the-right-way/
//
import Foundation
import UIKit
extension UIImage {
@ChuckJHardy
ChuckJHardy / example_activejob.rb
Last active March 12, 2025 21:24
Example ActiveJob with RSpec Tests
class MyJob < ActiveJob::Base
queue_as :urgent
rescue_from(NoResultsError) do
retry_job wait: 5.minutes, queue: :default
end
def perform(*args)
MyService.call(*args)
end
@constellates
constellates / gist:a76132ed7de74610a435
Last active June 16, 2017 13:25
React OAuth 2 user store with Hello.js
// dependencies ----------------------------------------------------------------------
import Reflux from 'reflux';
import Actions from '../actions/Actions';
import request from 'superagent';
import config from '../config';
let UserStore = Reflux.createStore({
// store setup -----------------------------------------------------------------------