Skip to content

Instantly share code, notes, and snippets.

@shadowmint
shadowmint / HandTracker.py
Created July 25, 2021 06:43
dephai + flask
from os import path
import cv2
import depthai as dai
import numpy as np
import mediapipe_utils as mpu
from FPS import FPS, now
using System;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
[System.Serializable]
public struct NPrefabRef<T> : IDisposable
{
public GameObject root;
@shadowmint
shadowmint / cargo.toml
Created December 21, 2018 04:03
Async actix
[package]
name = "rust-service-app"
version = "0.1.0"
authors = [""]
edition = "2018"
[dependencies]
actix-web = "0.7"
actix = "0.7"
serde_json = "*"
package example
import org.apache.commons.math3.geometry.euclidean.twod._
import org.apache.commons.math3.geometry.partitioning.{BoundaryProjection, RegionFactory}
import org.apache.commons.math3.geometry.partitioning.Region.Location
import org.scalatest._
import scala.collection.JavaConverters._
class GeomTest extends FlatSpec with Matchers {
@shadowmint
shadowmint / build.sbt
Created October 24, 2018 09:01
sqlite & scala
import Dependencies._
lazy val root = (project in file(".")).
settings(
inThisBuild(List(
organization := "com.example.test",
scalaVersion := "2.12.7",
version := "0.1.0-SNAPSHOT"
)),
name := "hello-cats",
import {Subject} from 'rxjs';
export default class Model {
constructor(state) {
this.state = state;
this.loading = false;
this.error = null;
this._delta = new Subject(this);
this._subs = [];
}
@shadowmint
shadowmint / Sample observable
Created February 28, 2018 09:21
Rust observable
extern crate core;
use std::sync::atomic::AtomicBool;
use std::mem::transmute;
use std::sync::atomic::Ordering;
pub struct Observer {
hidden: Option<*const HiddenState>
}
@shadowmint
shadowmint / promise.rs
Created February 27, 2018 09:22
Promise type for rust
#[derive(PartialEq)]
pub enum State {
Pending,
Resolved,
Rejected,
}
pub struct Promise<T, TErr> {
value: Option<Result<T, TErr>>,
state: State,
@shadowmint
shadowmint / BackRef
Created February 26, 2018 09:12
BackRef reference?
use std::sync::Arc;
#[derive(PartialEq)]
enum SafePtrState {
Pending,
Resolved,
}
struct SafePtrData {
s1: SafePtrState,
@shadowmint
shadowmint / Packages
Last active December 4, 2017 13:01
Execute sql with .NET core
<PackageReference Include="System.Data.Common" Version="4.3.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.4.0" />