Skip to content

Instantly share code, notes, and snippets.

@strawberryjello
strawberryjello / ci.org
Last active August 12, 2016 05:43
Testing and CI talk

Continuous integration (CI)

CI step-by-step for a single feature

  • checkout latest version of source code from mainline/master
    • verify first that the build is passing – if it’s failing, fix it first
  • develop feature
  • build source locally (in developer’s working copy)
    • compilation/producing a running version of the app
    • run tests
    • this step should be automated
  • when build passes, integrate changes into mainline (eg, push to master)
@strawberryjello
strawberryjello / postgresql-cleanup.sh
Created June 15, 2016 08:00
Cleaning up PostgreSQL PID file and restarting the server after it crashes because of OS X updates
#! /bin/sh
rm /usr/local/var/postgres/postmaster.pid
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
@strawberryjello
strawberryjello / .rubocop-zen.yml
Last active November 3, 2017 18:49
Sample annotated Rubocop YAML file (Rubocop 0.32.1)
# Last updated: 3 August 2015
#
# Applicable for Rubocop 0.32.1
#
# This document contains a custom Rubocop ruleset adhering to the Clinic-IT Ruby Style Guide (https://github.com/clinic-it/zen/blob/master/guidelines/ruby.md).
#
# All rules from the above are listed, with notes about whether they:
# - are enabled by default
# - require configuration
# - have not been implemented
@strawberryjello
strawberryjello / cops-rubocop-0-32-1.yml
Created July 31, 2015 11:14
Sample YAML file containing all Rubocop cops (Rubocop 0.32.1)
# Available cops (226):
# Type 'Lint' (41):
Lint/AmbiguousOperator:
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
Enabled: true
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method
@strawberryjello
strawberryjello / .rubocop-zen-old.yml
Last active August 29, 2015 14:20
Sample annotated Rubocop YAML file
# GENERAL
# Indent using soft indents (2 whitespace) instead of real tab.
# Enabled by default
# Style/IndentationWidth
# Limit lines to 80 characters except for HAML files.
# Enabled by default
# Metrics/LineLength
@strawberryjello
strawberryjello / cops.yml
Created April 29, 2015 05:42
Sample YAML file containing all Rubocop cops for a Rails project (generated using rubocop --show-cops, no custom cops specified)
# Available cops (218)
# Type 'Lint' (38):
Lint/AmbiguousOperator:
Description: Checks for ambiguous operators in the first argument of a method invocation
without parentheses.
StyleGuide: https://github.com/bbatsov/ruby-style-guide#parens-as-args
Enabled: true
Lint/AmbiguousRegexpLiteral:
Description: Checks for ambiguous regexp literals in the first argument of a method
@strawberryjello
strawberryjello / .rubocop.yml
Created April 14, 2015 04:27
Sample Rubocop YAML file
Metrics/MethodLength:
Enabled: false
Style/AlignParameters:
EnforcedStyle: with_fixed_indentation
Style/Documentation:
Enabled: false
Style/DotPosition:
@strawberryjello
strawberryjello / notes-on-emacs-vim.org
Last active August 29, 2015 14:18
Notes for Vim and Emacs beginners.

Notes on Vim and Emacs

Why Vim?

  • Vim is the descendant of vi, designed to be (mostly) backwards-compatible
    • learning vi is useful when you need to edit a file over ssh, since vi is usually installed in any UNIX/UNIX-based system by default
  • Vim’s shortcuts and design, once you learn them, help you search/create/edit/etc files quicker
    • these shortcuts are also used in UNIX-based terminals, such as the man page viewer
  • Vim offers flexible window management (splitting, etc) and works well with tmux, a popular terminal multiplexer
  • Vim’s plugin ecosystem is thriving and full of useful tools for development in most (if not all) languages
  • you can extend Vim yourself using Vimscript

Why Emacs?

@strawberryjello
strawberryjello / gist:f27fc782a2a440c63751
Created February 10, 2015 11:30
Echo list of files returned by git status --porcelain (minus status code)
#!/usr/bin/env bash
# meant to be run in the repo top directory
IN=`git status --porcelain | cut -c4-`
arr=$(echo $IN)
for x in $arr
do
echo $x
done
@strawberryjello
strawberryjello / notes-on-dev-lifecycle.org
Last active August 29, 2015 14:14
Notes on the Development Life Cycle

Notes on the Development Life Cycle

Prioritizing

  • avoid changing the list of items to work on mid-sprint
    • be firm with clients – prevent them from sneaking in new items/making changes to their requested features mid-sprint
    • item priorities may change mid-sprint, but keep in mind that changes like these are disruptive
  • points or man-days: YMMV
    • whichever you choose, be consistent (this is a team decision)
    • make sure everyone agrees on what each unit of effort stands for
    • estimates are not absolute