Skip to content

Commit 171caaa

Browse files
committed
Update.
1 parent b252c4c commit 171caaa

12 files changed

+346
-13
lines changed

Diff for: capybara.md

+19
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,22 @@ Miscellaneous
9393
wait_until
9494
current_path
9595

96+
Capybara RSpec matchers
97+
-----------------------
98+
99+
expect(page).to have_button
100+
expect(page).to have_checked_field
101+
expect(page).to have_content '...'
102+
expect(page).to have_css '...'
103+
expect(page).to have_field
104+
expect(page).to have_link
105+
expect(page).to have_select
106+
expect(page).to have_selector 'h1', text: 'Welcome'
107+
expect(page).to have_table
108+
expect(page).to have_text
109+
expect(page).to have_unchecked_field
110+
expect(page).to have_xpath
111+
112+
expect(page).to have_selector 'h1', text: 'Welcome'
113+
114+
http://rubydoc.info/github/jnicklas/capybara/Capybara/RSpecMatchers

Diff for: chef.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
2+
### Install
3+
In your server:
4+
5+
$ sudo apt-get install curl
6+
7+
$ curl -L https://www.opscode.com/chef/install.sh | bash
8+
Thank you for installing Chef!
9+
10+
$ chef-solo -v
11+
...
12+
Chef: 11.4.0
13+
14+
### Start the cookbook
15+
16+
wget http://github.com/opscode/chef-repo/tarball/master -O - | tar xzf - --strip-components=1
17+
18+
### Knife
19+
20+
$ knife cookbook site download mysql
21+
22+
### Invoking chef-solo
23+
24+
$ chef-solo -c solo.rb -j web.json
25+
26+
### Simple compile-from-source
27+
28+
execute "tar --no-same-owner -zxf hi.tar.gz" do
29+
cwd "/usr/local/src"
30+
creates "/usr/local/src/node-v#{version}"
31+
end
32+
33+
bash "compile" do
34+
cwd "/usr/local/src/node-v#{version}"
35+
code %[
36+
PATH=/usr/local/bin:$PATH
37+
./configure
38+
make
39+
]
40+
creates "/usr/local/src/node-v#{version}/node"
41+
end
42+
43+
### remote file
44+
45+
remote_file "/usr/local/src/hi.tar.gz" do
46+
source "http://..."
47+
checksum "ab83be..."
48+
mode 0644
49+
action :create_if_missing
50+
end
51+
52+
### ruby_block
53+
54+
ruby_block "name" do
55+
block { File.read ... }
56+
not_if { File.exists?(...) }
57+
end
58+
59+
### Execute
60+
61+
execute "name" do
62+
cwd "..."
63+
environment({ "PATH" => "..." })
64+
command "make install"
65+
creates "..."
66+
end
67+
68+
### Conditions
69+
70+
creates "/usr/local/src/node-v#{version}/node"
71+
not_if { File.exists?('...') }
72+
73+
### References
74+
75+
* http://gettingstartedwithchef.com/
76+
* https://github.com/mdxp/nodejs-cookbook/blob/master/recipes/install_from_source.rb

Diff for: crypto.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
* [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) - password-based key derivation
2+
function
3+
4+
* [HMAC](http://en.wikipedia.org/wiki/HMAC) - Hash-based message authentication
5+
code

Diff for: docker.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Command line interface
2+
----------------------
3+
4+
Quick install on a server:
5+
6+
$ curl get.docker.io | sudo sh -x
7+
8+
To pull from docker's registry:
9+
10+
$ docker pull "ubuntu"
11+
12+
To build from your own `Dockerfile`:
13+
14+
$ docker build -t "app/container_name" .
15+
16+
To run:
17+
18+
$ docker run "app/container_name" [command and args]
19+
-i -t # Interactive mode + pseudo-TTY
20+
-e ENVVAR=value # Environment vars
21+
-p 4444 # Expose a port (??)
22+
-d # Detached mode
23+
24+
$ docker run -t "ubuntu" -i bash
25+
26+
OSX Install
27+
-----------
28+
29+
Prerequisites:
30+
31+
- Install Virtualbox (`brew install virtualbox`)
32+
- Install Vagrant (http://vagrantup.com)
33+
- Install go (`brew install go`)
34+
35+
Then make the Docker executable:
36+
37+
$ git clone https://github.com/dotcloud/docker.git ~/src/docker
38+
$ cd ~/src/docker
39+
$ make
40+
$ mv ./bin/docker /usr/local/bin/docker
41+
42+
Then run docker:
43+
44+
$ cd ~/src/docker
45+
$ vagrant up
46+
47+
48+
Managing
49+
--------
50+
51+
Manage images:
52+
53+
# List images
54+
$ docker images
55+
REPOSITORY TAG ID
56+
ubuntu 12.10 b750fe78269d
57+
me/myapp latest 7b2431a8d968
58+
59+
# Delete an image
60+
$ docker rmi b750fe78269d
61+
62+
Manage processes:
63+
64+
$ docker ps
65+
$ docker kill $ID
66+
$ docker rmi $ID
67+
68+
Manage containers:
69+
70+
Updating containers
71+
-------------------
72+
73+
$ docker commit "app/container_name" -m "Change stuff"
74+
75+
More
76+
----
77+
78+
Start a worker
79+
80+
# Start a very useful long-running process
81+
JOB=$(docker run -d ubuntu /bin/sh -c "while true; do echo Hello world; sleep 1;
82+
done")
83+
84+
# Collect the output of the job so far
85+
docker logs $JOB
86+
87+
# Kill the job
88+
docker kill $JOB
89+
90+
Resources
91+
---------
92+
93+
* http://www.docker.io/gettingstarted/

Diff for: minitest.md

+18-8
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,34 @@ title: Minitest
66
require 'minitest/autorun'
77

88
describe "X" do
9+
before do .. end
10+
after do .. end
11+
subject { .. }
12+
let(:list) { Array.new }
13+
914
it "should work" do
1015
assert true
1116
end
1217
end
1318

1419
### Specs
1520

16-
a.must_equal b
17-
3.must_be_close_to 2.99999
21+
.must_equal b
22+
.must_be_close_to 2.99999
23+
.must_be_same_as b
1824

19-
collection.must_include needle
20-
collection.must_be_empty
25+
.must_include needle
26+
.must_be_empty
2127

2228
.must_be_kind_of
23-
.must_match
24-
a.must_be :<=, 42
25-
obj.must_respond_to msg
26-
a.must_be_same_as b
29+
.must_be_instance_of
30+
.must_be_nil
31+
.must_match /regex/
32+
.must_be :<=, 42
33+
.must_respond_to msg
34+
35+
.must_be_silent ( proc { "no stdout or stderr" }.must_be_silent)
36+
.must_output "hi"
2737

2838
proc { ... }.must_output out_or_nil [, err]
2939
proc { ... }.must_raise exception

Diff for: npm-package.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ title: Package JSON
2929

3030
### Scripts
3131

32-
"scripts": {
33-
"start": "node ./bin/xxx", /* npm start */
34-
"test": "vows --spec --isolate", /* npm test */
35-
}
32+
"scripts": {
33+
"start": "node ./bin/xxx", /* npm start */
34+
"test": "vows --spec --isolate", /* npm test */
35+
}
3636

3737
### Git
3838

@@ -59,4 +59,4 @@ title: Package JSON
5959
"license": "MIT"
6060

6161

62-
http://package.json.nodejitsu.com/
62+
[Reference](http://package.json.nodejitsu.com/) (Nodejitsu.com)

Diff for: powerline.txt

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
Powerline:
2+
3+
4+
5+
6+
7+
8+
9+
10+
11+
┌─┐
12+
└─
13+
14+

Diff for: sinon-chai.md

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
### Assert
2+
3+
expect(spy).called
4+
expect(spy).calledOnce
5+
expect(spy).calledTwice
6+
expect(spy).calledThrice
7+
expect(spy).calledBefore
8+
expect(spy).calledAfter
9+
expect(spy).calledWithNew
10+
expect(spy).alwaysCalledWithNew
11+
expect(spy).calledOn
12+
expect(spy).alwaysCalledOn
13+
expect(spy).calledWith
14+
expect(spy).alwaysCalledWith
15+
expect(spy).calledWithExactly
16+
expect(spy).alwaysCalledWithExactly
17+
expect(spy).calledWithMatch
18+
expect(spy).alwaysCalledWithMatch
19+
expect(spy).returned
20+
expect(spy).alwaysReturned
21+
expect(spy).threw
22+
expect(spy).alwaysThrew
23+
24+
### Should
25+
26+
spy.should.have.been.called
27+
spy.should.have.been.calledOnce
28+
spy.should.have.been.calledTwice
29+
spy.should.have.been.calledThrice
30+
spy1.should.have.been.calledBefore(spy2)
31+
spy1.should.have.been.calledAfter(spy2)
32+
spy.should.have.been.calledWithNew
33+
spy.should.always.have.been.calledWithNew
34+
spy.should.have.been.calledOn(context)
35+
spy.should.always.have.been.calledOn(context)
36+
spy.should.have.been.calledWith(...args)
37+
spy.should.always.have.been.calledWith(...args)
38+
spy.should.always.have.been.calledWithExactly(...args)
39+
spy.should.always.have.been.calledWithExactly(...args)
40+
spy.should.have.been.calledWithMatch(...args)
41+
spy.should.always.have.been.calledWithMatch(...args)
42+
spy.should.have.returned(returnVal)
43+
spy.should.have.always.returned(returnVal)
44+
spy.should.have.thrown(errorObjOrErrorTypeStringOrNothing)
45+
spy.should.have.always.thrown(errorObjOrErrorTypeStringOrNothing)
46+
47+
https://github.com/domenic/sinon-chai

Diff for: tig.md

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ Tig shortcuts
88

99
### Invocation
1010

11+
tig
12+
13+
tig status
14+
1115
tig blame FILE
1216
tig master # Show a branch
1317
tig test..master # Show difference between two bracnhes

Diff for: vagrant.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
### Get started
2+
3+
Add some base boxes:
4+
5+
$ vagrant box add precise32 http://files.vagrantup.com/precise32.box
6+
$ vagrant box add precise64 http://files.vagrantup.com/precise64.box
7+
8+
Work it:
9+
10+
$ mkdir test_box
11+
$ cd test_box
12+
$ vagrant init precise64
13+
14+
Run it:
15+
16+
$ vagrant up
17+
$ vagrant ssh
18+
19+
To stop, use one of the following:
20+
21+
$ vagrant ssh # then: sudo shutdown -h now
22+
$ vagrant suspend
23+
$ vagrant destroy
24+
25+

Diff for: weechat.md

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
### Keys
2+
3+
(`A-` is alt)
4+
5+
### Buffers
6+
7+
^s ^u - Set unread marker on all windows
8+
9+
^p, A-left - Switch buffer left
10+
^n, A-right - Switch buffer right
11+
A-a - Next buffer with activity
12+
A-0...9 - Switch buffers
13+
14+
F9/F10 - Scroll buffer title
15+
F11/F12 - Scroll nick list
16+
17+
A-w A-Left - Switch windows
18+
A-w A-b - Balance windows
19+
20+
/window splith
21+
/window splitv
22+
/window zoom
23+
24+
### Search
25+
26+
^r - Search
27+
Enter, ^j, ^m - Stop search

0 commit comments

Comments
 (0)