Skip to content

Instantly share code, notes, and snippets.

View russfeld's full-sized avatar

Russell Feldhausen russfeld

View GitHub Profile
using System;
using Newtonsoft.Json;
String json = "{\"items\": [{\"name\": \"ground pork\", \"calories\": 668.2, \"serving_size_g\": 226.796, \"fat_total_g\": 47.4, \"fat_saturated_g\": 17.7, \"protein_g\": 57.8, \"sodium_mg\": 168, \"potassium_mg\": 508, \"cholesterol_mg\": 210, \"carbohydrates_total_g\": 0.0, \"fiber_g\": 0.0, \"sugar_g\": 0.0}]}";
Recipe_List rec = JsonConvert.DeserializeObject<Recipe_List>(json)!;
Console.WriteLine(rec.Items![0].Name);
@russfeld
russfeld / picam-stream-control.py
Created June 5, 2019 17:53
Very simple Python program to control the picam-stream script. Helpful for scripting the livestream. See https://gist.github.com/russfeld/0878b1f8eaf7409136b9125ce5e1458f
import subprocess
import time
import os
import signal
# Some trigger condition to start stream
process = subprocess.Popen("/home/pi/picam-stream.sh", preexec_fn=os.setsid, shell=True)
# Wait for some condition to stop stream
time.sleep(15)
@russfeld
russfeld / picam-stream.sh
Last active April 1, 2024 14:50
Stream Raspberry Pi Camera to Twitch
#!/bin/bash
# =================================================================
# Stream configuration file for Raspberry Pi Camera
#
# @author Russell Feldhausen (russfeldh@gmail.com)
# @version 2019-06-05
#
# This set of commands should allow you to stream video from your
# Raspberry Pi Camera to Twitch and Youtube (and possibly other