<?php // tests/HamcrestTestCase.php
namespace Tests;
use Hamcrest\MatcherAssert;
use Hamcrest\Util;
Snippet: [[SnippetName]] | |
Chunk: [[$ChunkName]] | |
System Setting: [[++SettingName]] | |
TV: [[*fieldName/TvName]] | |
Link tag: [[~PageId? ¶mName=`value`]] | |
Placeholder: [[+PlaceholderName]] | |
<?php |
# Uninstall any pre-existing packaged | |
# versions of phpunit | |
sudo apt-get remove phpunit | |
# Install pear via apt-get | |
sudo apt-get install php-pear | |
# Update existing pear channels | |
sudo pear channel-update pear.php.net |
# Add this to file in home folder | |
"~/bin/layout-switch.sh" | |
Alt + Shift_L |
The PATH
is an important concept when working on the command line. It's a list
of directories that tell your operating system where to look for programs, so
that you can just write script
instead of /home/me/bin/script
or
C:\Users\Me\bin\script
. But different operating systems have different ways to
add a new directory to it:
- The first step depends which version of Windows you're using:
- If you're using Windows 8 or 10, press the Windows key, then search for and
<template> | |
<div id="app"> | |
<p>{{ message }}</p> | |
</div> | |
</template> | |
<script> | |
export default { | |
data: function () { | |
return { |
"The trick is to catch exceptions at the proper layer, where your program can either meaningfully recover from the exception and continue without causing further errors, or provide the user with specific information, including instructions on how to recover from the error. When it is not practical for a method to do either of these, simply let the exception go so it can be caught later on and handled at the appropriate level."
Advantages of Exceptions
Excellent example of separating error-handling code from program logic
Three Rules for Effective Exception Handling
Longer explanation and case study of exception use, including the basic principles of "throw early" and "catch late". Clear and thorough.
class Well | |
attr_accessor :next_well, :seeds, :owner | |
def initialize anOwner | |
self.seeds = 0 | |
self.owner = anOwner | |
end | |
def sow | |
current_seeds = self.seeds |
SELECT p.id, name, LENGTH(body) AS len | |
FROM ( | |
SELECT id | |
FROM projects | |
ORDER BY id | |
LIMIT 150000, 10 | |
) o | |
JOIN projects p | |
ON p.id = o.id | |
ORDER BY p.id |
[alias] | |
co = checkout | |
cob = checkout -b | |
coo = !git fetch && git checkout | |
br = branch | |
brd = branch -d | |
brD = branch -D | |
merged = branch --merged | |
st = status | |
aa = add -A . |