Skip to content

Instantly share code, notes, and snippets.

View aaccioly's full-sized avatar

Anthony Accioly aaccioly

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aaccioly on github.
  • I am aaccioly (https://keybase.io/aaccioly) on keybase.
  • I have a public key ASD5jRhBTOGbqSmkNa1ZnQvj1Vybw6TZ18wP3Z3yOsGfHwo

To claim this, I am signing this object:

@aaccioly
aaccioly / main.js
Last active October 28, 2024 21:51
Script to delete outdate kind 10002 events (NIP-65 Relay List Metadata)
// Remove all outdated kind 10002 events
// SPDX-License-Identifier: Unlicense
// SPDX-FileCopyrightText: 2024 Anthony Accioly <[email protected]>
import WebSocket from 'ws'
import { SimplePool, useWebSocketImplementation } from 'nostr-tools/pool'
import { finalizeEvent, getPublicKey, sortEvents } from 'nostr-tools/pure'
import * as nip19 from 'nostr-tools/nip19'
const relays = [
@aaccioly
aaccioly / convert_mkv_to_mp4_with_ffpmeg.md
Created June 9, 2024 23:31
# FFmpeg: Convert MKV to MP4 keeping DoVi and subtitles

FFmpeg: Convert MKV to MP4 keeping DoVi and subtitles

The following FFmpeg command will convert a Dolby Vision (DoVi) enabled Matroska (MKV) file to MPEG-4 Part 14 (MP4) while preserving all subtitles:

ffmpeg -i file.mkv -map 0 -c:v copy -c:a copy -c:s mov_text -strict unofficial file.mp4
@aaccioly
aaccioly / gpg_commands_and_best_pratices.md
Last active May 27, 2024 20:56
GPG Commands - Best Practices

GPG Commands - Best Practices

1. Create a New Key

To generate an ed25519 key used for certification, use the following command:

gpg --quick-generate-key "Name (comment) <[email protected]>" ed25519 cert 10y
@aaccioly
aaccioly / deploy_certificates.sh
Last active February 13, 2025 01:43
Script to deploy certificates generated with DNSroboCert to nginx-proxy
#!/usr/bin/env bash
#########################################################################################
# deploy_certificates.sh
#
# Copyright (c) 2023 Anthony Accioly <[email protected]>
#
# SPDX-License-Identifier: MIT
#
# Description:
@aaccioly
aaccioly / game_base_generic_properties.worksheet.sc
Created March 18, 2023 21:07
Effective Programming in Scala - Week 1 challenge: Generic checkProperty function
enum Shape:
case Diamond, Squiggle, Oval
enum Color:
case Red, Green, Purple
enum Shading:
case Open, Striped, Solid
enum NumberType:
@aaccioly
aaccioly / CoroutinesPlayground.kt
Last active January 14, 2023 21:48
My version of Rock the JVM Kotlin Coroutines Tutorial: https://youtu.be/Wpco6IK1hmY and https://youtu.be/2RdHD0tceL4 (Gradle)
package com.rockthejvm.blog
import kotlinx.coroutines.*
import mu.KotlinLogging
import java.util.concurrent.Executors
// coroutine = "thread"
// parallel + concurrent apps
private val logger = KotlinLogging.logger {}
#!/bin/bash
# Extracts Artist;Album and Title from a CSV file exported by Mp3tag
if [ $# -ne 1 ]; then
echo usage: cleanMp3tagCSV file
exit 1
fi
ORIGINAL_FILE=$1
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
/**
* Created by Anthony on 11/10/2014.
*/
public class Teste {
@aaccioly
aaccioly / Results
Last active August 29, 2015 13:58
Time functions benchmark
--------------------------------------------
System.nanoTime()
--------------------------------------------
Avg Time: 0.99
Max Time: 1.90
Min Time: 0.51
--------------------------------------------
System.currentTimeMillis()
--------------------------------------------
Avg Time: 1.00