1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-06-15 14:47:53 +02:00
This commit is contained in:
Rico Sta. Cruz 2014-03-26 20:44:55 +08:00
parent 87bdcf9a41
commit 3022606545
5 changed files with 133 additions and 45 deletions

94
Gemfile.lock Normal file
View File

@ -0,0 +1,94 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.0.4)
i18n (~> 0.6, >= 0.6.9)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
atomic (1.1.16)
blankslate (2.1.2.4)
classifier (1.3.4)
fast-stemmer (>= 1.0.0)
colorator (0.1)
commander (4.1.6)
highline (~> 1.6.11)
fast-stemmer (1.0.2)
ffi (1.9.3)
gemoji (1.5.0)
github-pages (16)
RedCloth (= 4.2.9)
jekyll (= 1.4.3)
jekyll-mentions (= 0.0.5)
jekyll-redirect-from (= 0.3.1)
jemoji (= 0.0.10)
kramdown (= 1.3.1)
liquid (= 2.5.5)
maruku (= 0.7.0)
rdiscount (= 2.1.7)
redcarpet (= 2.3.0)
highline (1.6.21)
html-pipeline (1.5.0)
activesupport (>= 2)
nokogiri (~> 1.4)
i18n (0.6.9)
jekyll (1.4.3)
classifier (~> 1.3)
colorator (~> 0.1)
commander (~> 4.1.3)
liquid (~> 2.5.5)
listen (~> 1.3)
maruku (~> 0.7.0)
pygments.rb (~> 0.5.0)
redcarpet (~> 2.3.0)
safe_yaml (~> 0.9.7)
toml (~> 0.1.0)
jekyll-mentions (0.0.5)
html-pipeline (~> 1.5.0)
jekyll (~> 1.4.3)
jekyll-redirect-from (0.3.1)
jekyll (~> 1.4)
jemoji (0.0.10)
gemoji (~> 1.5.0)
html-pipeline (~> 1.5.0)
jekyll (~> 1.4.3)
kramdown (1.3.1)
liquid (2.5.5)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
rb-kqueue (>= 0.2)
maruku (0.7.0)
mini_portile (0.5.3)
minitest (4.7.5)
multi_json (1.9.2)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.8)
pygments.rb (0.5.4)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.1.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.3)
ffi (>= 0.5.0)
rb-kqueue (0.2.2)
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (2.3.0)
safe_yaml (0.9.7)
thread_safe (0.3.1)
atomic (>= 1.1.7, < 2)
toml (0.1.1)
parslet (~> 1.5.0)
tzinfo (0.3.39)
yajl-ruby (1.1.0)
PLATFORMS
ruby
DEPENDENCIES
github-pages

View File

@ -5,36 +5,35 @@ layout: default
### Install Ansible
~~~ sh
```sh
$ brew install ansible # OSX
$ [sudo] pip install ansible # elsewhere
~~~
```
### Start your project
~~~ sh
```sh
~$ mkdir setup
~$ cd setup
~~~
```
### Create an inventory file
This is a list of hosts you want to manage, grouped into groups. (Hint: try
using 127.0.0.1 to deploy to your local machine)
~~~ dosini
# ~/setup/hosts
```dosini
; ~/setup/hosts
[sites]
127.0.0.1
192.168.0.1
192.168.0.2
192.168.0.3
~~~
```
### Create your first Playbook
~~~ yaml
```yaml
# ~/setup/playbook.yml
- hosts: 127.0.0.1
@ -51,28 +50,26 @@ using 127.0.0.1 to deploy to your local machine)
- name: install bundler
gem: name=bundler state=latest
~~~
```
### Run it
~~~ sh
~/setup$ ls
hosts
playbook.yml
~/setup$ ls
hosts
playbook.yml
~/setup$ ansible-playbook -i hosts playbook.yml
PLAY [all] ********************************************************************
~/setup$ ansible-playbook -i hosts playbook.yml
PLAY [all] ********************************************************************
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
GATHERING FACTS ***************************************************************
ok: [127.0.0.1]
TASK: [install nginx] *********************************************************
ok: [127.0.0.1]
TASK: [install nginx] *********************************************************
ok: [127.0.0.1]
TASK: start nginx every bootup] ***********************************************
ok: [127.0.0.1]
...
~~~
TASK: start nginx every bootup] ***********************************************
ok: [127.0.0.1]
...
### Read more

View File

@ -42,26 +42,25 @@ layout: default
proc { ... }.must_raise exception
proc { ... }.must_throw sym
### Unit::TestCase
class TestHipster < MiniTest::Unit::TestCase
def setup
@subject = ["silly hats", "skinny jeans"]
end
class TestHipster < MiniTest::Unit::TestCase
def setup
@subject = ["silly hats", "skinny jeans"]
end
def teardown
@hipster.destroy!
end
def teardown
@hipster.destroy!
end
def test_for_helvetica_font
assert_equal "helvetica!", @hipster.preferred_font
end
def test_for_helvetica_font
assert_equal "helvetica!", @hipster.preferred_font
end
def test_not_mainstream
refute @hipster.mainstream?
def test_not_mainstream
refute @hipster.mainstream?
end
end
end
### Assertions

View File

@ -3,5 +3,5 @@ title: Resolutions
layout: default
---
* iPhone 4S: 640 x 960 [320 x 480]
* iPhone 5: 640 x 1136 [320 x 568]
* iPhone 4S: 640 x 960 (320 x 480)
* iPhone 5: 640 x 1136 (320 x 568)

View File

@ -5,17 +5,17 @@ layout: default
### Examples
:Tab /,
`:Tab /,`
hello , there
hi , you
:Tab /,/r0
`:Tab /,/r0`
hello,there
hi, you
:Tab /,/r1c1l0
`:Tab /,/r1c1l0`
# the separator counts as a column
# [r]ight align, [1] space, [c]enter align the comma, [1] space,
@ -29,8 +29,6 @@ layout: default
c,hi there
a,yo
### Specifiers
l|r|cN # left-right-center, with N spaces padding (l0)