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
// https://stackoverflow.com/questions/58147978/type-mismatch-occurs-while-the-evaluated-values-are-equal/58148111#58148111 | |
import Data.Fin | |
import Data.Vect | |
lemma : {n : _} -> (a : Fin n) -> finToNat (weaken a) = finToNat a | |
lemma FZ = Refl | |
lemma (FS x) = rewrite lemma x in Refl | |
filter : (elem -> Bool) -> Vect len elem -> (p: (Fin (S len)) ** Vect (finToNat p) elem) |
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
type UseLocal<Locals> = <K extends keyof Locals, Props>(name: K, call: [Render<Props, any, Locals[K]>, Props]) => Locals[K]; | |
type Render<Props, Locals, Element> = (props: Props, useLocal: UseLocal<Locals>) => Element; | |
type LocalComponents<Locals> = { [key in keyof Locals]?: Component<any, any, any> }; | |
class Component<Props, Locals, Element> { | |
private render: Render<Props, Locals, Element>; | |
constructor(render: Render<Props, Locals, Element>) { | |
this.render = render; | |
} |
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
<body> | |
<textarea></textarea> | |
<p></p> | |
<script> | |
const input = document.querySelector("textarea"); | |
const output = document.querySelector("p"); | |
let isComposing = false; | |
const flush = () => { | |
output.innerText += input.value; |
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 assert from 'assert'; | |
import { sample, shuffle } from 'lodash'; | |
export enum Side { | |
Left, | |
Right, | |
} | |
export const { Left, Right } = Side; |
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
<body> | |
<input type="file" accept="image/*" capture="user" /> | |
<script> | |
const input = document.querySelector("input") | |
console.info(input) | |
input.addEventListener("input", async (e) => { | |
fetch("https://api.exchangeratesapi.io/v1/") | |
await new Promise((resolve) => setTimeout(resolve, 1000)); | |
fetch("https://api.exchangeratesapi.io/v1/") | |
}); |
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 App = () => { | |
return ( | |
<View> | |
<WarmCamera /> | |
<FooPage /> | |
</View> | |
); | |
} | |
const FooPage = () => { |
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 * as aws from '@pulumi/aws'; | |
import * as eks from '@pulumi/eks'; | |
import * as k8s from '@pulumi/kubernetes'; | |
import * as pulumi from '@pulumi/pulumi'; | |
import { ComponentResourceOptions } from '@pulumi/pulumi'; | |
export default class AlbIngressController extends pulumi.ComponentResource { | |
constructor(name: string, args: { cluster: eks.Cluster }, options?: ComponentResourceOptions) { | |
super('AlbIngressController', name, args, options); | |
const { cluster } = args; |
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 React, { ForwardedRef, forwardRef, memo, useCallback, useEffect, useMemo } from 'react'; | |
import { Camera, CameraProps, useCameraDevices } from 'react-native-vision-camera'; | |
import { atom, useRecoilValue, useRecoilValueLoadable, useResetRecoilState, useSetRecoilState } from 'recoil'; | |
type CameraProxyProps = Omit<CameraProps, 'isActive'>; | |
export const cameraRefState = atom<ForwardedRef<Camera>>({ | |
key: 'cameraRef', | |
default: null, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 com.rnvc3sandbox.frameprocessor.facerecognizer | |
import android.graphics.* | |
import androidx.camera.core.ImageProxy | |
import androidx.core.graphics.toRectF | |
import java.io.ByteArrayOutputStream | |
fun ImageProxy.cropBitmap(cropRect: Rect): Bitmap { | |
val yBuffer = this.planes[0].buffer // Y | |
val vuBuffer = this.planes[2].buffer // VU |
OlderNewer