Skip to content

Instantly share code, notes, and snippets.

View mfilej's full-sized avatar

Miha Filej mfilej

View GitHub Profile
#!/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,
foone (@Foone): You want to know something about how bullshit insane our brains are?
OK, so there's a physical problem with our eyes: We move them in short fast bursts called "saccades", right? very quick, synchronized movements.
The only problem is: they go all blurry and useless during this
foone (@Foone): having your vision turn into a blurry mess every time you move your eyes is obviously not a good idea, so our brains hide it from us. Now, imagine you're an engineer and you have this problem.
foone (@Foone): You've got some obvious solutions you could do.
1. make the vision go black during movement. (Some VR games do this!)
2. just keep showing the last thing we saw prior to movement