View examples.md
(def sheet1-data [["Name" "Alias" "Frequency" "Average"] ["blue" "B" 45 1] [] ["green" "G" 67 2] ["red" "R" 12 7]])

(def workbook (docjure/create-workbook "Unit Details" sheet1-data))

(def sheet1 (docjure/select-sheet "Unit Details" workbook))

(def yellow-cell-style (docjure/create-cell-style! workbook { :background :yellow }))

(def bold-cell-style (docjure/create-cell-style! workbook { :font { :bold true }))
View gist:f97ce3aae3ebebce810bc811e57bb159
```
{{ deploy_to }}/shared/log/*.log {
missingok
compress
delaycompress
weekly
rotate 128
copytruncate
create 660 {{ deploy_user }} {{ deploy_user }}
}
View unsaved.js
// this does not work for inputs which do not propergate their change event, e.g. when using a JS calendar. Use a HTML5 date input instead.
$(document).on('change', 'input, select, textarea', function(e) {
if ($(this).is('.ignore-unsaved-changes')) { return; }
$(this).addClass('changed-input');
});
// for ajax clicks we need to check for changed inputs
// it might be possible to do this universally via an ajax hook (something like beforeAjax)
$('.tab').click(function(event){
View EXAMPLE.md

We have log files which are gzipped with a incrementing number.

production.log.1.gz
production.log.2.gz
production.log.3.gz
...
production.log.99.gz
View registers.md

Usually you would yank some text and then paste it elsewhere, as such:

y$ (yank to end of line) p (paste text)

But what if, between these two commands you need to delete text, e.g. dd, which will mean p will paste the text just deleted, not that which was yanked initially.

Instead of plain yank, yank to a register:

View 00-README.md
View factory_bot_bug.rb
require 'active_record'
require 'factory_bot'
require 'pry'
ActiveRecord::Base.establish_connection(:adapter => 'sqlite3',
:database => File.dirname(__FILE__) + "/db.sqlite3")
ActiveRecord::Schema.define do
self.verbose = false
View example.md

Sharing Standard RSpec configuration between multiple projects.

In our example we have a gem called Oxygen which contains all non-framework code shared between all the codebases (repo's) which make up our system.

module Oxygen
  module RSpec
    def self.configure!
      ::RSpec.configure(&Configuration)
    end
View steps.md

Software:

Steps

  • dump and gzip postgres (source)
pg_dump -Ox -T sessions -U mos mos_staging > ~/mos_staging.sql
View sed.md

delete line starting with "SET"

sed -e '/^SET/ d;' mos_production_data_inserts.sql > mos_production_data_inserts_fixed.sql 

substitute "timestamp" with "datetime"

sed -e 's/timestamp/datetime/' mos_production_data_inserts.sql > mos_production_data_inserts_fixed.sql