gist-compile 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/LICENSE +22 -0
- data/README.md +42 -0
- data/Rakefile +2 -0
- data/bin/gist-compile +23 -14
- data/gc_products/gists.html +107 -0
- data/gc_products/gists.json +112 -0
- data/gc_products/gists.md +86 -0
- data/gist-compile.gemspec +18 -0
- data/lib/json-serializer.rb +4 -4
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9c4bd9dbe5020d4965553e70a1ae39171088f5c0
|
4
|
+
data.tar.gz: e6cd0f355096c1ed7671f8c9d780c7a258c8efa5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1318a5500e9af65b993d955718713dcb2092fe4e33c5b02ca370dfd6f5ac2aea06e6439659507aa31745f6cdb0ee9e2e0b5e77a0b71bf72b8bd50fb13a028d33
|
7
|
+
data.tar.gz: 4a8a222b148131033cb292642c06482d515ec4f79b32e90d9242b39e133a3da96debda8487720d9f77d77c4cee2d818ccbc9fc2287b363663850f1200e4025d7
|
data/.gitignore
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Clay McLeod
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
22
|
+
|
data/README.md
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
# gist-compile
|
2
|
+
|
3
|
+
[![Join the chat at https://gitter.im/claymcleod/gist-compile](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/claymcleod/gist-compile?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Gem Version](https://badge.fury.io/rb/gist-compile.svg)](http://badge.fury.io/rb/gist-compile)
|
4
|
+
|
5
|
+
"gist-compile" is a tool I created to index your Github Gists (and the backend to a website I created, called [Gnippets](http://gnippets.com). Currently, the two supported outputs are Markdown and HTML. The usage is simple:
|
6
|
+
|
7
|
+
## Downloading using Rubygems
|
8
|
+
|
9
|
+
1. Install the gem using Rubygems ```gem install gist-compile```
|
10
|
+
2. Start gist-compile! ```gist-compile start -u "claymcleod"```
|
11
|
+
|
12
|
+
## Downloading manually
|
13
|
+
|
14
|
+
1. Clone the repo
|
15
|
+
2. Change the gist-compile directory ```cd <gist-compile folder location>```
|
16
|
+
3. Make the binary executable ```chmod +x bin/gist-compile```
|
17
|
+
4. Start gist-compile! ```bin/gist-compile start -u "claymcleod"```
|
18
|
+
|
19
|
+
|
20
|
+
## Formatting your gists
|
21
|
+
|
22
|
+
Before you run gist-compile, you should format each Gist you want compiled like so:
|
23
|
+
|
24
|
+
```
|
25
|
+
# Title: Simple Ruby Datamining Example
|
26
|
+
# Authors: Clay McLeod
|
27
|
+
# Description: La tee
|
28
|
+
# da
|
29
|
+
# Section: Learning Ruby
|
30
|
+
# Subsection: Simple Examples
|
31
|
+
|
32
|
+
...code...
|
33
|
+
```
|
34
|
+
|
35
|
+
A few rules:
|
36
|
+
|
37
|
+
1. This comment must be at the top of your gist file (shebangs are the only thing that may go above them)
|
38
|
+
2. You must format your comment using single line comment character (multi-line comments not supported!)
|
39
|
+
3. You must include a section and a subsection.
|
40
|
+
|
41
|
+
|
42
|
+
[View the results here](https://github.com/claymcleod/gist-compile/tree/master/prod).
|
data/Rakefile
ADDED
data/bin/gist-compile
CHANGED
@@ -7,21 +7,28 @@ require "thor"
|
|
7
7
|
require "paint"
|
8
8
|
require "rubygems"
|
9
9
|
require "nokogiri"
|
10
|
+
require "fileutils"
|
10
11
|
require "rest-client"
|
11
12
|
require "json-serializer"
|
12
13
|
|
13
|
-
|
14
|
-
GIST_USERCONTENT_BASE_URL = "https://gist.githubusercontent.com"
|
15
|
-
GIST_XPATH_IDENTIFIER = "//*[@id=\"js-flash-container\"]/div/div/div/div/div/span/a[3]"
|
14
|
+
class GistCompile < Thor
|
16
15
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
GIST_METADATA_HOOKS["Section"] = "Section:"
|
22
|
-
GIST_METADATA_HOOKS["Subsection"] = "Subsection:"
|
16
|
+
GIST_JSON_LOC = "./gc_products/gists.json"
|
17
|
+
GIST_MD_LOC ="./gc_products/gists.md"
|
18
|
+
GIST_HTML_LOC ="./gc_products/gists.html"
|
19
|
+
GIST_PROD_DIR = File.expand_path("../.", GIST_JSON_LOC)
|
23
20
|
|
24
|
-
|
21
|
+
GIST_BASE_URL = "https://gist.github.com"
|
22
|
+
GIST_USERCONTENT_BASE_URL = "https://gist.githubusercontent.com"
|
23
|
+
GIST_XPATH_IDENTIFIER = "//*[@id=\"js-flash-container\"]/div/div/div/div/div/span/a[3]"
|
24
|
+
|
25
|
+
GIST_METADATA_HOOKS = Hash.new
|
26
|
+
GIST_METADATA_HOOKS["Title"] = "Title:"
|
27
|
+
GIST_METADATA_HOOKS["Authors"] = "Authors:"
|
28
|
+
GIST_METADATA_HOOKS["Description"] = "Description:"
|
29
|
+
GIST_METADATA_HOOKS["Section"] = "Section:"
|
30
|
+
GIST_METADATA_HOOKS["Subsection"] = "Subsection:"
|
31
|
+
|
25
32
|
no_commands do
|
26
33
|
def load_gists(usernames)
|
27
34
|
thread_arr = []
|
@@ -79,7 +86,9 @@ class GistCompile < Thor
|
|
79
86
|
|
80
87
|
thread_arr.each{ |t| t.join() }
|
81
88
|
|
82
|
-
|
89
|
+
FileUtils::mkdir_p GIST_PROD_DIR
|
90
|
+
|
91
|
+
File.open(GIST_JSON_LOC,"w") do |f|
|
83
92
|
pretty_string = JSON.pretty_generate(metadata.sort_by {|item| item["Title"]})
|
84
93
|
f.write(pretty_string)
|
85
94
|
f.close()
|
@@ -169,9 +178,9 @@ class GistCompile < Thor
|
|
169
178
|
end
|
170
179
|
|
171
180
|
load_gists(usernames.split(","))
|
172
|
-
serializer = JSONSerializer.new(File.open(
|
173
|
-
serializer.to_md
|
174
|
-
serializer.to_html
|
181
|
+
serializer = JSONSerializer.new(File.open(GIST_JSON_LOC,"r").read, linkauthor)
|
182
|
+
serializer.to_md(GIST_MD_LOC)
|
183
|
+
serializer.to_html(GIST_HTML_LOC)
|
175
184
|
end
|
176
185
|
end
|
177
186
|
|
@@ -0,0 +1,107 @@
|
|
1
|
+
<!DOCTYPE HTML>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="UTF-8">
|
5
|
+
</head>
|
6
|
+
<body>
|
7
|
+
Generated by <a href="https://github.com/claymcleod/gist-compile">gist-compile</a> at 2015-02-22 19:29:52
|
8
|
+
<div class="section">
|
9
|
+
<a id="Objective-C"></a>
|
10
|
+
<h1>Objective-C</h1>
|
11
|
+
</div>
|
12
|
+
<h2>System Events</h2>
|
13
|
+
|
14
|
+
<h3><a href='https://gist.github.com/claymcleod/9d0a0a6eda00e8754546/'>Sending Keystrokes</a></h3>
|
15
|
+
<ul>
|
16
|
+
<li>Authors: Clay McLeod</li>
|
17
|
+
<li>Description: An example of how to send keystrokes to a window</li>
|
18
|
+
|
19
|
+
</ul>
|
20
|
+
<div class="section">
|
21
|
+
<a id="Python"></a>
|
22
|
+
<h1>Python</h1>
|
23
|
+
</div>
|
24
|
+
<h2>Data Science</h2>
|
25
|
+
|
26
|
+
<h3><a href='https://gist.github.com/claymcleod/1613590bbfc8203c0797/'>Reddit Data Mining Script</a></h3>
|
27
|
+
<ul>
|
28
|
+
<li>Authors: Clay McLeod</li>
|
29
|
+
<li>Description: This script mines JSON data from the Reddit front page and stores it as a CSV file for analysis.</li>
|
30
|
+
|
31
|
+
</ul>
|
32
|
+
<h2>General</h2>
|
33
|
+
|
34
|
+
<h3><a href='https://gist.github.com/claymcleod/a30752456fbb5efe8bcf/'>Regular Expressions with Python</a></h3>
|
35
|
+
<ul>
|
36
|
+
<li>Authors: Clay McLeod</li>
|
37
|
+
<li>Description: Shows you how to find all instances of a regular expression in a string</li>
|
38
|
+
|
39
|
+
</ul>
|
40
|
+
<h2>Interesting Problems</h2>
|
41
|
+
|
42
|
+
<h3><a href='https://gist.github.com/claymcleod/f9ce092cfed501408ee6/'>Edit Distance</a></h3>
|
43
|
+
<ul>
|
44
|
+
<li>Authors: Clay McLeod</li>
|
45
|
+
<li>Description: Python edit distance problem</li>
|
46
|
+
|
47
|
+
</ul>
|
48
|
+
<h3><a href='https://gist.github.com/claymcleod/26e2f380f4dda468fd56/'>Max subarray</a></h3>
|
49
|
+
<ul>
|
50
|
+
<li>Authors: Clay McLeod</li>
|
51
|
+
<li>Description: Finds the max subarray of an array of integers, in O(nlogn) time</li>
|
52
|
+
|
53
|
+
</ul>
|
54
|
+
<h3><a href='https://gist.github.com/claymcleod/8db5cd9070c83c27524d/'>Sort nuts and bolts</a></h3>
|
55
|
+
<ul>
|
56
|
+
<li>Authors: Clay McLeod</li>
|
57
|
+
<li>Description: Solving the classic sorting of nuts and bolts problem.</li>
|
58
|
+
|
59
|
+
</ul>
|
60
|
+
<div class="section">
|
61
|
+
<a id="Ruby"></a>
|
62
|
+
<h1>Ruby</h1>
|
63
|
+
</div>
|
64
|
+
<h2>Data Science</h2>
|
65
|
+
|
66
|
+
<h3><a href='https://gist.github.com/claymcleod/b3adc0a5ca47b716dd6b/'>Simple Ruby Datamining Example</a></h3>
|
67
|
+
<ul>
|
68
|
+
<li>Authors: Clay McLeod</li>
|
69
|
+
<li>Description: Mines data every minute concerning how many people are logged into a certain subreddit.</li>
|
70
|
+
|
71
|
+
</ul>
|
72
|
+
<div class="section">
|
73
|
+
<a id="Swift"></a>
|
74
|
+
<h1>Swift</h1>
|
75
|
+
</div>
|
76
|
+
<h2>General</h2>
|
77
|
+
|
78
|
+
<h3><a href='https://gist.github.com/claymcleod/39214f470d71363d6410/'>Regular Expressions with Swift</a></h3>
|
79
|
+
<ul>
|
80
|
+
<li>Authors: Clay McLeod</li>
|
81
|
+
<li>Description: A brief overview of regular expressions with Swift</li>
|
82
|
+
|
83
|
+
</ul>
|
84
|
+
<h2>UI</h2>
|
85
|
+
|
86
|
+
<h3><a href='https://gist.github.com/claymcleod/b46a1c84e39cddc868e7/'>Listening for Tap Gestures</a></h3>
|
87
|
+
<ul>
|
88
|
+
<li>Authors: Clay McLeod</li>
|
89
|
+
<li>Description: How to handle tap gestures on a view controller.</li>
|
90
|
+
|
91
|
+
</ul>
|
92
|
+
<h3><a href='https://gist.github.com/claymcleod/2507bc8f582d85a6dd93/'>UIDynamics</a></h3>
|
93
|
+
<ul>
|
94
|
+
<li>Authors: Clay McLeod</li>
|
95
|
+
<li>Description: A brief overview of UIDynamics in iOS 8</li>
|
96
|
+
|
97
|
+
</ul>
|
98
|
+
<h2>Variables</h2>
|
99
|
+
|
100
|
+
<h3><a href='https://gist.github.com/claymcleod/d66f08c06918cee065be/'>Lazy Initialization of Swift Variables</a></h3>
|
101
|
+
<ul>
|
102
|
+
<li>Authors: Clay McLeod</li>
|
103
|
+
<li>Description: An example of how to create a variable using lazy initialization in the Swift programming language.</li>
|
104
|
+
|
105
|
+
</ul>
|
106
|
+
</body>
|
107
|
+
</html>
|
@@ -0,0 +1,112 @@
|
|
1
|
+
[
|
2
|
+
{
|
3
|
+
"Title": " Edit Distance",
|
4
|
+
"Authors": " Clay McLeod",
|
5
|
+
"Description": " Python edit distance problem",
|
6
|
+
"Section": " Python",
|
7
|
+
"Subsection": " Interesting Problems",
|
8
|
+
"URL": "https://gist.github.com/claymcleod/f9ce092cfed501408ee6/",
|
9
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/f9ce092cfed501408ee6/raw",
|
10
|
+
"URL_USER": "github.com/claymcleod"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"Title": " Lazy Initialization of Swift Variables",
|
14
|
+
"Authors": " Clay McLeod",
|
15
|
+
"Description": " An example of how to create a variable using lazy initialization in the Swift programming language.",
|
16
|
+
"Section": " Swift",
|
17
|
+
"Subsection": " Variables",
|
18
|
+
"URL": "https://gist.github.com/claymcleod/d66f08c06918cee065be/",
|
19
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/d66f08c06918cee065be/raw",
|
20
|
+
"URL_USER": "github.com/claymcleod"
|
21
|
+
},
|
22
|
+
{
|
23
|
+
"Title": " Listening for Tap Gestures",
|
24
|
+
"Authors": " Clay McLeod",
|
25
|
+
"Description": " How to handle tap gestures on a view controller.",
|
26
|
+
"Section": " Swift",
|
27
|
+
"Subsection": " UI",
|
28
|
+
"URL": "https://gist.github.com/claymcleod/b46a1c84e39cddc868e7/",
|
29
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/b46a1c84e39cddc868e7/raw",
|
30
|
+
"URL_USER": "github.com/claymcleod"
|
31
|
+
},
|
32
|
+
{
|
33
|
+
"Title": " Max subarray",
|
34
|
+
"Authors": " Clay McLeod",
|
35
|
+
"Description": " Finds the max subarray of an array of integers, in O(nlogn) time",
|
36
|
+
"Section": " Python",
|
37
|
+
"Subsection": " Interesting Problems",
|
38
|
+
"URL": "https://gist.github.com/claymcleod/26e2f380f4dda468fd56/",
|
39
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/26e2f380f4dda468fd56/raw",
|
40
|
+
"URL_USER": "github.com/claymcleod"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"Title": " Reddit Data Mining Script",
|
44
|
+
"Authors": " Clay McLeod",
|
45
|
+
"Description": " This script mines JSON data from the Reddit front page and stores it as a CSV file for analysis.",
|
46
|
+
"Section": " Python",
|
47
|
+
"Subsection": " Data Science",
|
48
|
+
"URL": "https://gist.github.com/claymcleod/1613590bbfc8203c0797/",
|
49
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/1613590bbfc8203c0797/raw",
|
50
|
+
"URL_USER": "github.com/claymcleod"
|
51
|
+
},
|
52
|
+
{
|
53
|
+
"Title": " Regular Expressions with Python",
|
54
|
+
"Authors": " Clay McLeod",
|
55
|
+
"Description": " Shows you how to find all instances of a regular expression in a string",
|
56
|
+
"Section": " Python",
|
57
|
+
"Subsection": " General",
|
58
|
+
"URL": "https://gist.github.com/claymcleod/a30752456fbb5efe8bcf/",
|
59
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/a30752456fbb5efe8bcf/raw",
|
60
|
+
"URL_USER": "github.com/claymcleod"
|
61
|
+
},
|
62
|
+
{
|
63
|
+
"Title": " Regular Expressions with Swift",
|
64
|
+
"Authors": " Clay McLeod",
|
65
|
+
"Description": " A brief overview of regular expressions with Swift",
|
66
|
+
"Section": " Swift",
|
67
|
+
"Subsection": " General",
|
68
|
+
"URL": "https://gist.github.com/claymcleod/39214f470d71363d6410/",
|
69
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/39214f470d71363d6410/raw",
|
70
|
+
"URL_USER": "github.com/claymcleod"
|
71
|
+
},
|
72
|
+
{
|
73
|
+
"Title": " Sending Keystrokes",
|
74
|
+
"Authors": " Clay McLeod",
|
75
|
+
"Description": " An example of how to send keystrokes to a window",
|
76
|
+
"Section": " Objective-C",
|
77
|
+
"Subsection": " System Events",
|
78
|
+
"URL": "https://gist.github.com/claymcleod/9d0a0a6eda00e8754546/",
|
79
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/9d0a0a6eda00e8754546/raw",
|
80
|
+
"URL_USER": "github.com/claymcleod"
|
81
|
+
},
|
82
|
+
{
|
83
|
+
"Title": " Simple Ruby Datamining Example",
|
84
|
+
"Authors": " Clay McLeod",
|
85
|
+
"Description": " Mines data every minute concerning how many people are logged into a certain subreddit.",
|
86
|
+
"Section": " Ruby",
|
87
|
+
"Subsection": " Data Science",
|
88
|
+
"URL": "https://gist.github.com/claymcleod/b3adc0a5ca47b716dd6b/",
|
89
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/b3adc0a5ca47b716dd6b/raw",
|
90
|
+
"URL_USER": "github.com/claymcleod"
|
91
|
+
},
|
92
|
+
{
|
93
|
+
"Title": " Sort nuts and bolts",
|
94
|
+
"Authors": " Clay McLeod",
|
95
|
+
"Description": " Solving the classic sorting of nuts and bolts problem.",
|
96
|
+
"Section": " Python",
|
97
|
+
"Subsection": " Interesting Problems",
|
98
|
+
"URL": "https://gist.github.com/claymcleod/8db5cd9070c83c27524d/",
|
99
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/8db5cd9070c83c27524d/raw",
|
100
|
+
"URL_USER": "github.com/claymcleod"
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"Title": " UIDynamics",
|
104
|
+
"Authors": " Clay McLeod",
|
105
|
+
"Description": " A brief overview of UIDynamics in iOS 8",
|
106
|
+
"Section": " Swift",
|
107
|
+
"Subsection": " UI",
|
108
|
+
"URL": "https://gist.github.com/claymcleod/2507bc8f582d85a6dd93/",
|
109
|
+
"URL_RAW": "https://gist.githubusercontent.com/claymcleod/2507bc8f582d85a6dd93/raw",
|
110
|
+
"URL_USER": "github.com/claymcleod"
|
111
|
+
}
|
112
|
+
]
|
@@ -0,0 +1,86 @@
|
|
1
|
+
# Objective-C
|
2
|
+
### System Events
|
3
|
+
|
4
|
+
##### Sending Keystrokes
|
5
|
+
* Authors: Clay McLeod
|
6
|
+
* Description: An example of how to send keystrokes to a window
|
7
|
+
* URL: https://gist.github.com/claymcleod/9d0a0a6eda00e8754546/
|
8
|
+
* URL_USER: github.com/claymcleod
|
9
|
+
|
10
|
+
# Python
|
11
|
+
### Data Science
|
12
|
+
|
13
|
+
##### Reddit Data Mining Script
|
14
|
+
* Authors: Clay McLeod
|
15
|
+
* Description: This script mines JSON data from the Reddit front page and stores it as a CSV file for analysis.
|
16
|
+
* URL: https://gist.github.com/claymcleod/1613590bbfc8203c0797/
|
17
|
+
* URL_USER: github.com/claymcleod
|
18
|
+
|
19
|
+
### General
|
20
|
+
|
21
|
+
##### Regular Expressions with Python
|
22
|
+
* Authors: Clay McLeod
|
23
|
+
* Description: Shows you how to find all instances of a regular expression in a string
|
24
|
+
* URL: https://gist.github.com/claymcleod/a30752456fbb5efe8bcf/
|
25
|
+
* URL_USER: github.com/claymcleod
|
26
|
+
|
27
|
+
### Interesting Problems
|
28
|
+
|
29
|
+
##### Edit Distance
|
30
|
+
* Authors: Clay McLeod
|
31
|
+
* Description: Python edit distance problem
|
32
|
+
* URL: https://gist.github.com/claymcleod/f9ce092cfed501408ee6/
|
33
|
+
* URL_USER: github.com/claymcleod
|
34
|
+
|
35
|
+
##### Max subarray
|
36
|
+
* Authors: Clay McLeod
|
37
|
+
* Description: Finds the max subarray of an array of integers, in O(nlogn) time
|
38
|
+
* URL: https://gist.github.com/claymcleod/26e2f380f4dda468fd56/
|
39
|
+
* URL_USER: github.com/claymcleod
|
40
|
+
|
41
|
+
##### Sort nuts and bolts
|
42
|
+
* Authors: Clay McLeod
|
43
|
+
* Description: Solving the classic sorting of nuts and bolts problem.
|
44
|
+
* URL: https://gist.github.com/claymcleod/8db5cd9070c83c27524d/
|
45
|
+
* URL_USER: github.com/claymcleod
|
46
|
+
|
47
|
+
# Ruby
|
48
|
+
### Data Science
|
49
|
+
|
50
|
+
##### Simple Ruby Datamining Example
|
51
|
+
* Authors: Clay McLeod
|
52
|
+
* Description: Mines data every minute concerning how many people are logged into a certain subreddit.
|
53
|
+
* URL: https://gist.github.com/claymcleod/b3adc0a5ca47b716dd6b/
|
54
|
+
* URL_USER: github.com/claymcleod
|
55
|
+
|
56
|
+
# Swift
|
57
|
+
### General
|
58
|
+
|
59
|
+
##### Regular Expressions with Swift
|
60
|
+
* Authors: Clay McLeod
|
61
|
+
* Description: A brief overview of regular expressions with Swift
|
62
|
+
* URL: https://gist.github.com/claymcleod/39214f470d71363d6410/
|
63
|
+
* URL_USER: github.com/claymcleod
|
64
|
+
|
65
|
+
### UI
|
66
|
+
|
67
|
+
##### Listening for Tap Gestures
|
68
|
+
* Authors: Clay McLeod
|
69
|
+
* Description: How to handle tap gestures on a view controller.
|
70
|
+
* URL: https://gist.github.com/claymcleod/b46a1c84e39cddc868e7/
|
71
|
+
* URL_USER: github.com/claymcleod
|
72
|
+
|
73
|
+
##### UIDynamics
|
74
|
+
* Authors: Clay McLeod
|
75
|
+
* Description: A brief overview of UIDynamics in iOS 8
|
76
|
+
* URL: https://gist.github.com/claymcleod/2507bc8f582d85a6dd93/
|
77
|
+
* URL_USER: github.com/claymcleod
|
78
|
+
|
79
|
+
### Variables
|
80
|
+
|
81
|
+
##### Lazy Initialization of Swift Variables
|
82
|
+
* Authors: Clay McLeod
|
83
|
+
* Description: An example of how to create a variable using lazy initialization in the Swift programming language.
|
84
|
+
* URL: https://gist.github.com/claymcleod/d66f08c06918cee065be/
|
85
|
+
* URL_USER: github.com/claymcleod
|
86
|
+
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = 'gist-compile'
|
3
|
+
s.version = '1.0.0'
|
4
|
+
s.date = '2015-02-22'
|
5
|
+
s.summary = "Gist-compile will compile Github gists into an intelligible, book like, form."
|
6
|
+
s.description = ""
|
7
|
+
s.authors = ["Clay McLeod"]
|
8
|
+
s.email = 'clay.l.mcleod@gmail.com'
|
9
|
+
s.files = `git ls-files`.split($\)
|
10
|
+
s.executables = ['gist-compile']
|
11
|
+
s.require_paths = ["lib"]
|
12
|
+
s.homepage = 'http://github.com/claymcleod/gist-compile'
|
13
|
+
s.license = 'MIT'
|
14
|
+
s.add_runtime_dependency 'thor', '~> 0.19.1', '>= 0.19.1'
|
15
|
+
s.add_runtime_dependency 'paint', '~> 0.9.0', '>= 0.9'
|
16
|
+
s.add_runtime_dependency 'nokogiri', '~> 1.6.6', '>= 1.6.6'
|
17
|
+
s.add_runtime_dependency 'rest-client', '~> 1.7.2', '>= 1.7.2'
|
18
|
+
end
|
data/lib/json-serializer.rb
CHANGED
@@ -46,9 +46,9 @@ class JSONSerializer
|
|
46
46
|
return structured_gists
|
47
47
|
end
|
48
48
|
|
49
|
-
def to_md
|
49
|
+
def to_md(file)
|
50
50
|
structured_gists = compile()
|
51
|
-
File.open(
|
51
|
+
File.open(file,"w") do |f|
|
52
52
|
structured_gists.each do |j, v|
|
53
53
|
f.puts("# #{j}\r")
|
54
54
|
structured_gists[j].each do |k, v|
|
@@ -69,9 +69,9 @@ class JSONSerializer
|
|
69
69
|
end
|
70
70
|
end
|
71
71
|
|
72
|
-
def to_html
|
72
|
+
def to_html(file)
|
73
73
|
structured_gists = compile()
|
74
|
-
File.open(
|
74
|
+
File.open(file,"w") do |f|
|
75
75
|
f.puts("<!DOCTYPE HTML>")
|
76
76
|
f.puts("<html>")
|
77
77
|
f.puts(" <head>\n <meta charset=\"UTF-8\">\n </head>");
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gist-compile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clay McLeod
|
@@ -92,11 +92,20 @@ dependencies:
|
|
92
92
|
version: 1.7.2
|
93
93
|
description: ''
|
94
94
|
email: clay.l.mcleod@gmail.com
|
95
|
-
executables:
|
95
|
+
executables:
|
96
|
+
- gist-compile
|
96
97
|
extensions: []
|
97
98
|
extra_rdoc_files: []
|
98
99
|
files:
|
100
|
+
- ".gitignore"
|
101
|
+
- LICENSE
|
102
|
+
- README.md
|
103
|
+
- Rakefile
|
99
104
|
- bin/gist-compile
|
105
|
+
- gc_products/gists.html
|
106
|
+
- gc_products/gists.json
|
107
|
+
- gc_products/gists.md
|
108
|
+
- gist-compile.gemspec
|
100
109
|
- lib/json-serializer.rb
|
101
110
|
homepage: http://github.com/claymcleod/gist-compile
|
102
111
|
licenses:
|