- https://askubuntu.com/questions/348838/how-to-check-available-webcams-from-the-command-line
- https://www.linuxtv.org/wiki/index.php/Saa7134-alsa
- https://www.linuxtv.org/wiki/index.php/Philips_SAA7134
- https://www.linuxtv.org/wiki/index.php/Saa713x_devices
- https://www.linuxtv.org/wiki/index.php/Saa713x_devices:_Generic_SAA7134_Card_Installation
- https://trac.ffmpeg.org/wiki/Capture/ALSA
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from __future__ import annotations | |
from typing import Generator, TypedDict | |
from subprocess import run, CalledProcessError | |
import re | |
import logging | |
from datetime import date, datetime | |
import click | |
import yaml | |
logger = logging.getLogger(__name__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eu | |
DEVICE="$1" # e.g.: /dev/ttyUSB0 | |
BAUD_RATE="$2" # e.g.: 115200 | |
OUTPUT_FILE="$3" # e.g.: uart.txt | |
echo "Waiting for $DEVICE to become available ..." | |
while true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Delete old recordings. | |
DIR="$HOME/rec" | |
EXPIRE=7 | |
find $DIR -mtime +$EXPIRE -type f -delete |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def find_silences_of_minimum_length(data: np.array, min_length: int) -> Generator[Tuple[int, int], None, None]: | |
""" | |
Get a (start, stop) tuple for each detected silence of minimum length. | |
The start is inclusive, and the stop is exclusive, to match Python's list slicing. | |
>>> list(find_silences_of_minimum_length([1,0,1], 1)) | |
[(1, 2)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module; | |
use Drupal; | |
use Drupal\Core\Entity\Sql\SqlContentEntityStorage; | |
/** | |
* Utilities for updating field type definitions. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Drupal\my_module; | |
use Drupal; | |
use Drupal\Core\Config\FileStorage; | |
/** | |
* Utilities for managing module configuration during module updates. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import requests | |
import os | |
import getpass | |
parser = argparse.ArgumentParser(description='Add deployment key to bitbucket repository.') | |
parser.add_argument('-a', '--accountname', help='The team or individual account.', type=str, required=True) | |
parser.add_argument( | |
'-r', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Go to https://www.youtube.com/playlist?list=WL&disable_polymer=true | |
// Open the javascript console (CTRL+SHIFT+K in Firefox) | |
// Run the following code: | |
function loadMore() { | |
// Click the "Load More" button | |
var el = document.getElementsByClassName('browse-items-load-more-button'); | |
if (el.length) { | |
el[0].click(); | |
return true; |
NewerOlder