View lefthook.yml
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
// cSpell:word commitlint typecheck | |
pre-commit: | |
parallel: true | |
commands: | |
type-check: | |
glob: '*.{ts,tsx}' | |
run: yarn typecheck | |
lint: | |
glob: '*.{js,ts,jsx,tsx}' |
View imageToTensor.ts
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 ndarray from 'ndarray'; | |
import ops from 'ndarray-ops'; | |
import { Tensor } from 'onnxjs'; | |
export function preProcess(ctx: CanvasRenderingContext2D): Tensor { | |
const imageData = ctx.getImageData(0, 0, ctx.canvas.width, ctx.canvas.height); | |
const { data, width, height } = imageData; | |
const dataTensor = ndarray(new Float32Array(data), [width, height, 4]); | |
const dataProcessedTensor = ndarray(new Float32Array(width * height * 3), [1, 3, width, height]); | |
ops.assign(dataProcessedTensor.pick(0, 0, null, null), dataTensor.pick(null, null, 2)); |
View MainActivity.java
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
package fetchsky.androidsample; | |
import android.annotation.TargetApi; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.util.Log; | |
import android.webkit.WebResourceRequest; |
View ViewController.swift
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 UIKit | |
class ViewController: UIViewController, UIWebViewDelegate { | |
@IBOutlet weak var webView: UIWebView! | |
override func viewDidLoad() { | |
super.viewDidLoad(); | |
View interactions.js
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
export default class soccerVR extends React.Component { | |
render() { | |
return ( | |
<View style={styles.panel}> | |
<View style={styles.logosContainer}> | |
{/* Iterating over CLUBS and rendering content */} | |
{CLUBS.map(club => ( | |
<VrButton | |
key={club.id} | |
onClick={() => console.log("Click")} |
View content.js
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 CLUBS = [ | |
{ | |
id: "manutd", | |
name: "Manchester United", | |
logoUrl: "https://i.ibb.co/mBnCHjY/manUtd.png" | |
}, | |
{ | |
id: "barcelona", | |
name: "Barcelona", |
View layout.js
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
export default class soccerVR extends React.Component { | |
render() { | |
return ( | |
<View style={styles.panel}> | |
{/* This container will align all logos in center as row */} | |
<View style={styles.logosContainer}> | |
{/* Each view will have logo and name of club */} | |
<View style={styles.logoHolder} /> | |
<View style={styles.logoHolder} /> |
View HookContainer.js
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
/* | |
* | |
* HackerNews | |
* | |
*/ | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { useSelector, useDispatch, shallowEqual } from 'react-redux'; | |
import { createStructuredSelector } from 'reselect'; |
View ClassContainer.js
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
/* | |
* | |
* HackerNews | |
* | |
*/ | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { connect } from 'react-redux'; | |
import { createStructuredSelector } from 'reselect'; |
View fritzStyleModel-Usage.js
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
poppyField.style({ | |
imagePath: 'https://farm9.staticflickr.com/8295/8007075227_dc958c1fe6_z_d.jpg', | |
}).then((resp) => { | |
this.setState((state) => ({ | |
styledImagePath: state.styledImagePath.concat([resp.imagePath]), | |
})); | |
}).catch((err) => { | |
console.log(err); | |
}); |
NewerOlder