These are possible steps to reset a csync2 cluster that has been seriously fubared. This is an apocalyptic approach and should only be used when more surgical fixes (like correcting an individual conflict) aren't workable.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cache: | |
| bundler: true | |
| directories: | |
| - reports | |
| before_script: | |
| - bundle clean --force # remove any cached brakeman from when it was in the Gemfile | |
| script: | |
| - script/brakeman |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This note explains how to build Postgres from source and setup to debug it using LLDB on a Mac. I used this technique to research this article: | |
| http://patshaughnessy.net/2014/10/13/following-a-select-statement-through-postgres-internals | |
| 1. Shut down existing postgres if necessary - you don’t want to mess up your existing DB or work :) | |
| $ ps aux | grep postgres | |
| pat 456 0.0 0.0 2503812 828 ?? Ss Sun10AM 0:11.59 postgres: stats collector process | |
| pat 455 0.0 0.0 2649692 2536 ?? Ss Sun10AM 0:05.00 postgres: autovacuum launcher process | |
| pat 454 0.0 0.0 2640476 304 ?? Ss Sun10AM 0:00.74 postgres: wal writer process | |
| pat 453 0.0 0.0 2640476 336 ?? Ss Sun10AM 0:00.76 postgres: writer process |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ##Create a migration | |
| ### rails g migration make_unicode_friendly | |
| class MakeUnicodeFriendly < ActiveRecord::Migration | |
| def change | |
| alter_database_and_tables_charsets "utf8", "utf8_general_ci" | |
| end | |
| private | |
| def alter_database_and_tables_charsets charset = default_charset, collation = default_collation |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set :user, 'username' | |
| set :gateway, 'example.com' | |
| set :ssh_options, { | |
| user: fetch(:user), | |
| forward_agent: false, | |
| proxy: Net::SSH::Proxy::Command.new( | |
| "ssh -l #{fetch(:user)} #{fetch(:gateway)} -W %h:%p" | |
| ) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Ruby Wishlist | |
| ## Removals | |
| * finalize! method for classes | |
| * Remove constant_finding/loading at runtime, it always breaks. | |
| ## Module.freeze | |
| Remove the ability to dynamically change code at runtime |
This is a collection of links, examples and rants about Presenters/Decorators in Rails.
The "Decorator" pattern slowly started gaining popularity in Rails several years ago. It is not part of core Rails, and there's many different interpretations about how it should work in practice.
Jay Fields wrote about it in 2007 (before he switched back to Java and then Clojure): http://blog.jayfields.com/2007/03/rails-presenter-pattern.html
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'active_record' | |
| ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') | |
| ActiveRecord::Schema.define do | |
| create_table :activities do |t| | |
| t.string :day | |
| t.string :name | |
| end | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Borrowed from https://github.com/y310/rspec-retry/blob/master/lib/rspec/retry.rb | |
| CAPYBARA_TIMEOUT_RETRIES = 3 | |
| RSpec.configure do |config| | |
| config.around(:each, type: :feature) do |ex| | |
| example = RSpec.current_example | |
| CAPYBARA_TIMEOUT_RETRIES.times do |i| | |
| example.instance_variable_set('@exception', nil) | |
| self.instance_variable_set('@__memoized', nil) # clear let variables |