Skip to content

Instantly share code, notes, and snippets.

View avogel3's full-sized avatar

Andrew Vogel avogel3

View GitHub Profile
@dteoh
dteoh / command.md
Last active May 8, 2025 21:07
Interactively delete git branches locally

Delete multiple Git branches with a UI

This assumes you have installed [fzf][1].

$ git branch --no-color | fzf -m | xargs -I {} git branch -D '{}'

Press tab to mark a branch, shift-tab to unmark. Press enter and all marked branches will be deleted.

Phoenix 1.4.x to 1.5.0 upgrade instructions

Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v on the command line.

Install the new phx.new project generator

$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
@ProGM
ProGM / arel_cheatsheet_on_steroids.md
Last active May 13, 2025 08:37
Arel cheatsheet on Steroids

Arel Cheatsheet on Steroids

A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.

Tables

posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord

Table alias

@henrik
henrik / gemdiffs.rb
Last active April 20, 2020 06:42
Ruby script (gemdiffs.rb) to generate Coditsu gem diffing URLs from a Gemfile.lock diff, to help catch hijacked gems, or just to keep on top of changes. Also supports gems sourced straight from GitHub. There's also updategems.rb which updates gems and calls gemdiffs.rb to pre-fill the commit message.
#!/usr/bin/env ruby
# Usage example (in a Terminal):
#
# bundle update
# script/gemdiffs.rb
# Rubygems version diffs.
puts `git diff Gemfile.lock`.lines.
select { |line| line.match?(/^[+-] \w/) }.
@germsvel
germsvel / .projections.json
Last active May 6, 2025 11:59
Elixir/Phoenix basic projections
{
"lib/**/views/*_view.ex": {
"type": "view",
"alternate": "test/{dirname}/views/{basename}_view_test.exs",
"template": [
"defmodule {dirname|camelcase|capitalize}.{basename|camelcase|capitalize}View do",
" use {dirname|camelcase|capitalize}, :view",
"end"
]
},
@andersevenrud
andersevenrud / alacritty-tmux-vim_truecolor.md
Last active May 10, 2025 22:15
True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

True Color (24-bit) and italics with alacritty + tmux + vim (neovim)

This should make True Color (24-bit) and italics work in your tmux session and vim/neovim when using Alacritty (and should be compatible with any other terminal emulator, including Kitty).

Testing colors

Running this script should look the same in tmux as without.

curl -s https://gist.githubusercontent.com/lifepillar/09a44b8cf0f9397465614e622979107f/raw/24-bit-color.sh >24-bit-color.sh
@zoilomora
zoilomora / README.md
Last active April 20, 2025 20:46
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@lfantone
lfantone / yup.flow.js
Created May 24, 2018 22:42
Yup's Flow types
declare module 'yup' {
declare type ValidateOptions = {
strict?: boolean,
abortEarly?: boolean,
stripUnknown?: boolean,
recursive?: boolean,
context?: any
};
declare type ValidationError = {
@mrmartineau
mrmartineau / stimulus.md
Last active April 9, 2025 15:37
Stimulus cheatsheet
@przbadu
przbadu / Windows rails deployment.md
Last active June 6, 2023 20:11 — forked from userrails/Windows rails deployment.md
Deployment steps for rails in windows