Skip to content

Instantly share code, notes, and snippets.

Campaigning Thingo

The models you have are: Campaign, User, Card, Question and Response. Here's how I would do it using ActiveRecord

Campaigns exist with questions and responses by users. The Campaign model would look like this:

class Campaign < ActiveRecord::Base
  has_many :questions
 has_many :responses, :through =&gt; :questions
@devjj
devjj / ffmpeg-hevc-encode-nvenc.md
Last active April 28, 2022 18:36
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with an optional CUVID-based hardware-accelerated decoder.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

tl;dr

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc constqp -global_quality 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

ffmpeg -hide_banner -i input -c:v hevc_nvenc -preset hq -rc vbr_hq -b:v 30000k -qmin 17 -qmax 21 -c:a libfdk_aac -ar:a 48000 -channel_layout:a 5.1 -ab:a 640k output

@devjj
devjj / mastodon-docker-setup.md
Created April 25, 2022 19:59 — forked from jobotz/mastodon-docker-setup.md
Mastodon Docker Setup

Mastodon Docker Setup

Setting up

Clone Mastodon's repository.

# Clone mastodon to ~/mastodon directory
git clone https://github.com/mastodon/mastodon.git
# Change directory to ~/mastodon

cd ~/mastodon

@devjj
devjj / whisper-transcribe.bash
Created November 14, 2022 03:35 — forked from DaniruKun/whisper-transcribe.bash
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@devjj
devjj / install.md
Last active March 17, 2024 03:04 — forked from floehopper/install.md
Install rtl-sdr on Raspian on Raspberry Pi
jamesmead@floehopper.local:~$ sudo dd bs=1m if=/Users/jamesmead/Downloads/2015-02-16-raspbian-wheezy.img of=/dev/disk2
pi@raspberrypi ~ $ sudo raspi-config
# Choose option 1 to "Expand Filesystem" - Ensures that all of the SD card storage is available to the OS
# Choose Finish & reboot

pi@raspberrypi ~ $ sudo apt-get update