Skip to content

Instantly share code, notes, and snippets.

@dimabory
dimabory / 01-overview.md
Last active September 5, 2022 08:33
coupling, cohesion, encapsulation

http://wiki.c2.com/?CouplingAndCohesion

Low Coupling

Coupling refers to the relationship of a module with another module. A module is said to be highly coupled with another module if changes to it will result to changes to the other module. And a module is said to be loosely coupled if a module is independent of any other modules. This can be achieved by having a stable interface that effectively hides the implementation of another module.

Benefits of low coupling are

  • maintainability – changes are confined in a single module
  • testability – modules involved in unit testing can be limited to a minimum
@sshaw
sshaw / yymmdd.rb
Last active August 29, 2015 14:05
Small DSL for idiomatic date parsing and formatting in Ruby. => Moved to https://github.com/sshaw/yymmdd
require "date"
# Small DSL for idiomatic date parsing and formatting in Ruby.
# https://gist.github.com/sshaw/53c27b148e903a07e494
#
# Usage:
#
# include YYMMDD
# date = Date.today
#
@paneq
paneq / bash.log
Last active December 12, 2015 09:48
Postgres super simple config for DEVELOPMENT mode. Never use it in production !!! It allows you to connect from localhost without using passwords. Very convenient.
# Make yourself superuser so that you can create and destroy databases without hassle. With power comes responsibility.
[username] $ sudo su postgres
[postgres] $ createuser -s username
@paulirish
paulirish / gist:3098860
Created July 12, 2012 15:26
Open Conference Expectations

Open Conference Expectations

This document lays out some baseline expectations between conference speakers and conference presenters. The general goal is to maximize the value the conference provides to its attendees and community and to let speakers know what they might reasonably expect from a conference.

We believe that all speakers should reasonably expect these things, not just speakers who are known to draw large crowds, because no one is a rockstar but more people should have the chance to be one. We believe that conferences are better -- and, dare we say, more diverse -- when the people speaking are not just the people who can afford to get themselves there, either because their company paid or they foot the bill themselves. Basically, this isn't a rock show rider, it's some ideas that should help get the voices of lesser known folks heard.

These expectations should serve as a starting point for discussion between speaker and organizer. They are not a list of demands; they are a list of rea

@brentkirby
brentkirby / service
Created June 22, 2011 08:50
Unicorn + Runit + RVM
#!/bin/bash -e
#
# Since unicorn creates a new pid on restart/reload, it needs a little extra love to
# manage with runit. Instead of managing unicorn directly, we simply trap signal calls
# to the service and redirect them to unicorn directly.
#
# To make this work properly with RVM, you should create a wrapper for the app's gemset unicorn.
#
function is_unicorn_alive {
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@aishfenton
aishfenton / serializer_benchmarks.rb
Created July 18, 2010 02:32 — forked from visfleet/performance_of_yaml_vs_marshal.rb
Performance comparison of different ruby serializer methods
# sudo gem install bson
# sudo gem install bson_ext
# sudo gem install yajl-ruby
# sudo gem install json
# sudo gem install msgpack
require 'rubygems'
require 'benchmark'
require 'yaml'
require 'bson'