cheatly 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/README.md +2 -4
- data/lib/cheatly/cli.rb +3 -0
- data/lib/cheatly/sheet.rb +3 -3
- data/lib/cheatly/version.rb +1 -1
- data/sheets/bash.md +1 -0
- data/sheets/gpg.md +22 -11
- data/sheets/make.md +64 -0
- data/sheets/markdown.md +40 -23
- data/sheets/migrations.md +19 -19
- data/sheets/sprintf.md +18 -19
- metadata +24 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7656523fbcf168c13c63840517245c92485c4566
|
4
|
+
data.tar.gz: 2d682bed842fd69b228571b62872d94176ee8c4a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a132d1a64d03d3c855f040cde79fe4458733881a0772bf44e9bcca77fe4f9c0b15f1d4333d90839037f4e8817e8d1d0e702cf51f0593fd85571484bb0d59ae5a
|
7
|
+
data.tar.gz: f3dc1282b3c8a1c5b320b698d258cf4ddbfa7aa7ec5e49802d7b0ee2fae6c5d062b37461ec8c25a47a41729fa3e30281c2e85e74c059a7fe648021d8234cc726
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# Cheatly
|
2
2
|
|
3
|
-
[](https://travis-ci.org/arthurnn/cheatly)
|
4
|
+
[](https://codeclimate.com/github/arthurnn/cheatly)
|
5
5
|
|
6
6
|
This is a command line toolset to handle the cheat-sheets reposity located at [sheets](https://github.com/arthurnn/cheatly/tree/master/sheets) folder.
|
7
7
|
|
@@ -53,5 +53,3 @@ Building from source will allow you to test changes to your code locally before
|
|
53
53
|
Repeat steps 3-4 to check modified code.
|
54
54
|
|
55
55
|
|
56
|
-
[](https://bitdeli.com/free "Bitdeli Badge")
|
57
|
-
|
data/lib/cheatly/cli.rb
CHANGED
data/lib/cheatly/sheet.rb
CHANGED
@@ -31,11 +31,11 @@ module Cheatly
|
|
31
31
|
def self.find(name)
|
32
32
|
body = adapter.find(name)
|
33
33
|
self.new(name, body, persisted: true)
|
34
|
-
rescue Octokit::NotFound
|
35
|
-
puts "Octokit error."
|
34
|
+
rescue Octokit::NotFound
|
36
35
|
nil
|
37
|
-
rescue
|
36
|
+
rescue Exception => e
|
38
37
|
puts e.message
|
38
|
+
nil
|
39
39
|
end
|
40
40
|
|
41
41
|
def self.all
|
data/lib/cheatly/version.rb
CHANGED
data/sheets/bash.md
CHANGED
data/sheets/gpg.md
CHANGED
@@ -2,35 +2,46 @@
|
|
2
2
|
|
3
3
|
## Encrypt/Decrypt data
|
4
4
|
### To encrypt data:
|
5
|
-
|
5
|
+
|
6
|
+
gpg -e -u "Sender User Name" -r "Receiver User Name" somefile
|
6
7
|
|
7
8
|
### To decrypt data:
|
8
|
-
|
9
|
+
|
10
|
+
gpg -d mydata.tar.gpg
|
9
11
|
|
10
12
|
## Keys manipulation
|
11
13
|
### Create a key:
|
12
|
-
|
14
|
+
|
15
|
+
gpg --gen-key
|
13
16
|
|
14
17
|
### Export a key:
|
15
|
-
|
18
|
+
|
19
|
+
gpg --export -a "User Name" > public.key
|
16
20
|
|
17
21
|
### Export a private key:
|
18
|
-
|
22
|
+
|
23
|
+
gpg --export-secret-key -a "User Name" > private.key
|
19
24
|
|
20
25
|
### Import a friend's public key:
|
21
|
-
|
26
|
+
|
27
|
+
gpg --import public.key
|
22
28
|
|
23
29
|
### Import a private key:
|
24
|
-
|
30
|
+
|
31
|
+
gpg --allow-secret-key-import --import private.key
|
25
32
|
|
26
33
|
### Delete a public key:
|
27
|
-
|
34
|
+
|
35
|
+
gpg --delete-key "User Name"
|
28
36
|
|
29
37
|
### Delete a private key:
|
30
|
-
|
38
|
+
|
39
|
+
gpg --delete-secret-key "User Name"
|
31
40
|
|
32
41
|
### To list the keys in your public key ring:
|
33
|
-
|
42
|
+
|
43
|
+
gpg --list-keys
|
34
44
|
|
35
45
|
### To list the keys in your secret key ring:
|
36
|
-
|
46
|
+
|
47
|
+
gpg --list-secret-keys
|
data/sheets/make.md
ADDED
@@ -0,0 +1,64 @@
|
|
1
|
+
`$@`
|
2
|
+
The file name of the target of the rule. If the target is an archive member,
|
3
|
+
then `$@` is the name of the archive file. In a pattern rule that has multiple
|
4
|
+
targets (see Introduction to Pattern Rules), `$@` is the name of whichever
|
5
|
+
target caused the rule's recipe to be run.
|
6
|
+
|
7
|
+
|
8
|
+
`$%`
|
9
|
+
The target member name, when the target is an archive member. See Archives.
|
10
|
+
For example, if the target is `foo.a`(`bar.o`) then `$%` is `bar.o` and `$@`
|
11
|
+
is `foo.a`. `$%` is empty when the target is not an archive member.
|
12
|
+
|
13
|
+
|
14
|
+
`$<`
|
15
|
+
The name of the first prerequisite. If the target got its recipe from
|
16
|
+
an implicit rule, this will be the first prerequisite added by the implicit
|
17
|
+
rule.
|
18
|
+
|
19
|
+
|
20
|
+
`$?`
|
21
|
+
The names of all the prerequisites that are newer than the target, with spaces
|
22
|
+
between them. For prerequisites which are archive members, only the named
|
23
|
+
member is used.
|
24
|
+
|
25
|
+
|
26
|
+
`$^`
|
27
|
+
The names of all the prerequisites, with spaces between them.
|
28
|
+
For prerequisites which are archive members, only the named member is used.
|
29
|
+
A target has only one prerequisite on each other file it depends on, no matter
|
30
|
+
how many times each file is listed as a prerequisite. So if you list
|
31
|
+
a prerequisite more than once for a target, the value of `$^` contains just
|
32
|
+
one copy of the name. This list does not contain any of the order-only
|
33
|
+
prerequisites; for those see the `$|` variable, below.
|
34
|
+
|
35
|
+
|
36
|
+
`$+`
|
37
|
+
This is like `$^`, but prerequisites listed more than once are duplicated
|
38
|
+
in the order they were listed in the makefile. This is primarily useful
|
39
|
+
for use in linking commands where it is meaningful to repeat library file
|
40
|
+
names in a particular order.
|
41
|
+
|
42
|
+
|
43
|
+
`$|`
|
44
|
+
The names of all the order-only prerequisites, with spaces between them.
|
45
|
+
|
46
|
+
|
47
|
+
`$*`
|
48
|
+
The stem with which an implicit rule matches. If the target is `dir/a.foo.b`
|
49
|
+
and the target pattern is `a.%.b` then the stem is `dir/foo`. The stem
|
50
|
+
is useful for constructing names of related files.
|
51
|
+
|
52
|
+
In a static pattern rule, the stem is part of the file name that matched
|
53
|
+
the `%` in the target pattern.
|
54
|
+
|
55
|
+
In an explicit rule, there is no stem; so `$*` cannot be determined in that
|
56
|
+
way. Instead, if the target name ends with a recognized suffix, `$*` is set
|
57
|
+
to the target name minus the suffix. For example, if the target name is
|
58
|
+
`foo.c`, then `$*` is set to `foo`, since `.c` is a suffix. GNU make does this
|
59
|
+
bizarre thing only for compatibility with other implementations of make.
|
60
|
+
You should generally avoid using `$*` except in implicit rules or static
|
61
|
+
pattern rules.
|
62
|
+
|
63
|
+
If the target name in an explicit rule does not end with a recognized suffix,
|
64
|
+
`$*` is set to the empty string for that rule.
|
data/sheets/markdown.md
CHANGED
@@ -2,17 +2,17 @@
|
|
2
2
|
|
3
3
|
## Headings:
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
5
|
+
# h1 => <h1>h1</h1>
|
6
|
+
## h2 => <h2>h2</h2>
|
7
|
+
...
|
8
|
+
###### h6 => <h6>h6</h6>
|
9
9
|
|
10
10
|
## Paragraphs
|
11
11
|
|
12
|
-
|
12
|
+
Separate paragraphs with double newlines. => <p>Separate paragraphs with double newlines.</p>
|
13
13
|
|
14
|
-
|
15
|
-
|
14
|
+
This is a second paragraph. => <p>This is a second paragraph.
|
15
|
+
This is not a third paragraph. => This is not a third paragraph.</p>
|
16
16
|
|
17
17
|
## Blockquotes:
|
18
18
|
=> <blockquote>
|
@@ -21,30 +21,47 @@
|
|
21
21
|
|
22
22
|
## Code:
|
23
23
|
|
24
|
-
|
24
|
+
`code goes here` => <code>code goes here</code>
|
25
|
+
|
26
|
+
``` => <code>
|
27
|
+
<ul> => <ul>
|
28
|
+
<li>Some text</li> => <li>Some text</li>
|
29
|
+
</ul> => </ul>
|
30
|
+
``` => </code>
|
25
31
|
|
26
32
|
## Lists:
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
33
|
+
|
34
|
+
=> <ul>
|
35
|
+
* item 1 => <li>item 1</li>
|
36
|
+
* item 2 => <li>item 2</li>
|
37
|
+
* item 3 => <li>item 3</li>
|
38
|
+
=> </ul>
|
39
|
+
|
40
|
+
=> <ol>
|
41
|
+
1. item 1 => <li>item 1</li>
|
42
|
+
3. item 2 => <li>item 2</li>
|
43
|
+
1. item 3 => <li>item 3</li>
|
44
|
+
=> </ol>
|
45
|
+
|
46
|
+
## Tables:
|
47
|
+
|
48
|
+
=> <table>
|
49
|
+
Header | Header => <tr><th>Header</th><th>Header</th></tr>
|
50
|
+
---------- | ---------------
|
51
|
+
Some | Text => <tr><th>Some</th><th>Text</th></tr>
|
52
|
+
Another | Example => <tr><th>Another</th><th>Example</th></tr>
|
53
|
+
Next | Line => <tr><th>Next</th><th>Line</th></tr>
|
54
|
+
=> <table>
|
38
55
|
|
39
56
|
## Inline:
|
40
57
|
|
41
|
-
|
42
|
-
|
58
|
+
*emphasis* => <em>emphasis</em>
|
59
|
+
**strong** => <strong>strong</strong>
|
43
60
|
|
44
61
|
## Links:
|
45
62
|
|
46
|
-
|
63
|
+
[Text to display](http://example.com/) => <a href='http://example.com'>Text to display</a>
|
47
64
|
|
48
65
|
## Images:
|
49
66
|
|
50
|
-
|
67
|
+
 => <img src='/path/to/image.jpg alt='alt text' />
|
data/sheets/migrations.md
CHANGED
@@ -2,20 +2,20 @@
|
|
2
2
|
|
3
3
|
## Generating a new migration
|
4
4
|
|
5
|
-
|
5
|
+
rails generate migration AddPartNumberToProducts
|
6
6
|
|
7
7
|
## Methods:
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
9
|
+
create_table(name, options)
|
10
|
+
drop_table(name)
|
11
|
+
rename_table(old_name, new_name)
|
12
|
+
add_column(table_name, column_name, type, options)
|
13
|
+
rename_column(table_name, column_name, new_column_name)
|
14
|
+
change_column(table_name, column_name, type, options)
|
15
|
+
remove_column(table_name, column_name)
|
16
|
+
add_index(table_name, column_name, index_type)
|
17
|
+
remove_index(table_name, column_name)
|
18
|
+
change_table(table_name) { |table| ... }
|
19
19
|
|
20
20
|
## Available Column Types (mappings are below):
|
21
21
|
|
@@ -43,19 +43,19 @@
|
|
43
43
|
|
44
44
|
## Rake Tasks:
|
45
45
|
|
46
|
-
- rake db:schema:dump
|
47
|
-
- rake db:schema:import
|
46
|
+
- `rake db:schema:dump`: run after you create a model to capture the schema.rb
|
47
|
+
- `rake db:schema:import`: import the schema file into the current database
|
48
48
|
(on error, check if your schema.rb has `force: true` on the create table
|
49
49
|
statements)
|
50
|
-
- rails generate migration (migration name)
|
50
|
+
- `rails generate migration (migration name)`: generate a new migration with
|
51
51
|
a new 'highest' version (run 'rails generate migration' for this info at
|
52
52
|
your fingertips)
|
53
|
-
- rake db:migrate
|
54
|
-
- rake db:migrate VERSION=5
|
53
|
+
- `rake db:migrate`: migrate your current database to the most recent version
|
54
|
+
- `rake db:migrate VERSION=5`: migrate your current database to a specific
|
55
55
|
version (in this case, version 5)
|
56
|
-
- rake db:rollback
|
57
|
-
- rake db:rollback STEP=3
|
58
|
-
- rake db:migrate RAILS_ENV=production
|
56
|
+
- `rake db:rollback`: migrate down one migration
|
57
|
+
- `rake db:rollback STEP=3`: migrate down three migrations
|
58
|
+
- `rake db:migrate RAILS_ENV=production`: migrate your production database
|
59
59
|
|
60
60
|
## SQL:
|
61
61
|
|
data/sheets/sprintf.md
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
# `sprintf` formatters
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
3
|
+
%b => Binary integer
|
4
|
+
%c => Single character
|
5
|
+
%d => Decimal integer
|
6
|
+
%e => Decimal integer displayed in exponential form (3e+07)
|
7
|
+
%E => Decimal integer displayed in exponential form (3E+07)
|
8
|
+
%f => Floating point number
|
9
|
+
%g => Same as %e if exponent is less than -4, %f otherwise
|
10
|
+
%G => Same as %E if exponent is less than -4, %f otherwise
|
11
|
+
%o => Octal integer
|
12
|
+
%s => String
|
13
|
+
%u => Unsigned decimal integer
|
14
|
+
%x => Hexadecimal integer (2a)
|
15
|
+
%X => Hexadecimal integer uppercase (2A)
|
16
|
+
%02d => 0 padded two digits
|
17
|
+
%.02f => round to the hundredths
|
18
|
+
%+ => +/- sign
|
20
19
|
|
21
20
|
## Width & alignment
|
22
21
|
|
23
|
-
|
24
|
-
|
22
|
+
"%10s" % "hello" => " hello"
|
23
|
+
"%-10s" % "hello" => "hello "
|
metadata
CHANGED
@@ -1,125 +1,125 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cheatly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Neves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03
|
11
|
+
date: 2014-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: octokit
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 2.7.1
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.7.1
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: pager
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.0.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.0.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: redcarpet
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ~>
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: 3.0.0
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.0.0
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: colorize
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- -
|
59
|
+
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.6.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- -
|
66
|
+
- - ~>
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 0.6.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: thor
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
|
-
- -
|
73
|
+
- - ~>
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: 0.18.1
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
|
-
- -
|
80
|
+
- - ~>
|
81
81
|
- !ruby/object:Gem::Version
|
82
82
|
version: 0.18.1
|
83
83
|
- !ruby/object:Gem::Dependency
|
84
84
|
name: bundler
|
85
85
|
requirement: !ruby/object:Gem::Requirement
|
86
86
|
requirements:
|
87
|
-
- -
|
87
|
+
- - '>='
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '1.3'
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
|
-
- -
|
94
|
+
- - '>='
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '1.3'
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rake
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
100
100
|
requirements:
|
101
|
-
- -
|
101
|
+
- - '>='
|
102
102
|
- !ruby/object:Gem::Version
|
103
103
|
version: '0'
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
|
-
- -
|
108
|
+
- - '>='
|
109
109
|
- !ruby/object:Gem::Version
|
110
110
|
version: '0'
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: minitest
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
114
114
|
requirements:
|
115
|
-
- -
|
115
|
+
- - ~>
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: 5.0.8
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
|
-
- -
|
122
|
+
- - ~>
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: 5.0.8
|
125
125
|
description: A cheat-sheet cli for a cheat repository
|
@@ -130,8 +130,8 @@ executables:
|
|
130
130
|
extensions: []
|
131
131
|
extra_rdoc_files: []
|
132
132
|
files:
|
133
|
-
-
|
134
|
-
-
|
133
|
+
- .gitignore
|
134
|
+
- .travis.yml
|
135
135
|
- Gemfile
|
136
136
|
- LICENSE.txt
|
137
137
|
- README.md
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- sheets/gem_release.md
|
153
153
|
- sheets/gpg.md
|
154
154
|
- sheets/help.md
|
155
|
+
- sheets/make.md
|
155
156
|
- sheets/markdown.md
|
156
157
|
- sheets/migrations.md
|
157
158
|
- sheets/sprintf.md
|
@@ -169,17 +170,17 @@ require_paths:
|
|
169
170
|
- lib
|
170
171
|
required_ruby_version: !ruby/object:Gem::Requirement
|
171
172
|
requirements:
|
172
|
-
- -
|
173
|
+
- - '>='
|
173
174
|
- !ruby/object:Gem::Version
|
174
175
|
version: '0'
|
175
176
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
177
|
requirements:
|
177
|
-
- -
|
178
|
+
- - '>='
|
178
179
|
- !ruby/object:Gem::Version
|
179
180
|
version: '0'
|
180
181
|
requirements: []
|
181
182
|
rubyforge_project:
|
182
|
-
rubygems_version: 2.
|
183
|
+
rubygems_version: 2.0.14
|
183
184
|
signing_key:
|
184
185
|
specification_version: 4
|
185
186
|
summary: A cheat-sheet cli for a cheat repository
|