Skip to content

Instantly share code, notes, and snippets.

Fix created timestamps after downloading from Amazon Photos

def adjust_metadata(folder_path)
  pattern = /(\d{4}-\d{2}-\d{2}_\d{2}-\d{2}-\d{2}_\d{3})\.\w+$/

  Dir.foreach(folder_path) do |file|
    next if file == '.' || file == '..'

 match = file.match(pattern)
file, err := os.Create("output.txt")
if err != nil {
log.Fatalf("Failed to create file: %s", err)
}
defer file.Close()
for key, value := range files {
line := fmt.Sprintf("%s: %s\n", key, value)
_, err := file.WriteString(line)
if err != nil {
@kirillshevch
kirillshevch / telegram_animated_sticker_ffmpeg.md
Last active March 31, 2024 10:16
How to convert video into Telegram Animated Sticker with FFmpeg (WEBM)

How to convert video into Telegram Animated Sticker with FFmpeg (WEBM)

ffmpeg -y -i input.mov -r 30 -t 2.99 -an -c:v libvpx-vp9 -pix_fmt yuva420p -vf 'scale=512:512:force_original_aspect_ratio=decrease' output.webm

Here is a breakdown of the options:

-y - Overwrite the output file if it already exists.

(() => {
// config:
const likea = true // like all (skip next two if true)
const tsize = 128 // minimal amount of letters in bio
const regex = /no fwb/i // dislike if found
const likes = 1000 // maximal likes per run
const speed = 1 // timeout to let it be preloaded
const timeo = 51 // timeout to let bio be loaded
const msgtm = 200 // timeout on match
// ^
# State interface
class TrafficLightState
def change_state(_traffic_light)
raise 'This method should be implemented in a subclass'
end
def display_color
raise 'This method should be implemented in a subclass'
end
end
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.28.0
// protoc v3.19.4
// source: review.proto
package storage
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
package main
import (
"context"
"fmt"
"protobuftest/storage"
"github.com/go-redis/redis/v8"
"google.golang.org/protobuf/proto"
)
package main
import (
"context"
"fmt"
"github.com/go-redis/redis/v8"
)
func main() {
class App
attr_reader :queue
def initialize
@queue = []
end
def call
puts "App PID: #{Process.pid}"
publish
class App
attr_reader :queue
def initialize
@queue = []
end
def call
puts "App PID: #{Process.pid}"
publish