Skip to content

Instantly share code, notes, and snippets.

@davidwebca
davidwebca / gist:e26186b8f4c6795b19c043fffb6f9861
Last active December 18, 2023 15:29
Detect black screen and split with ffmpeg remux
# Splits video to separate scenes files when full black frames are found in the video
# Inspired by https://gist.github.com/achesco/4dc2ebf13378a0a61fc26c7fe01f539e
# Who got inspired by https://stackoverflow.com/a/38205105
#!/bin/bash
file=""
out="./"
dur=0.05
stripaudio=""
@vitobotta
vitobotta / reflex.rb
Last active April 29, 2021 17:54
StimulusReflex working with route constraints
# frozen_string_literal: true
class StimulusReflex::Reflex
...
def request
@request ||= begin
uri = URI.parse(url)
path = ActionDispatch::Journey::Router::Utils.normalize_path(uri.path)
query_hash = Rack::Utils.parse_nested_query(uri.query)
@Cartmanishere
Cartmanishere / server.py
Created November 1, 2019 10:43
Python server implementation for grpc-python-golang example
from nltk_service_pb2 import *
from nltk_service_pb2_grpc import *
import grpc
import nltk
from concurrent import futures
from nltk.corpus import stopwords
class NltkService(KeywordServiceServicer):
@bazzel
bazzel / README.md
Last active March 20, 2022 22:00
Webpacker and I18n
$ rails new my-i8n --webpack

Gemfile

gem 'i18n-js'
"Quillian Bureaucracy"
={
key="Quillian Bureaucracy"
ship_prefix="ISS"
species={
class="HUM"
portrait="humanoid_04"
name="Quillian"
plural="Quillians"
adjective="Quillian"
@butuzov
butuzov / mp3 to m4b.md
Created August 10, 2018 06:07
Convert mp3's to m4b using `ffmpeg`

Let's imagine we have a lot of mp3 files ( forexample one of the pluralsite courses converted to mp3 ).

URL=https://www.pluralsight.com/courses/run-effective-meetings
PASS=pass
USER=user
OUTPUT="%(playlist_index)s. %(title)s-%(id)s.%(ext)s"
youtube-dl --username $USER --password $PASS -o $OUTPUT --extract-audio --audio-format mp3 $URL
@ryenski
ryenski / hello.vue
Last active April 27, 2023 03:04
Stimulus.js + Vue.js
<template>
<div id="app">
<p>{{ message }}</p>
</div>
</template>
<script>
export default {
data: function () {
return {
@markhorrocks
markhorrocks / test_google_sheets_apiV4.rb
Last active February 19, 2024 21:56
Editing Google Sheets with the Google::Apis::SheetsV4 Ruby Client
#! /usr/bin/ruby
require 'google/apis/sheets_v4'
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'fileutils'
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
APPLICATION_NAME = 'Google Sheets API Test'
@Aghassi
Aghassi / docker-compose.yml
Last active April 1, 2024 21:03
LinuxServer Docker Compose: Plex, Sonarr, Radarr, NZBGet, Let's Encrypt, Time Machine
version: '2'
services:
plex:
image: linuxserver/plex
container_name: plex
volumes:
- /path/to/plex/config:/config
- /path/to/plex/Movies:/data/movies
- /path/to/plex/Shows:/data/tvshows
- /path/to/plex/transcode:/data/transcode
@mrmartineau
mrmartineau / stimulus.md
Last active April 19, 2024 09:41
Stimulus cheatsheet