Skip to content

Instantly share code, notes, and snippets.

View jmarsh24's full-sized avatar

Justin Marsh jmarsh24

View GitHub Profile
@jmarsh24
jmarsh24 / Dockerfile
Created February 20, 2024 05:34
This is an example dockerfile for installing audiowaveform and ffmpeg in a rails application.
# syntax = docker/dockerfile:1
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version and Gemfile
ARG RUBY_VERSION=3.2.2
FROM registry.docker.com/library/ruby:$RUBY_VERSION-slim as base
# Rails app lives here
WORKDIR /rails
# Set production environment
# frozen_string_literal: true
class VideosController < ApplicationController
include ActionView::RecordIdentifier
before_action :authenticate_user!, only: %i[edit update create upvote downvote bookmark watchlist complete featured]
before_action :current_search, only: %i[index]
before_action :set_video, only: %i[show edit update destroy hide upvote downvote bookmark watchlist complete featured]
before_action :check_for_clear, only: [:index]
after_action :track_action
import { Controller } from '@hotwired/stimulus';
export default class extends Controller {
static values = { event: String };
declare readonly eventValue?: string;
connect(): void {
this.element.addEventListener(this.eventName, this.onChange);
}
tangotube on  dockerize [$!?] is 📦 v0.1.0 via 💎 v3.0.3 on 🐳 v20.10.13 took 59s
➜ docker-compose up
[+] Running 3/0
⠿ Container tangotube-redis-1 Created 0.0s
⠿ Container tangotube-db-1 Created 0.0s
⠿ Container tangotube-web-1 Created 0.0s
Attaching to tangotube-db-1, tangotube-redis-1, tangotube-web-1
tangotube-redis-1 | 1:C 25 Mar 2022 16:39:35.087 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
tangotube-redis-1 | 1:C 25 Mar 2022 16:39:35.087 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1, just started
tangotube-redis-1 | 1:C 25 Mar 2022 16:39:35.087 # Warning: no config file sp
beast_mode on  master [!?] is 📦 v1.0.0 via 💎 v2.7.3 on 🐳 v20.10.13 took 6s
➜ rails s
=> Booting Puma
=> Rails 6.1.4.7 application starting in development
=> Run `bin/rails server --help` for more startup options
Puma starting in single mode...
* Puma version: 5.5.2 (ruby 2.7.3-p183) ("Zawgyi")
* Min threads: 5
* Max threads: 5
* Environment: development
<!DOCTYPE html>
<html>
<head>
<%= render 'layouts/head' %>
</head>
<body class="no-js <%= "page-#{controller.controller_name}" %> <%= content_for(:body_classes) %>">
<%= render 'layouts/header' %>
<div class="main-page <%= 'with-hero' if content_for?(:hero) %>">
<% if content_for?(:hero) %>
<div class="jumbotron hero-tron">
This file has been truncated, but you can view the full file.
{"results":[{"uid":8585,"indexUid":"Video_development","status":"enqueued","type":"settingsUpdate","details":{"filterableAttributes":["follower","genre","leader","orchestra","year"],"sortableAttributes":["channel_title","liked_count","orchestra","performance_date","song_title","view_count","year"]},"duration":null,"enqueuedAt":"2022-03-20T10:28:27.751898Z","startedAt":null,"finishedAt":null},{"uid":8584,"indexUid":"Video_development","status":"enqueued","type":"indexCreation","details":{"primaryKey":"id"},"duration":null,"enqueuedAt":"2022-03-20T10:28:27.748905Z","startedAt":null,"finishedAt":null},{"uid":8583,"indexUid":"Video_development","status":"enqueued","type":"settingsUpdate","details":{"filterableAttributes":["follower","genre","leader","orchestra","year"],"sortableAttributes":["channel_title","liked_count","orchestra","performance_date","song_title","view_count","year"]},"duration":null,"enqueuedAt":"2022-03-20T10:28:05.182412Z","startedAt":null,"finishedAt":null},{"uid":8582,"indexUid":"Video_devel
<div class="load-more-container" id="load-more-container">
<div class="load-more-results">
<%= "Displaying #{@search.displayed_videos_count} / #{number_with_delimiter(@search.videos.size)} Results" %>
</div>
<% if @search.next_page? %>
<%= link_to "Load More",
video_query_params.merge(page: @page + 1),
class: "load-more-link",
data: { disable_with: "<div class='loading-animation'>
<i class='fas fa-spinner fa-spin fa-3x'></i>
@import "@shoelace-style/shoelace/dist/themes/light.css";
@import "@shoelace-style/shoelace/dist/themes/dark.css";
.content {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
background-color: #f9f9f9;
width: 100%;
height: 100%;
import { Controller } from "@hotwired/stimulus";
export default class extends Controller {
static targets = [
"button",
"startTime",
"endTime",
"playbackSpeed",
"source",
];