In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and
returning the cached result when the same
inputs occur again.
— wikipedia
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
// | |
// YeetJSIUTils.h | |
// yeet | |
// | |
// Created by Jarred WSumner on 1/30/20. | |
// Copyright © 2020 Facebook. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <jsi/jsi.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
import { forEachObjIndexed } from "ramda"; | |
import * as React from "react"; | |
import { | |
Animated, | |
ScrollView, | |
View, | |
ViewStyle, | |
LayoutChangeEvent, | |
NativeScrollEvent, | |
} from "react-native"; |
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
// This sample is a Work in Progress for JSI , and specific functions may change. | |
#pragma once | |
#include <string> | |
#include <unordered_map> | |
#include <jsi/jsi.h> | |
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to 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
using System; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Media.Animation; | |
namespace mrousavy { | |
public static class AnimationExtensions { | |
/// <summary> | |
/// Animate a given <see cref="UIElement" />/<see cref="System.Windows.Controls.Control" /> asynchronous (awaitable) | |
/// </summary> |
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
extension AVCaptureVideoDataOutput { | |
var availableVideoCVPixelFormatTypedEnums: [OSTypedEnum] { | |
let availablePixelFormatDescriptions: Array<OSType> = self.availableVideoCVPixelFormatTypes as! Array<OSType> | |
let availablePixelFormats: Array<OSTypedEnum> = availablePixelFormatDescriptions.map { OSTypedEnum(rawValue: $0)! } | |
return availablePixelFormats | |
} | |
} | |
enum OSTypedEnum: OSType { | |
case monochrome1 = 1 |
- Create a gist if you haven't already.
- Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone git@gist.github.com:<hash>.git # or with ssh
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
using UnityEngine; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System; | |
using System.Threading; | |
using System.Linq; | |
[ExecuteInEditMode] | |
/// <summary> | |
/// Multithreading support |
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
public class GetScreenshot{ | |
public static BitmapSource GetScreen(Rectangle coordinates) { | |
int left = coordinates.Left; | |
int top = coordinates.Top; | |
int width = coordinates.Width; | |
int height = coordinates.Height; | |
using(var screenBmp = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb)) { | |
using(var bmpGraphics = Graphics.FromImage(screenBmp)) { |
NewerOlder