Skip to content

Instantly share code, notes, and snippets.

View frnsys's full-sized avatar
🏠
Working from home

Francis Tseng frnsys

🏠
Working from home
View GitHub Profile
@frnsys
frnsys / scanner.rs
Created July 9, 2024 10:18
scanner
use crate::{
anim::{animation, Anim},
state,
util::{detect_center_element, nodelist_to_elements, to_ws_el},
views::cards::{CardFocusArea, Cards, DragRect, Draggable},
write_state,
};
use leptos::*;
use std::{rc::Rc, time::Duration};
use wasm_bindgen::JsCast;
@frnsys
frnsys / atlas.py
Last active September 3, 2024 13:59
Blender auto-merging objects and textures
"""
To install additional libraries:
cd /opt/blender/3.2/python/bin
./python3.10 -m ensurepip
./python3.10 -m pip install pillow shapely networkx cairosvg
Python headers are required for compiling nest2d.
Download the source for your blender python version
(e.g. 3.10.8) from <https://www.python.org/downloads/source/>
@frnsys
frnsys / mixamo-to-mpfb2_game_engine.bmap
Created December 2, 2022 17:42
Mixamo to MPFB2 Game Engine remap for Auto-Rig Pro
head%False%ABSOLUTE%0.0,0.0,0.0%0.0,0.0,0.0%1.0%False%False%
mixamorig:Head
False
False
None%False%ABSOLUTE%0.0,0.0,0.0%0.0,0.0,0.0%1.0%False%False%
mixamorig:HeadTop_End
False
False
@frnsys
frnsys / mixamo.json
Created July 25, 2022 20:38
Mixamo rig mapping for BVH retargeter
{
"name" : "Mixamo",
"url" : "",
"bones" : {
"mixamorig:Hips" : "hips",
"mixamorig:Spine" : "spine",
"mixamorig:Spine1" : "spine-1",
"mixamorig:Spine2" : "chest",
"mixamorig:Neck" : "neck",
@frnsys
frnsys / quick_tree.py
Created April 19, 2021 00:16
Quick low-poly tree addon for Blender
import bpy
import bmesh
from random import random, uniform, choice, randrange
from mathutils import Matrix, Vector
from bmesh.types import BMVert, BMFace, BMEdge
from bpy.props import (
IntProperty,
IntVectorProperty,
FloatProperty,
FloatVectorProperty,
@frnsys
frnsys / gltf.js
Created September 16, 2019 17:54
3d objects code
/**
* @author Rich Tibbett / https://github.com/richtr
* @author mrdoob / http://mrdoob.com/
* @author Tony Parisi / http://www.tonyparisi.com/
* @author Takahiro / https://github.com/takahirox
* @author Don McCurdy / https://www.donmccurdy.com
*/
import * as THREE from 'three';
@frnsys
frnsys / index.html
Last active August 22, 2019 02:21
grid system
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>test</title>
<link rel="stylesheet" href="style.css">
</head>
<body>

Installed:

sudo apt install pulseaudio-module-raop paprefs

Ran paprefs and check the option to use AirPlay speakers locally.

Restarted pulseaudio:

@frnsys
frnsys / distributed_estimator.py
Created November 26, 2018 15:47
example of a custom tensorflow estimator with distributed training
"""
Tensorflow estimator API example
References:
- <https://www.tensorflow.org/guide/custom_estimators>
- <https://github.com/tensorflow/models/blob/master/samples/core/get_started/custom_estimator.py>
- <https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/distribute/README.md>
"""
import numpy as np
import tensorflow as tf
// dummy data
let orders = [{
userId: 0
}, {
userId: 1
}, {
userId: 1
}];
let users = [{