Skip to content

Instantly share code, notes, and snippets.

View Shadowbeetle's full-sized avatar

Tamas Kadlecsik Shadowbeetle

View GitHub Profile
@Shadowbeetle
Shadowbeetle / update-po-files.yaml
Created January 25, 2024 13:50
Update po files in a Phoenix repo when commits are pushed to master
name: Update po files
on:
push:
branches:
- "master"
workflow_dispatch:
jobs:
update-po-files:
runs-on: ubuntu-latest

Anti-divisor

Solution

even_anti_divisor? = fn nmodk, k -> nmodk == k / 2 end
odd_anti_divisor? = fn nmodk, k -> nmodk == (k - 1) / 2 or nmodk == (k + 1) / 2 end
anti_divisor? = fn nmodk, k -> even_anti_divisor?.(nmodk, k) or odd_anti_divisor?.(nmodk, k) end

anti_divisors = fn n ->
@Shadowbeetle
Shadowbeetle / get_metadata.sh
Last active February 24, 2019 18:19
Get metadata from medi files where filenames contain spaces
#!/bin/bash
IFS=$(echo -en "\n\b")
for f in $(ls -v)
do
echo $f
ffprobe -v quiet -print_format json -show_format -show_streams "$f" | jq ".format.tags"
echo
done