running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
| You are an AI assistant specializing in Groovestack development, a full-stack framework built with PostgreSQL 17, Ruby on Rails 8, GraphQL (graphql-ruby 2.4), React-admin 5.5, MUI 6, and TypeScript 5.7. Your goal is to generate clean, maintainable, and efficient code that adheres to the best practices of each technology. | |
| ## General Guidelines: | |
| - Always use TypeScript with strict types. | |
| - Follow functional programming principles and immutability where possible. | |
| - Keep code concise and modular, using small, reusable components and services. | |
| - Prefer composition over inheritance. | |
| - Ensure accessibility (ARIA attributes, keyboard navigation). | |
| - Write self-documenting code with meaningful names. |
| # Utility for https://talysto.com/tech/groovestack applications | |
| # Will export your current DB to a single JSON file that can be consumed directly | |
| # by React-admin Fakerest adapter | |
| # lib/tasks/db_export.rake | |
| namespace :db do | |
| desc 'Export all tables to a single JSON file, database-agnostic' | |
| task export: :environment do | |
| require 'json' | |
| # Define an array of tables to exclude |
running:
bash create-vod-hls.sh beach.mkv
will produce:
beach/
|- playlist.m3u8
|- 360p.m3u8
| history | awk '{CMD[$2]++;count++;}END { for (a in CMD)print CMD[a] " " CMD[a]/count*100 "% " a;}' | grep -v "./" | column -c3 -s " " -t | sort -nr | nl | head -n20 |
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| func main() { | |
| // Bufferered channel. Remove the 50 to see how an unbuffered channel behaves differently |
| require 'mechanize' | |
| a = Mechanize.new | |
| body = a.post('http://localhost:9200/sbir_dom/Firm/_search?search_type=scan&scroll=1m', { | |
| "query": { | |
| "query_string": { "query": "name:z*" } | |
| }, | |
| "_source": false, "fields": ["_id"], "size": 10 | |
| }.to_json).body |
| # Only run in server process, not console or rake tasks | |
| if !Rails.const_defined?('Console') && !($0 =~ /rake$/) && !Rails.env.test? | |
| Rails.application.config.after_initialize do | |
| (1..2).each do |thread_id| | |
| Thread.new { | |
| Thread.current[:thread_name] = "DJ Web Worker Thread #{thread_id}" | |
| ActiveRecord::Base.connection_pool.with_connection do |conn| | |
| dj = Delayed::Worker.new | |
| Rails.logger.warn "Starting #{Thread.current[:thread_name]}" |
| apps = `heroku apps`.split("\n\n")[0].lines[1..-1].collect{|l| l.strip } | |
| printf("%-20s %4s %4s\n", 'APP', 'WEB', 'BG') | |
| apps.each{|a| | |
| astats = `heroku ps -a #{a}` | |
| info = `heroku apps:info -a #{a}` | |
| access = `heroku access -a #{a}` | |
| stack = info.scan(/Stack:\s+(.*)/).first.last rescue 'NA' | |
| web, workers = (astats.match(/web\.\d/).size rescue 0), (astats.match(/worker\.\d/).size rescue 0) | |
| printf("%-20s %4s %4s %20s\t#{access}\n", a, web, workers, stack) | |
| } |
| cd ~ | |
| sudo yum update | |
| sudo yum install java-1.7.0-openjdk.i686 unzip wget -y | |
| wget http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-0.20.5.zip -O elasticsearch.zip | |
| export ES_HOME=/opt/elasticsearch | |
| sudo unzip elasticsearch.zip -d $ES_HOME | |
| rm elasticsearch.zip |
| # Crosstab module for ruby. This class allows you to iterate through an | |
| # array of models (rows) and refactor the data to a crosstab format. | |
| # This takes one of the columns and makes it your row-key, another column | |
| # and makes it column-keys, then sums all cell values where these two | |
| # keys interesect. | |
| # | |
| # Currently only a single column can be used for row-keys and column-keys | |
| # but this may be expanded in the future with the addition of 'row grouping' | |