Skip to content

Instantly share code, notes, and snippets.

View JacobMuchow's full-sized avatar

Jacob Muchow JacobMuchow

View GitHub Profile
@JacobMuchow
JacobMuchow / AvatarView.js
Last active June 27, 2022 20:28 — forked from dosterz97/AvatarView.js
Camera, Controls, and Scene
import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'
async componentDidMount() {
...
this.camera = new THREE.PerspectiveCamera(75, window.innerWidth / (window.innerHeight - navigationBarHeight), 0.1, 1000)
this.camera.position.set(0, 0, 3)
this.controls = new OrbitControls(this.camera, this.renderer.domElement)
import React from 'react';
import * as THREE from "three"
const navigationBarHeight = 100
...
async componentDidMount() {
const mainView = this.mainViewRef.current
this.renderer = new THREE.WebGLRenderer({ antialias: true })
@JacobMuchow
JacobMuchow / AvatarView.js
Last active June 27, 2022 20:18 — forked from dosterz97/AvatarView.js
Creating our Component
import React from 'react';
export class AvatarView extends React.Component {
mainViewRef = React.createRef()
render = () => (
<div
ref={this.mainViewRef}
className="avatarView"
style={{
display: `${!this.props.showIFrame ? 'none': 'block'}`,
height: calc(100vh - 100px);
@JacobMuchow
JacobMuchow / rename-files.py
Created June 15, 2022 20:57
Bulk file renaming script with regex
# Python 3
# Bulk file renaming script
# importing os module
import os
import re
import sys
import glob
if len(sys.argv) != 5:
@JacobMuchow
JacobMuchow / rpm_blendshapes.ts
Created April 26, 2022 17:36
Ready Player Me BlendShape Hookup
this.predictor.onPredict = prediction => {
for (const key in prediction.blendShapes) {
const value = prediction.blendShapes[key]
// RPM uses the ARKit key convention ("mouthSmileLeft" as opposed to "mouthSmile_L")
const arKitKey = BlendShapeKeys.toARKitConvention(key)
// Now... apply these values to moprh target settings in model meshes
// three.js example
@JacobMuchow
JacobMuchow / index.ts
Last active March 15, 2022 20:38
AvatarWebKit Example - start
let stream = await navigator.mediaDevices.getUserMedia({
audio: false,
video: {
width: { ideal: 640 },
height: { ideal: 360 },
facingMode: 'user'
}
})
predictor.start({ stream })
@JacobMuchow
JacobMuchow / index.ts
Created March 15, 2022 20:36
AvatarWebKit - onPredict
predictor.onPredict = (results => {
console.log(results)
})
// or if you like RX
this.predictor.dataStream.subscribe((results) => {
console.log(results)
})
@JacobMuchow
JacobMuchow / index.ts
Last active March 15, 2022 20:35
AvatarWebKit - init
import { AUPredictor } from '@quarkworks-inc/avatar-webkit'
let predictor = new AUPredictor({
apiToken: ${AVATAR_WEBKIT_AUTH_TOKEN},
...
})
@JacobMuchow
JacobMuchow / QuarkWorks Technical Interview Code.py
Last active December 23, 2020 15:01
QuarkWorks Technical Interview Code.py
from datetime import datetime, timedelta
from rest_framework.request import Request
from rest_framework.response import Response
from rest_framework.status import HTTP_200_SUCCESS
from rest_framework.views import APIView
import shopify
from django.settings import IS_TEST
from trynow.models import (
Order,
@JacobMuchow
JacobMuchow / co.quarkworks.jenkins-slave-agent.plist
Last active May 30, 2019 16:27
OS X Jenkins Slave Agent Launch Daemon
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>co.quarkworks.jenkins-slave-agent</string>
<key>UserName</key>
<string>jenkins</string>
<key>SessionCreate</key>
<true/>