NOTE: This is outdated. Check the comments below for more up-to-date forks of this gist.
Improved YARD CHEATSHEET http://yardoc.org
forked from https://gist.github.com/chetan/1827484 which is from early 2012 and contains outdated information.
NOTE: This is outdated. Check the comments below for more up-to-date forks of this gist.
forked from https://gist.github.com/chetan/1827484 which is from early 2012 and contains outdated information.
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
Manage Emulators | |
android avd | |
Run Emulator | |
emulator -avd <AVD_Name> | |
Install apk onto emulator | |
adb -e install <path to apk> | |
FROM alpine:latest | |
RUN apk add --update php python py-pip mysql-client \ | |
&& pip install awscli \ | |
&& rm -rf /var/cache/apk/* | |
RUN touch crontab.tmp \ | |
&& echo '* */6 * * * /usr/bin/php /var/www/partkeepr/app/console partkeepr:cron:run' > crontab.tmp \ | |
&& echo '0 2 * * * /usr/bin/sql_backup' >> crontab.tmp \ | |
&& crontab crontab.tmp \ |
This list is based on aliases_spec.rb.
You can see also Module: RSpec::Matchers API.
matcher | aliased to | description |
---|---|---|
a_truthy_value | be_truthy | a truthy value |
a_falsey_value | be_falsey | a falsey value |
be_falsy | be_falsey | be falsy |
a_falsy_value | be_falsey | a falsy value |
On Tue, Mar 12, 2013 at 1:26 PM, Martin Fowler martinfowlercom@gmail.com wrote:
The term pops up in some different places, so it's hard to know what it means without some context. In PoEAA I use the pattern Service Layer to represent a domain-oriented layer of behaviors that provide an API for the domain layer. This may or may not sit on top of a Domain Model. In DDD Eric Evans uses the term Service Object to refer to objects that represent processes (as opposed to Entities and Values). DDD Service Objects are often useful to factor out behavior that would otherwise bloat Entities, it's also a useful step to patterns like Strategy and Command.
It sounds like the DDD sense is the sense I'm encountering most often. I really need to read that book.
The conceptual problem I run into in a lot of codebases is that rather than representing a process, the "service objects" represent "a thing that does the process". Which sounds like a nitpicky difference, but it seems to have a real impact on how people us
print "enter loan amount: " | |
loan = gets.chomp.to_i | |
print "Enter length of time in months: " | |
time = gets.chomp.to_i | |
print "Enter interest rate: " | |
rate = gets.chomp.to_f/100 | |
i = (1+rate/12)**(12/12)-1 | |
annuity = (1-(1/(1+i))**time)/i |
##git mergetool
In the middle file (future merged file), you can navigate between conflicts with ]c
and [c
.
Choose which version you want to keep with :diffget //2
or :diffget //3
(the //2
and //3
are unique identifiers for the target/master copy and the merge/branch copy file names).
:diffupdate (to remove leftover spacing issues)
:only (once you’re done reviewing all conflicts, this shows only the middle/merged file)