View loudness.rb
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 ruby | |
require 'open3' | |
require 'json' | |
ffmpeg_bin = '/usr/local/bin/ffmpeg' | |
target_il = -16.0 | |
target_lra = +11.0 | |
target_tp = -1.0 | |
samplerate = '41k' |
View disableChromeUpdates.sh
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
launchctl unload -w ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
launchctl unload -w ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
echo > ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
echo > ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
chmod 644 ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist | |
chmod 644 ~/Library/LaunchAgents/com.google.keystone.agent.plist | |
sudo chown root ~/Library/LaunchAgents/com.google.keystone.xpcservice.plist |
View index.mjs
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 { S3Client, PutObjectCommand, GetObjectCommand, DeleteObjectCommand } from "@aws-sdk/client-s3"; | |
const s3Client = new S3Client({ region: "us-east-1" }); | |
const Bucket = "BUCKET_NAME_GOES_HERE"; | |
export const handler = async (event) => { | |
let statusCode = 200; | |
let body = ``; | |
if (event.requestContext.http.method === "POST") { |
View gist:382d2fdd9ae41e75a81c9d2416745485
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
open -a "Google Chrome" --args --user-data-dir="/tmp/chrome_dev_test" --disable-web-security |
View oneLiners.js
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
console.log(JSON.stringify(data ?? null, null, 2)) | |
[...Array(10).keys()] | |
const sleep = ms => new Promise(res => setTimeout(res, ms)); | |
const sum = arr => arr.reduce((sum, n) => sum + n, 0) | |
const avg = arr => sum(arr) / arr.length |
View axiosDownloadImage.js
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 { writeFile } from "fs/promises"; | |
import axios from "axios"; | |
const main = async () => { | |
try { | |
const response = await axios.get(`${FILE_URL}`, { responseType: "arraybuffer" }); | |
try { | |
await writeFile(`./${FILE_NAME}.jpg`, response.data); | |
} catch(err) { | |
console.log(err); |
View formatDate.js
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
const formatDate = (date) => { | |
const year = date.getFullYear(); | |
const month = String(date.getMonth() + 1).padStart(2, "0"); | |
const day = String(date.getDate()).padStart(2, "0"); | |
const hours = String(date.getHours()).padStart(2, "0"); | |
const minutes = String(date.getMinutes()).padStart(2, "0"); | |
const seconds = String(date.getSeconds()).padStart(2, "0"); | |
return `${[year, month, day].join("/")} ${[hours, minutes, seconds].join(":")}`; | |
}; |
View last.sh
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
ffmpeg -sseof -3 -i input.mp4 -update 1 -q:v 1 last.jpg |
View first.sh
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
ffmpeg -i input.mp4 -ss 00:00:00 -frames:v 1 first.jpg |
View details.html
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
{{ if .Inner }}<details {{ if eq (.Get "open") "true" }}open{{ end }}> | |
{{ with .Get "title" }}<summary>{{.}}</summary>{{ end }} | |
{{ .Inner | markdownify }} | |
</details>{{ end }} |
NewerOlder