Skip to content

Instantly share code, notes, and snippets.

View tanner-west's full-sized avatar

Tanner West tanner-west

View GitHub Profile
//
// RCTVisionModule.m
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
import React, {FC} from 'react';
import {Button, NativeModules, SafeAreaView} from 'react-native';
const {VisionModule} = NativeModules;
const App: FC = () => {
return (
<SafeAreaView>
<Button title="Say Hello" onPress={() => VisionModule?.sayHello()} />
</SafeAreaView>
);
//
// RCTVisionModule.m
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
//
// RCTVisionModule.swift
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
import Foundation
@objc(RCTVisionModule)
class RCTVisionModule: NSObject {
{
tweets: [
{
dateTimeISO: '1776-07-04T12:00:00Z',
content: 'We hold these truths to be self-evident, that all men are created equal, that they are endowed by their Creator with certain unalienable Rights, that among these are Life, Liberty and the pursuit of Happiness. #IndependenceDay',
sender: 'Thomas Jefferson'
},
{
dateTimeISO: '1776-07-04T12:10:00Z',
content: 'Today is a day that will be remembered throughout history. The Continental Congress has declared independence from Great Britain. Let freedom ring! 🇺🇸 #IndependenceDay',
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: "xxx",
});
const openai = new OpenAIApi(configuration);
async function callCompletionAPI() {
try {
from PIL import Image
import os
import colorsys
def hue_rotation(image_path, output_path, degrees):
image = Image.open(image_path)
image = image.convert("RGB")
pixels = image.load()
width, height = image.size
//
// RCTVisionModule.m
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>
//
// RCTVisionModule.swift
// VisionNativeModulePOC
//
// Created by Tanner West on 6/2/23.
//
import Foundation
@objc(RCTVisionModule)
import {
Button,
RefreshControl,
SafeAreaView,
ScrollView,
Text,
View,
} from "react-native";
import { Provider, useDispatch, useSelector } from "react-redux";
import { configureStore } from "@reduxjs/toolkit";