Skip to content

Instantly share code, notes, and snippets.

View mfilej's full-sized avatar

Miha Filej mfilej

View GitHub Profile
@mfilej
mfilej / google_replacements_2025-01-27.json
Last active January 16, 2025 12:10
Google Cloud Text-to-Speech voices will be updated starting Jan 27, 2025 across European markets
[
{
"original": "bg-BG-Standard-A",
"replacement": "bg-BG-Standard-B",
"date": "January 27, 2025"
},
{
"original": "ca-ES-Standard-A",
"replacement": "ca-ES-Standard-B",
"date": "January 27, 2025"
#!/usr/bin/env bash
set -euo pipefail
secret=$(aws secretsmanager list-secrets | jq -r '.SecretList | .[].ARN' | fzf)
if [ -z "$secret" ]; then
exit
fi
@mfilej
mfilej / better-git-branch.sh
Last active March 15, 2024 16:05 — forked from schacon/better-git-branch.sh
Better Git Branch output
#!/usr/bin/env bash
# From: https://gist.github.com/schacon/e9e743dee2e92db9a464619b99e94eff
#
# Changelog:
#
# - 2024-03-15: Also output current branch
# Colors
RED='\033[0;31m'
#!/usr/bin/env bash
set -e
usage() {
echo "Usage: gh dependabot <merge|rebase> <pull-request-number>"
echo
echo "Will tell dependabot to merge by commenting on the given pull request number."
}
action="$1"
@mfilej
mfilej / backup.yml
Created January 21, 2023 16:35
Back up a Fly.io Postgres database to S3 using GitHub Actions
name: Back up database
run-name: Task
on:
schedule:
- cron: '0 4 * * *'
workflow_dispatch:
jobs:
backup:
runs-on: ubuntu-latest
env:
tap 'homebrew/cask-fonts'
cask 'font-fira-code'
cask 'font-ibm-plex-mono'
cask 'font-source-code-pro'
cask 'font-monoid'
cask 'font-hack'
cask 'font-iosevka'
cask 'font-jetbrains-mono'
cask 'font-fantasque-sans-mono'

Keybase proof

I hereby claim:

  • I am mfilej on github.
  • I am mfilej (https://keybase.io/mfilej) on keybase.
  • I have a public key ASCboF-9E1U4DHRT6NPu2bHMtoJGwlCfzBCe32GI28bM3Ao

To claim this, I am signing this object:

namespace :resque do
desc "Clear resque queues"
task clear: :environment do
abort "Can not run outside of development env" unless Rails.env.development?
queues = Resque.queues
queues.each do |queue_name|
puts "Cleaning #{queue_name}..."
Resque.redis.del "queue:#{queue_name}"
end
@mfilej
mfilej / direnvrc.sh
Last active August 1, 2018 21:05
Switch ruby versions with direnv
source /usr/local/opt/chruby/share/chruby/chruby.sh
# Uncomment to use with rubies installed with ruby-build:
# RUBIES+=(~/.rbenv/versions/*)
# use ruby [version]
use_ruby() {
local ver=$1
if [[ -z $ver ]] && [[ -f .ruby-version ]]; then
ver=$(cat .ruby-version)
=> [ConferenceSession,
Mongoid::Timestamps::Short,
Mongoid::Timestamps::Updated,
Mongoid::Timestamps::Updated::Short,
Mongoid::Timestamps::Timeless,
Mongoid::Timestamps::Created,
Mongoid::Timestamps::Created::Short,
Mongoid::Document,
Mongoid::QueryCache::Document,
Kaminari::Mongoid::MongoidExtension::Document,