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 March 9, 2024 17:57
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 June 28, 2024 20:49
React Native Bridging Cheatsheet
@renganatha10
renganatha10 / AccessReactSubView.m
Last active July 18, 2020 17:56
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 July 20, 2024 12:15
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 -----------------------------------------------------------------------
@kishmiryan-karlen
kishmiryan-karlen / Apply LUT (LookUpTable).js
Created August 13, 2014 12:59
A function that helps to apply LUT to image. Make sure to change the canvas IDs or to create temporary canvases.
/**
* Created by Karlen on 13-Aug-14.
*/
var imageContext = document.getElementById('imageCanvas').getContext('2d'),
lutContext = document.getElementById('lutCanvas').getContext('2d');
function applyLUT(image, lut) {
var imageData, lutData, iData, lData;