Skip to content

Instantly share code, notes, and snippets.

View rlopzc's full-sized avatar
:shipit:

rlopzc

:shipit:
View GitHub Profile
# Convert .HEIC to .jpeg (for iphone/mac users)
# TODO: also heic (downcase)
for file in *.HEIC; do
sips -s format jpeg "$file" --out "${file%.HEIC}.jpeg"
mv -v "$file.json" "${file%.HEIC}.jpeg.json"
rm $file
done
exiftool -d "%s" -tagsfromfile %d%f.%e.json "-DateTimeOriginal<PhotoTakenTimeTimestamp" "-FileCreateDate<PhotoTakenTimeTimestamp" "-FileModifyDate<PhotoTakenTimeTimestamp" -overwrite_original -ext jpg -ext jpeg -ext mp4 -ext mov -r .
{
"input": {
"blocklist": [],
"compressor#0": {
"attack": 5.0,
"boost-amount": 6.0,
"boost-threshold": -72.0,
"bypass": false,
"dry": -100.0,
"hpf-frequency": 10.0,
@rlopzc
rlopzc / simple_s3_upload.ex
Created November 8, 2023 15:59 — forked from plicjo/simple_s3_upload.ex
LiveView Uploads to S3
defmodule SimpleS3Upload do
@moduledoc """
Dependency-free S3 Form Upload using HTTP POST sigv4
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html
"""
@doc """
Signs a form upload.
The configuration is a map which must contain the following keys:
* `:region` - The AWS region, such as "us-east-1"
@rlopzc
rlopzc / release.ex
Created February 25, 2023 14:16
Log SQL commands in migration
defmodule MyApp.Release do
# Log SQL commands generated by migrations.
# More info here https://hexdocs.pm/ecto_sql/Ecto.Migrator.html#up/4-options
@migrator_default_opts [log_migrations_sql: :info]
...
def migrate(opts \\ [all: true]) do
load_app()
opts = @migrator_default_opts ++ opts
@rlopzc
rlopzc / recording_application_and_microphone.md
Created March 11, 2021 00:01 — forked from varqox/recording_application_and_microphone.md
How to record multiple applications and microphone into one audio file on Linux using PulseAudio

How to record multiple applications and microphone into one audio file on Linux

Step 0. Terminology

Sinks are for output, sources are for input. To stream source to sink a loopback must be created. More shall you find there.

Step 1. Create output sink that will be recorded

Our output sink will be named recording.

pacmd load-module module-null-sink sink_name=recording sink_properties=device.description=recording
@rlopzc
rlopzc / rename_phoenix_project.sh
Created February 26, 2021 22:22 — forked from wbednarski/rename_phoenix_project.sh
rename a phoenix 1.3 project
#!/bin/bash
set -e
CURRENT_NAME="Zauberantrag"
CURRENT_OTP="zauberantrag"
NEW_NAME="Wunderantrag"
NEW_OTP="wunderantrag"
@rlopzc
rlopzc / neomuttrc
Created June 22, 2019 19:37 — forked from VladimirPal/neomuttrc
Minimal neomutt config for gmail imap
set imap_user="mail.vpal@gmail.com"
set imap_pass=`/usr/bin/security find-generic-password -w -a 'mail.vpal@gmail.com' -s 'Gmail'`
set folder=imaps://imap.gmail.com/
set spoolfile=+INBOX
set record="+[Gmail]/Sent Mail"
set postponed="+[Gmail]/Drafts"
# https://www.neomutt.org/guide/reference search sleep_time for additional info
set sleep_time=0 # be faster

Keybase proof

I hereby claim:

  • I am romariolopezc on github.
  • I am rlopez (https://keybase.io/rlopez) on keybase.
  • I have a public key whose fingerprint is 63BF 46F1 0CE2 AB45 5CA8 002C CEB1 5B51 3101 0611

To claim this, I am signing this object: