Skip to content

Instantly share code, notes, and snippets.

@cs8425
cs8425 / MSPCodes.js
Last active January 22, 2025 07:49
read 'USB Simulator Cable' as joystick and send to betaflight SITL via MSP over tcp.
// from https://github.com/betaflight/betaflight-configurator
'use strict';
//MSPCodes needs to be re-integrated inside MSP object
var MSPCodes = {
MSP_API_VERSION: 1,
MSP_FC_VARIANT: 2,
MSP_FC_VERSION: 3,
MSP_BOARD_INFO: 4,
MSP_BUILD_INFO: 5,
@crackcomm
crackcomm / output_shape_for.py
Created April 29, 2019 22:28 — forked from Erotemic/output_shape_for.py
Output shape information for pytorch
import math
import torch
import torch.nn as nn
import torchvision
REGISTERED_OUTPUT_SHAPE_TYPES = []
def compute_type(type):
def _wrap(func):
@wassname
wassname / running_stats.py
Last active November 14, 2023 15:09
Running stats (mean, standard deviation) for python, pytorch, etc
import numpy as np
# handle pytorch tensors etc, by using tensorboardX's method
try:
from tensorboardX.x2num import make_np
except ImportError:
def make_np(x):
return np.array(x).copy().astype('float16')
class RunningStats(object):
@thoughtpolice
thoughtpolice / jjconfig.toml
Last active July 5, 2025 10:11
my jujutsu config
## ------------------------------------------------------------------------------------------------
# Schema published automatically on the website. This allows TOML language
# servers to autocomplete and show documentation for the entries below.
#
# I use the prerelease version as my builds on my machines are often from trunk.
"$schema" = "https://jj-vcs.github.io/jj/prerelease/config-schema.json"
## ------------------------------------------------------------------------------------------------
## ---- Basic settings

buck2 is very explicit re: the interactions dep files have w/caching:

  • dep files can (after execution) narrow the set of inputs for an action
  • the input set of the action as known to your buck2 daemon will have this narrowed set but...
    • the actual action cache key (as is given to disk/remote caches, etc.) will still have the full set of inputs
  • ultimately this means that as far as remote caching for cold builds is concerned, the action at hand is still keyed on all of its inputs — including the ones that are pruned
    • this means that — for cold builds — if there have been any changes to any of the "pruned out" files since the last run of the action (+ cache population), the action will not hit in the cache
  • additionally, in the event that there are analysis-level changes that result in the starlark action being reconstructed (i.e. BUILD file is edited), we also lose the narrowed set of inputs
  • for changes that materially affect t