Skip to content

Instantly share code, notes, and snippets.

View nithinbekal's full-sized avatar

Nithin Bekal nithinbekal

View GitHub Profile
@AndrewRadev
AndrewRadev / blame_colors_poc.vim
Last active April 3, 2024 09:35
Show colors in the sign column based on age of line
" Proof-of-concept, probably won't work for you, sorry
" Terminal colors, all grays, lighter to darker
let s:colors = range(232, 255)
augroup FugitiveColors
autocmd!
autocmd BufRead * call ShowBlameColors()
augroup END
@chrismccord
chrismccord / phx-1.4-upgrade.md
Last active June 16, 2023 06:22
Phoenix 1.3.x to 1.4.0 Upgrade Guides

Phoenix 1.4 ships with exciting new features, most notably with HTTP2 support, improved development experience with faster compile times, new error pages, and local SSL certificate generation. Additionally, our channel layer internals receiveced an overhaul, provided better structure and extensibility. We also shipped a new and improved Presence javascript API, as well as Elixir formatter integration for our routing and test DSLs.

This release requires few user-facing changes and should be a fast upgrade for those on Phoenix 1.3.x.

Install the new phx.new project generator

The mix phx.new archive can now be installed via hex, for a simpler, versioned installation experience.

To grab the new archive, simply run:

@arthurnn
arthurnn / example_test.rb
Last active October 29, 2018 04:57
Load ActiveRecord fixtures from a block instead of a yml file
require 'minitest/autorun'
require 'active_record'
ActiveRecord::Base.logger = Logger.new(STDOUT)
conn = { adapter: 'sqlite3', database: ':memory:' }
ActiveRecord::Base.establish_connection(conn)
class User < ActiveRecord::Base
connection.create_table :users, force: true do |t|
t.string :username