Skip to content

Instantly share code, notes, and snippets.

View Apsu's full-sized avatar

Eve Apsu

  • Lambda Labs
  • Pittsburgh, PA
View GitHub Profile
@Apsu
Apsu / warping.md
Last active March 26, 2020 06:40
Warping

Warping

Keep track of

  • Camera look direction
    • Use to calculate relative rotation to transform.rotation
  • Move direction
    • Use to calculate relative rotation to transform.forward

OnAnimatorIK

@Apsu
Apsu / HeadLook.cs
Created March 10, 2020 04:15
Unity HeadLook
using UnityEngine;
public class HeadLook : MonoBehaviour
{
[Header("Configs")]
[Range(0.0f, 1.0f)]
public float headLookWeight;
private Animator animator;
private Vector3 lookAtPosition;
@Apsu
Apsu / modaledit.json
Created March 4, 2020 21:06
ModalEdit Bindings
"modaledit.keybindings": {
"\n": [
"lineBreakInsert",
"cursorDown",
"cursorHome"
],
" ": "modaledit.enterInsert",
"y": "removeSecondaryCursors",
// Selection mode on/off
"s": "modaledit.toggleSelection",
@Apsu
Apsu / .tmux.conf
Created January 27, 2015 17:54
vi{,m} environment config files
# Prefix and cycle
set-option -g prefix C-\\
bind C-\ last-window
# Reload config
bind r source-file ~/.tmux.conf
# Mouse mode
set -g mode-mouse on
set -g mouse-resize-pane on

CURA

M140 S{material_bed_temperature} ; set bed temp
M104 S{material_print_temperature} ; set hotend temp

G28 ; home
G1 X0 Y0 Z0.5 F6000 ; park head

M190 S{material_bed_temperature} ; wait for bed temp
@Apsu
Apsu / cotript.py
Last active February 14, 2019 13:40
Coplanar Tripteron Inverse Kinematics
#!/usr/bin/env python
from __future__ import print_function
import math
angle = math.radians(35) # Arm offset angle
t = math.tan(angle) # Store tangent
@Apsu
Apsu / fix-veths.sh
Last active February 1, 2018 21:29
Find and fix veth pairs that aren't connected to LXC containers anymore
#!/usr/bin/env bash
# Create associative arrays
declare -A interior=()
declare -A exterior=()
# Make sure ethtool is installed on this host
apt-get install -y ethtool
# For each container
@Apsu
Apsu / bom.md
Last active November 20, 2016 01:51
Tripteron RC1 Bill of Materials

Hardware prices from McMaster-Carr

2020 brackets, rails, belt, and pulleys from AnyCubic/Uxcel/similar on Amazon

Motors from StepperOnline

Bearings from VXB or similar

Qty Item Unit Cost Total Cost
@Apsu
Apsu / sizes.md
Last active November 18, 2016 01:45
Metric PLA Hole Sizes
  • M3 - 2.8mm tight threaded, 3.0mm threaded, 3.3mm clearance
  • M5 - 5.5mm threaded
  • M8 - 8.0mm threaded, 8.5mm shoulder
  • 608 - 22.3mm
  • 2020 - 20.3mm
@Apsu
Apsu / ik.py
Last active October 29, 2016 04:02
Inverse Kinematics for Inverted Cantilever Delta printer
#!/usr/bin/env python
from __future__ import print_function
import math
Motor= ["X", "Y", "Z"] # Motor axes
class Vector: