Skip to content

Commit 0d00fea

Browse files
committed
Updates
1 parent 61a25b5 commit 0d00fea

File tree

5 files changed

+173
-7
lines changed

5 files changed

+173
-7
lines changed

capybara/capybara.md

+90-7
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ Capybara has 2 main parts
3434
* imporant methods
3535
* `#visit`
3636
* `#current_path`
37-
* delegates many methods to `Capybara::Document`
37+
* delegates many methods to `Capybara::Document` so essentially you can
38+
think of a Session as having a superset of the Document|Element API
3839
* `page` in your test is an instance of `Capybara::Session`
3940
* `Capybara::Document`
4041
* represents the HTML document
4142
* `Capybara::Result`
42-
* A Result represents a collection of `Capybara::Element` on the page. It
43+
* A Result represents a collection of `Capybara::Node::Element` on the page. It
4344
is possible to interact with this collection similar to an `Array`
44-
because it implements Enumerable and offers the following Array methods
45-
through delegation
45+
because it implements Enumerable and offers Array methods through delegation
4646
* `Capybara::Node::Base`
4747
* `Capybara::Node::Element`
4848
* `Capybara::Query`
@@ -96,11 +96,11 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
9696
* => They inherit `find` wait behaviour
9797
3. Matchers
9898
* these methods fall into 2 categories:
99-
1. predicate methods
100-
* return true|false
101-
2. asserts
99+
1. asserts
102100
* return true if pass
103101
* return Capybara::ExpectationNotMet if fail
102+
2. predicate methods
103+
* return true|false
104104
* examples
105105
1. `#assert_no_selector`
106106
2. `#assert_no_text`
@@ -132,6 +132,7 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
132132
4. Node methods
133133
* These are stubbed out in capybara but must be implemented by whatever driver you use
134134
* It seems like drivers subclass Driver::Node
135+
* The "action" methods above use #find to get the Node::Element and then manipulate it with these
135136
* => they have a different implementation in different drivers
136137
* Examples:
137138
1. `==(other)`
@@ -157,6 +158,88 @@ Element and Document are both children of Node::Base. They share 3 kinds of meth
157158
21. `visible?`
158159
22. `visible_text`
159160

161+
162+
163+
## Drivers
164+
165+
Inheritance Heirarchy
166+
167+
```
168+
Object
169+
Capybara::Driver::Base
170+
RackTest::Driver
171+
Selenium::Driver
172+
Capybara::Driver::Node
173+
RackTest::Node
174+
Selenium::Node
175+
```
176+
177+
* Driver::Base methods:
178+
```
179+
accept_modal
180+
browser_initialized?
181+
close_window
182+
current_url
183+
current_window_handle
184+
dismiss_modal
185+
evaluate_script
186+
execute_script
187+
find_css
188+
find_xpath
189+
go_back
190+
go_forward
191+
html
192+
invalid_element_errors
193+
maximize_window
194+
needs_server?
195+
no_such_window_error
196+
open_new_window
197+
reset!
198+
resize_window_to
199+
response_headers
200+
save_screenshot
201+
status_code
202+
switch_to_window
203+
visit
204+
wait?
205+
window_handles
206+
window_size
207+
within_frame
208+
within_window
209+
```
210+
* Driver::Node methods
211+
```
212+
=
213+
[]
214+
all_text
215+
checked?
216+
click
217+
disabled?
218+
double_click
219+
drag_to
220+
hover
221+
initialize
222+
inspect
223+
path
224+
right_click
225+
select_option
226+
selected?
227+
set
228+
tag_name
229+
trigger
230+
unselect_option
231+
value
232+
visible?
233+
visible_text
234+
```
235+
236+
237+
238+
You can get at the current driver (which will have real implementations of these methods) via `page.driver`
239+
240+
241+
# Getting stuff from a Capybara::Node::Element
242+
160243
If you have an instance of Capybara::Node::Element, how do you find out stuff about it
161244
162245
```ruby

clojure/clojure.clj

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
; Clojure
2+
; ;;;;;;;
3+
4+
; clojure runs on the JVM and is nice for concurrent processes
5+
; my-program.clj
6+
7+
; Start the repl
8+
java -cp clojure-1.4.0.jar clojure.main
9+
10+
; Run some basic stuff
11+
(+ 1 2 3)
12+
(println "Hello world")
13+
14+
; show an alert box
15+
(javax.swing.JOptionPane/showMessageDialog nil "Hi")
16+
17+
; Exit the repl
18+
(System/exit 0)

ember/ember-cli.md

+14
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,17 @@ Conclusion: the main barrier to using it is that I don't know what they are doin
1414
# Ember-cli 101 book
1515

1616
Express.js has middlewares that can be used for tricks
17+
* tests are run by Testem
18+
* can run in "CI" or "development" mode
19+
* compiles down to AMD modules
20+
* files are named using "kebab case" so-they-look-like-this.thing
21+
* you can prefix apps with their type e.g. `/routes/index.js` or `routes/route-index.js` are acceptable
22+
23+
24+
# Watchman
25+
26+
* runs as a daemon
27+
* watches for changes in "roots" (directory heirarchies)
28+
* treats symlinks as ordinary files, does not follow them
29+
* you can "subscribe" to file changes which occur under a "root"
30+
* is smart enough to wait for a root to settle down if it changes quickly

networking/dns.md

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# DNS records
2+
3+
* http://en.wikipedia.org/wiki/List_of_DNS_record_types
4+
5+
* each "resource record" (database row) is stored in a "zone file" and has the following fields
6+
7+
1. hostname
8+
2. type
9+
3. value
10+
4. TTL
11+
12+
# @ symbol
13+
14+
* RFC 1035 defines @ as a shortcut for the "current origin"
15+
* it is a shortcut for the root of your domain e.g. `@` is a shortcut for `foo.com` if you are configuring DNS records for `foo.com`
16+
17+
# Common DNS records
18+
19+
* A
20+
* address record
21+
* maps the string in "hostname" to the IP address in "value" field
22+
* CNAME
23+
* canonical name record
24+
* aliase one hostname to another
25+
* if the "hostname" matches then retry the lookup with the string in "value" as a query
26+
* TXT
27+
* arbitrary text. originally just for human readable text but often machine
28+
readable now e.g. Sender Policy Framework, keybase verification
29+
* MX {number}
30+
* maps a domain to a list of "message transfer agents" (aka mail servers) for that domain
31+
* {number} is the priority of that MTA
32+
* SRV {number}
33+
* Service locator
34+
* used for newer protocols instead of creating protocol specific records like MX
35+
* works like a generalized MX record
36+
37+
# dig
38+
39+
```
40+
dig -t ANY interesting.com @some_name_server
41+
dig -t ANY interesting.com @8.8.8.8
42+
```

perl/perl-snippets.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Perl Snippets
2+
3+
Remove non-ascii from a file
4+
5+
perl -i.bk -pe 's/[^[:ascii:]]//g;' <filename>
6+
7+
Search & Replace across all PHP files in current dir
8+
9+
perl -pi -w -e 's/wrong/right/g;' *.php

0 commit comments

Comments
 (0)