Skip to content

Instantly share code, notes, and snippets.

@CodeFoodPixels
CodeFoodPixels / test.py
Created March 31, 2024 01:50
Protobuf workstatus
import work_status_pb2
workstatus = work_status_pb2.WorkStatus()
workstatus.ParseFromString(b"\x10\x052\x00")
print(workstatus.State.Name(workstatus.state))
{
"id": "2019-06-26",
"title": "June - A Testing Extravaganza!",
"blurb": "This month is a testing extravaganza with talks from Colin Wren talking about testing Kafka and Daniel Irvine talking about doing test driven development with React.\n\nWe'll also be giving away 2 codes for a year subscription for a Jetbrains toolbox product of your choice!",
"talks": [
{
"name": "Testing Kafka with Jest and NodeJS",
"speaker": {
"name": "Colin Wren",
"twitter": "colinwren"
@CodeFoodPixels
CodeFoodPixels / gist:2d941fcb7e05cae363840a86fc2a163b
Last active August 16, 2018 10:13
Pickled red cabbage recipe

All measures are approximate, I don't really measure stuff.

Ingredients:

  • ½ red cabbage
  • 250ml cider vinegar
  • 1 red apple (I used braeburn)
  • ½ red onion
  • 2 tablespoons sugar
  • Salt & Pepper to your taste
sudo apt-get update -qy && apt-get -qy install build-essential git
git clone https://github.com/FFmpeg/FFmpeg.git
cd FFmpeg
sudo apt-get install -qy libomxil-bellagio-dev libasound2-dev libmp3lame-dev
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-omx --enable-omx-rpi --enable-libmp3lame --enable-nonfree --extra-libs=-lasound
sudo make -j4
sudo make install
raspivid -o - -t 0 -w 1920 -h 1080 -fps 30 -b 8000000 -g 60 | ffmpeg -y -xerror -thread_queue_size 32K -f h264 -r 30 -itsoffset 0 -i - -f alsa -ar 11025 -itsoffset 5.5 -async 1 -ac 1 -thread_queue_size 32K -i hw:1 -c:a aac -b:a 32k -async 1 -c:v copy -f flv -flags:v +global_header -rtmp_buffer 10000 -r 30 -async 1 rtmp://a.rtmp.youtube.com/live2/<<key>>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@CodeFoodPixels
CodeFoodPixels / keybase.md
Last active March 8, 2016 14:01
keybase.md

Keybase proof

I hereby claim:

  • I am lukeb-uk on github.
  • I am lukeb (https://keybase.io/lukeb) on keybase.
  • I have a public key whose fingerprint is 7213 41F8 8B8B 890A 922A 6B93 8957 6257 3EBC 04AA

To claim this, I am signing this object:

@CodeFoodPixels
CodeFoodPixels / gist:ce1aaf3d0c8290324d00
Created September 1, 2014 22:30
Simple UDP listener in node
var dgram = require('dgram');
var server = dgram.createSocket('udp4');
server.bind(9600);
server.on('message', function (message) {
if (message.toString().match('{"source":"kankun-plug"')) {
console.log(message.toString());
}
});