import { Text, View } from "react-native";
import Animated, {
Extrapolation,
interpolate,
useAnimatedScrollHandler,
useAnimatedStyle,
useSharedValue,Guide on how to use Nano Banana aka Gemini 2.5 Flash Image in JavaScript with the Google GenAI JS/TS SDK.
A detailed blog post can be found on TBD.
More resources:
- Get an API key from Google AI Studio.
- Nano Banana Gemini API docs
| // 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
| // You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
| (() => { | |
| const SHOW_SIDES = false; // color sides of DOM nodes? | |
| const COLOR_SURFACE = true; // color tops of DOM nodes? | |
| const COLOR_RANDOM = false; // randomise color? | |
| const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
| const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
| const THICKNESS = 20; // thickness of layers | |
| const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
| import { StatusBar } from "expo-status-bar"; | |
| import React, { useState } from "react"; | |
| import { | |
| FlatList, | |
| View, | |
| Text, | |
| Image, | |
| StyleSheet, | |
| SafeAreaView, | |
| useWindowDimensions, |
12th July, 2023. I'm going to try creating an iOS app called Paranovel, using Expo. My environment for mobile app dev (Xcode, Ruby, etc.) should be in reasonably good shape already as I frequently develop with React Native and NativeScript.
Go to https://docs.expo.dev, and see the Quick Start: npx create-expo-app paranovel
This runs with no problem, then I get this macOS system popup:
| // DEPRECATED | |
| const { | |
| withDangerousMod, | |
| WarningAggregator, | |
| AndroidConfig, | |
| withAppBuildGradle, | |
| } = require("@expo/config-plugins"); | |
| const path = require("path"); | |
| const fs = require("fs"); |
A demo "counter" + async application (codesandbox) is provided for each of the following four state libraries. The Zustand codesandbox includes three versions: vanila, immer, and redux-like
- https://codesandbox.io/s/github/reduxjs/redux-essentials-counter-example/tree/master/?from-embed
- https://redux-toolkit.js.org/tutorials/quick-start
- https://redux.js.org/usage/writing-tests
RTK Query has a (currently experimental) code-gen tool that will take an OpenAPI spec or GraphQL schema and give you a typed API client, as well as provide methods for enhancing the generated client after the fact.
| const path = require("path"); | |
| const { withUnimodules } = require("@expo/webpack-config/addons"); | |
| module.exports = { | |
| stories: ["../src/**/*.stories.@(ts|tsx|js|jsx)"], | |
| webpackFinal: async (config) => { | |
| return withUnimodules( | |
| config, | |
| { | |
| projectRoot: path.resolve(__dirname, "../"), |