Skip to content

Commit 86f68a2

Browse files
Merge pull request #17 from MichaelCurrin/add-jekyll
Convert to static site by adding Jekyll
2 parents 376521f + 17e5893 commit 86f68a2

File tree

265 files changed

+2161
-1298
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

265 files changed

+2161
-1298
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
_site/
2+
3+
.jekyll-metadata
4+
5+
.jekyll-cache/
6+
.sass-cache/
7+
8+
.bundle/
9+
vendor/

CONTRIBUTING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Contributing
2+
3+
If you want to add or update content, fork the project to your own repos, make a feature branch and add a Pull Request to the original repo.
4+
5+
If you'd like to just request an addition or fix, create an issue under [Issues](https://github.com/MichaelCurrin/dev-cheatsheets/issues).

Gemfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
source 'https://rubygems.org'
2+
3+
gem 'jekyll', '~> 3.8.5'
4+
gem 'minima', '~> 2.0'
5+
6+
group :jekyll_plugins do
7+
gem 'jekyll-feed', '~> 0.6'
8+
gem 'jekyll-sitemap', '~> 1.4.0'
9+
end

Gemfile.lock

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.7.0)
5+
public_suffix (>= 2.0.2, < 5.0)
6+
colorator (1.1.0)
7+
concurrent-ruby (1.1.6)
8+
em-websocket (0.5.1)
9+
eventmachine (>= 0.12.9)
10+
http_parser.rb (~> 0.6.0)
11+
eventmachine (1.2.7)
12+
ffi (1.13.1)
13+
forwardable-extended (2.6.0)
14+
http_parser.rb (0.6.0)
15+
i18n (0.9.5)
16+
concurrent-ruby (~> 1.0)
17+
jekyll (3.8.7)
18+
addressable (~> 2.4)
19+
colorator (~> 1.0)
20+
em-websocket (~> 0.5)
21+
i18n (~> 0.7)
22+
jekyll-sass-converter (~> 1.0)
23+
jekyll-watch (~> 2.0)
24+
kramdown (~> 1.14)
25+
liquid (~> 4.0)
26+
mercenary (~> 0.3.3)
27+
pathutil (~> 0.9)
28+
rouge (>= 1.7, < 4)
29+
safe_yaml (~> 1.0)
30+
jekyll-feed (0.14.0)
31+
jekyll (>= 3.7, < 5.0)
32+
jekyll-sass-converter (1.5.2)
33+
sass (~> 3.4)
34+
jekyll-seo-tag (2.6.1)
35+
jekyll (>= 3.3, < 5.0)
36+
jekyll-sitemap (1.4.0)
37+
jekyll (>= 3.7, < 5.0)
38+
jekyll-watch (2.2.1)
39+
listen (~> 3.0)
40+
kramdown (1.17.0)
41+
liquid (4.0.3)
42+
listen (3.2.1)
43+
rb-fsevent (~> 0.10, >= 0.10.3)
44+
rb-inotify (~> 0.9, >= 0.9.10)
45+
mercenary (0.3.6)
46+
minima (2.5.1)
47+
jekyll (>= 3.5, < 5.0)
48+
jekyll-feed (~> 0.9)
49+
jekyll-seo-tag (~> 2.1)
50+
pathutil (0.16.2)
51+
forwardable-extended (~> 2.6)
52+
public_suffix (4.0.5)
53+
rb-fsevent (0.10.4)
54+
rb-inotify (0.10.1)
55+
ffi (~> 1.0)
56+
rouge (3.20.0)
57+
safe_yaml (1.0.5)
58+
sass (3.7.4)
59+
sass-listen (~> 4.0.0)
60+
sass-listen (4.0.0)
61+
rb-fsevent (~> 0.9, >= 0.9.4)
62+
rb-inotify (~> 0.9, >= 0.9.7)
63+
64+
PLATFORMS
65+
ruby
66+
67+
DEPENDENCIES
68+
jekyll (~> 3.8.5)
69+
jekyll-feed (~> 0.6)
70+
jekyll-sitemap (~> 1.4.0)
71+
minima (~> 2.0)
72+
73+
BUNDLED WITH
74+
1.17.2

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
default: install
2+
3+
help:
4+
@egrep '^\S|^$$' Makefile
5+
6+
install:
7+
bundle config --local path vendor/bundle
8+
bundle install
9+
10+
upgrade:
11+
bundle update
12+
13+
s serve:
14+
bundle exec jekyll serve --trace --livereload
15+
16+
build-prod:
17+
JEKYLL_ENV=production bundle exec jekyll build

README.md

Lines changed: 11 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,24 @@
11
# Cheatsheets
2-
> Collection of minimal code snippets across languages for easy reference
2+
> A collection of code snippets and CLI notes for easy reference
33
44

5-
## Purpose
5+
[![GitHub tag](https://img.shields.io/github/tag/MichaelCurrin/dev-cheatsheets)](https://github.com/MichaelCurrin/dev-cheatsheets/tags/)
6+
[![License: MIT](https://img.shields.io/badge/License-MIT-blue)](#license)
67

7-
A reference for code snippets and shell commands across programming languages. It contains a way doing things based on previous or expected use-cases which highly relevant for me. It serves as a cache of sorts - I look in my cheatsheets for syntax or approach to a use-case first and then add Google, StackOverflow, documentation, etc. And when I find the answer I add it here so next time my search will be quicker and I'll find the same answer each time.
8+
[![View site GH Pages](https://img.shields.io/badge/View_site-GH_Pages-green?style=for-the-badge)](https://MichaelCurrin.github.io/dev-cheatsheets/)
89

9-
This guide is not aimed at teaching fundamentals of a language or explaining things to beginners - it assumes context. It aims to be lean and easy to navigate with a focus on code over explanations for compactness, but sometimes it still explains how or why to use a snippet.
1010

11-
There are plenty of tutorials and cheatsheets out there. This one is unique (for my at least) as it only contains topic and code that I have actually used before or plan to use, so it's a reference of what I know (or once knew). A cheatsheet made by someone is not personal to me and might have things I don't need or in a layout I don't like.
11+
## Documentation
1212

13-
I do link to other cheatsheets in some cases here, but when I have time I like to bring in a few items to my own guide, since external sites will not always be around as pages or domains.
13+
See the [docs](/docs/) directory.
1414

15-
<!-- NOTES
15+
Contributions are welcome - see [Contributing](/CONTRIBUTING.md) doc.
1616

17-
## Ramblings
1817

19-
I add code here if I find I use it more than once, from other cheatsheets, StackOverflow or my own creation. There may be links, but the idea is to be explicit here to avoid clicking through and also the risk of external content moving/disappearing.
18+
## License
2019

21-
The idea is to have boilerplate and templates which I already I understand and can use as a reference. This is not aimed at learning the language or concept for the first time.
20+
Released under [MIT](/LICENSE).
2221

23-
The code here might not actually run, especially templates.
22+
You must include a copy of this original license if you fork this repo or use a significant portion of it.
2423

25-
I am likely going to copy-paste the things in here often. Just to make typing it that much easier and to save a Stack Overflow search for an item I found before.
26-
27-
I might memorize the items, or just type them out enough times that I know them, but I keep as a cheatsheet for long term use.
28-
29-
There are also hacks which are not necessarily useful to someone learning the language but something I use.
30-
31-
There might also be links to cheatsheets I've found. I might take an existing cheatsheet and cut it down to the stuff I don't know so well yet but am likely to need.
32-
33-
The idea is to keep this project as a lean as possible. Wider details on learning or using a language are covered in my other projects.
34-
35-
There may be missing context or explanations and obvious things are excluded. As the cheatsheet is intended for myself mainly.
36-
-->
37-
38-
## Resources
39-
40-
Any links to tutorials and more detail will probably be added to my [Learn to Code](https://github.com/MichaelCurrin/learn-to-code) project instead.
41-
42-
For creating doc badges see [Badge Generator](https://michaelcurrin.github.io/badge-generator).
43-
44-
## Other cheatsheets
45-
46-
- https://devhints.io
47-
- http://cheatsheetfactory.geekyhacker.com/
48-
49-
<!--stackedit_data:
50-
eyJoaXN0b3J5IjpbMTY1NDgxMTkzNF19
51-
-->
24+
Github corner SVG from: http://tholman.com/github-corners/

TODO

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,39 @@
1+
Dev notes to self
2+
3+
Convert all links to Jekyll style
4+
5+
Add hover for flex - currently doesn't work nice on div and darkness is too big
6+
7+
Set background color of header
8+
and of flex boxes to cornflowerblue and white text
9+
Use SCSS instead maybe change background color var
10+
11+
Reuse flex sections aside from homepage
12+
13+
Keep CSS separate and with the HTML. Reuse items like edit or SVG in recipes.
14+
15+
Consider cheatsheets folder to be cs or sheets
16+
17+
Unsorted / uncategorized?
18+
19+
Homepage vs cheatsheets page? About page? Welcome home?
20+
Should homepage just be a splash / cover and CTA to get to cheatsheets?
21+
Preview? Latest updated? Not possible
22+
23+
Or get rid of layer and move folders to root. All the .md files will be moved to subfolder so that will be clean.
24+
25+
26+
Add search
27+
28+
29+
Replace _ with -
30+
31+
Add Edit this page
32+
33+
Add sidebar
34+
35+
===
36+
137
should some of these just be moved to cheatsheets folder in Learn to Code?
238
Are these aimed at me and that at others?
339

_config.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
### Site metadata ###
2+
3+
title: Dev Cheatsheets
4+
description: A collection of code snippets and CLI notes for easy reference
5+
6+
github_username: MichaelCurrin
7+
8+
### Build settings ###
9+
10+
url: "https://michaelcurrin.github.io"
11+
baseurl: "/dev-cheatsheets"
12+
13+
theme: minima
14+
15+
header_pages:
16+
- index.md
17+
- cheatsheets/index.md
18+
- about.md
19+
20+
plugins:
21+
- jekyll-feed
22+
- jekyll-sitemap
23+
24+
exclude:
25+
- docs/
26+
- vendor/
27+
- CONTRIBUTING.md
28+
- Gemfile
29+
- Gemfile.lock
30+
- LICENSE
31+
- Makefile
32+
- README.md
33+
34+
# Warning - there are memory issues when using a pattern to define listing
35+
# layout for `cheatsheets/**/index.md` or even `cheatsheets/*/index.md`,
36+
# therefore it is best to be explicit in each index file.
37+
defaults:
38+
- scope:
39+
path: ""
40+
values:
41+
layout: "page"

_includes/breadcrumbs.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<div id="breadcrumbs">
2+
{% assign crumbs = page.url | remove: '/index.html' | split: '/' %}
3+
4+
{% if crumbs.size > 2 %}
5+
{% for crumb in crumbs offset: 1 %}
6+
{% unless forloop.first %}
7+
/
8+
{% endunless %}
9+
{% if forloop.last %}
10+
{{ page.title }}
11+
{% else %}
12+
{% assign crumb_limit = forloop.index | plus: 1 %}
13+
<a href="{{ site.baseurl }}{% for crumb in crumbs limit: crumb_limit %}{{ crumb | append: '/' }}{% endfor %}">
14+
{{- crumb | replace: '-', ' ' | remove: '.html' | capitalize -}}
15+
</a>
16+
{% endif %}
17+
{% endfor %}
18+
{% endif %}
19+
</div>

_includes/edit-on-github.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<a id="edit-me" href="https://github.com/{{ site.github_username }}{{ site.baseurl }}/edit/master/{{ page.path }}">
2+
📝<span>Edit on GitHub</span>
3+
</a>
4+
<style>
5+
#edit-me {
6+
float:right;
7+
}
8+
9+
</style>

0 commit comments

Comments
 (0)