Skip to content

Instantly share code, notes, and snippets.

View cannikin's full-sized avatar
🔨
Woodworking

Rob Cameron cannikin

🔨
Woodworking
View GitHub Profile
@cannikin
cannikin / README.md
Last active March 24, 2024 22:54 — forked from p123ad/README.md
Use Raspberry Pi Camera with Prusa Connect

Use Raspberry Pi and Pi Cam for Prusa Connect

I couldn't get the script from p123ad to work on my Pi Zero W 2 with Camera Module 3 (all kinds of ffmpeg errors). There are several built-in tools for working with the camera now, so I tried to figure out if I could use one of those instead.

Behold this version, which uses the built-in libcamera-still tool to actually interact with the camera and save a JPEG. That image is then uploaded to Prusa Connect, same as the original script.

Instructions

  1. Go to the Cameras section at https://connect.prusa3d.com
  2. Add a new camera "Add new other camera"
-- smb.conf
#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
@cannikin
cannikin / math.rb
Created March 9, 2021 01:03
Simple inline Ruby tests
# Just run this file with ruby to run tests: `ruby math.rb`
require 'minitest/autorun'
class Math
def self.add(a, b)
a + b
end
end
@cannikin
cannikin / verify_txn.js
Created February 10, 2022 16:24 — forked from joe-p/verify_txn.js
Verify signed algosdk transaction (javascript)
const algosdk = require('algosdk');
const nobleEd25519 = require('@noble/ed25519');
// setup connection to algoexplorer API
const algodClient = new algosdk.Algodv2("", 'https://api.testnet.algoexplorer.io', '');
// generate a standalone account
const account = algosdk.generateAccount();
(async () => {
@cannikin
cannikin / site-config.conf
Last active January 20, 2022 05:10
nginx Config for Redwood Apps
# With this nginx config you'll be able to serve your static assets through nginx
# while serving the API from Redwood. Start your API server with `yarn rw serve api`
# (or better yet have pm2 manage it for you) and static assets will be delivered
# from /web/dist
#
# Static assets will be given max cache headers and gzipped.
#
# Note that this is only the config for a single site, not the entire global
# nginx config settings. Depending on your install, you may have a /etc/nginx/sites-available
# directory. This file goes in there, and then a symlink to it is added in
@cannikin
cannikin / redwoodrecord.md
Last active November 22, 2021 17:01
RedwoodRecord: An ORM for Redwood

RedwoodRecord

RedwoodRecord is an ORM (Object-Relational Mapping) for working with database data. Wikipedia says an ORM is for "converting data between incompatible type systems using object-oriented programming languages." In the world of web applications it usually means to a way get data in and out of your database in a way that feels more native to the language you're using, rather than trying to provide just a simple layer on top of raw SQL statements.

This document serves as a Readme Driven Development source for describing the behavior of this system.

{
"datamodel": {
"enums": [],
"models": [
{
"name": "User",
"isEmbedded": false,
"dbName": null,
"fields": [
{
@cannikin
cannikin / resolve_rendering.md
Last active March 28, 2020 01:30
Davinci Resolve 16.2 Rendering Exploration

Latest as of 2020-03-27

After a bunch of YouTube uploads I now think these two are the closest:

<iframe width="560" height="315" src="https://www.youtube.com/watch?v=okDg09us28U?rel=0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture; modestbranding; showinfo=0" allowfullscreen></iframe>
  • Timeline Gamma is Rec.709 (Scene)
  • Codec is h264 (much faster to upload and process)
  • Render Color Space is "Same"
  • Render Gamma is "Same"
https://docs.google.com/document/u/0/d/16RKNoz1sbl9czUrDbtaJuTtIIbjiWjmI51KNt8JrVmI
https://flipgrid.com/6cc41ce5
https://cetera.zoom.us/j/4595112813?pwd=Mi9hTjUrdEM1QUxwME1WYjNhSHZlZz09