This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "AppDelegate.h" | |
#import <RNBranch/RNBranch.h> | |
#import <React/RCTBridge.h> | |
#import <React/RCTBundleURLProvider.h> | |
#import <React/RCTRootView.h> | |
#import <React/RCTLinkingManager.h> | |
#import <AppCenterReactNative.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 1. Initialize new node project (npm init -y) | |
* 2. Run: npm install ethers | |
* 3. Add private key where PRIVATE_KEY | |
* 4. Optionally, update gas price (line 29) or chosen gas limit | |
* 5. Run: node mint-temporal-loot.js | |
* 6. NOTE: Don't forget to get an API key fgrom Alchemy and replace the variable in line 15 | |
*/ | |
// Imports | |
require("dotenv").config(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Client, oauth2 } from 'ketting'; | |
const client = new Client('api.example.org'); | |
client.use(oauth2({ | |
grantType: 'password', | |
clientId: 'fooClient', | |
clientSecret: 'barSecret', | |
tokenEndpointUri: 'https://api.example.org/oauth/token', | |
scopes: ['test'] | |
userName: 'fooOwner', | |
password: 'barPassword' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ArticleView = () => { | |
const { loading, error, data } = useResource<Article>('/article/1'); | |
if (loading) return <p>Loading…</p>; | |
if (error) return <div class="error">{error.message}</div>; | |
return ( | |
<article> | |
<h1>{data.title}</h1> | |
<p>{data.body}</p> | |
</article> | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const authorCollection = await authorResource.follow('author-collection'); | |
const newAuthor:Author = { | |
firstName: 'Ursula', | |
lastName: 'Le Guin', | |
}; | |
const newAuthorResource = await authorCollection.post(newAuthor); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ketting = new Ketting('https://api.example.org/'); | |
const createArticle = await ketting.follow('articleCollection').follow('new'); // chained follow | |
const newArticle = await createArticle.post({ title: 'Hello world' }); | |
const author = await newArticle.follow('author'); | |
// Output author information | |
console.log(await author.get()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"_links": { | |
"self": { | |
"href": "/author/4554" | |
}, | |
"curries": [ | |
{ | |
"name": "ns", | |
"href": "http://booklistapi.com/rels/{rel}", | |
"templated": true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { PureComponent, useState, useEffect } from 'react'; | |
import { AppRegistry, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; | |
import { RNCamera } from 'react-native-camera'; | |
import Permissions from 'react-native-permissions'; | |
const CameraApp = () => { | |
let [flash, setFlash] = useState('off') | |
let [zoom, setZoom] = useState(0) | |
let [autoFocus, setAutoFocus] = useState('on') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { PureComponent, useState, useEffect } from 'react'; | |
import { AppRegistry, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; | |
import { RNCamera } from 'react-native-camera'; | |
import Permissions from 'react-native-permissions'; | |
const CameraApp = () => { | |
let [flash, setFlash] = useState('off') | |
let [zoom, setZoom] = useState(0) | |
let [autoFocus, setAutoFocus] = useState('on') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
import React, { PureComponent, useState } from 'react'; | |
import { AppRegistry, StyleSheet, Text, TouchableOpacity, View } from 'react-native'; | |
import { RNCamera } from 'react-native-camera'; | |
import Permissions from 'react-native-permissions'; | |
const CameraApp = () => { | |
let [flash, setFlash] = useState('off') | |
let [zoom, setZoom] = useState(0) | |
let [autoFocus, setAutoFocus] = useState('on') |
NewerOlder