Skip to content

Instantly share code, notes, and snippets.

View gduquesnay's full-sized avatar

Gordon DuQuqesnay gduquesnay

  • codeby2
  • Korea
View GitHub Profile
@gduquesnay
gduquesnay / Pairing server setup
Created April 14, 2018 21:07
Pairing server setup
Prerequisite: You have ssh access to an ubuntu server which will be set up for pairing
* Install zsh and oh-my-zsh
* Create a pairing user
* Change the default editor to vim, sudo update-alternatives --config editor, choose vim.basic
* Allow the pair user to sudo without password, visudo, "pair ALL=(ALL) NOPASSWD: ALL"
* Generate ssh keys for the pair user
* Add public keys to authorize team to ssh as the pairing user
* Install git
* Install wemux
@gduquesnay
gduquesnay / replace_nils_with_column_defaults.rb
Created April 5, 2018 16:15
Workaround for Persisting an empty string in an integer field with a default value converts to nil #32467
# see: https://github.com/rails/rails/issues/32467
# written with help from: https://github.com/noise-machines
# sponsored by: https://www.hiresuccess.com/
require "active_support/concern"
module ReplaceNilsWithColumnDefaults
extend ActiveSupport::Concern
included do
testing
@gduquesnay
gduquesnay / authlogic_to_devise.rb
Created April 14, 2011 09:30 — forked from chebyte/authlogic_to_devise.rb
Migration for authlogic to devise
class MigrateUsers < ActiveRecord::Migration
def self.up
rename_column :users, :crypted_password, :encrypted_password
add_column :users, :confirmation_token, :string, :limit => 255
add_column :users, :confirmed_at, :timestamp
add_column :users, :confirmation_sent_at, :timestamp
execute "UPDATE users SET confirmed_at = created_at, confirmation_sent_at = created_at"
add_column :users, :reset_password_token, :string, :limit => 255