Skip to content

Instantly share code, notes, and snippets.

View talk2MeGooseman's full-sized avatar
😏
Hello

Erik Guzman talk2MeGooseman

😏
Hello
View GitHub Profile
@andreaseriksson
andreaseriksson / convert_to_verified_routes.ex
Last active March 31, 2024 12:29
This is a mix task for converting old Phoenix routes to new verified routes
defmodule Mix.Tasks.ConvertToVerifiedRoutes do
@shortdoc "Fix routes"
use Mix.Task
@regex ~r/(Routes\.)(.*)_(path|url)\(.*?\)/
@web_module MyAppWeb
def run(_) do
Path.wildcard("lib/**/*.*ex")
@hcarver
hcarver / redis-migrate.rb
Created October 6, 2016 20:08
For migrating between Redis databases on Heroku, when the source database doesn't support the sync Redis command
# For migrating between Redis databases on Heroku, when the source database doesn't support sync
# This is useful for migrating away from Redis Cloud, for example.
require "redis"
# You need to have created a new database first, with
# heroku addons:create heroku-redis:hobby-dev -a $APP
# OR
# heroku addons:create heroku-redis:premium-0 -a $APP
@robmiller
robmiller / git-cleanup-repo
Last active February 27, 2024 10:09
A script for cleaning up Git repositories; it deletes branches that are fully merged into `origin/master`, prunes obsolete remote tracking branches, and as an added bonus will replicate these changes on the remote.
#!/bin/bash
# git-cleanup-repo
#
# Author: Rob Miller <[email protected]>
# Adapted from the original by Yorick Sijsling
git checkout master &> /dev/null
# Make sure we're working with the most up-to-date version of master.
git fetch