1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-10-16 15:38:44 +02:00

Compare commits

...

685 Commits

Author SHA1 Message Date
francis
97db63d83d
Add Claude Code cheatsheet with comprehensive command reference (#2190)
## Summary
- Add new cheatsheet for Claude Code AI assistant CLI
- Include most commonly used commands first for better UX  
- Cover interactive mode, file operations, git integration, and advanced
features
- Add comprehensive sections for workflows, troubleshooting, and best
practices
- Follow repository formatting conventions with proper YAML frontmatter

## Features Covered
-  Interactive mode and core commands
-  File operations and git integration  
-  Advanced features (memory, image analysis)
-  Slash commands and productivity features
-  Common workflows (code review, testing, debugging)
-  IDE integrations and configuration
-  Troubleshooting and environment variables

## Test plan
- [X] Verify YAML frontmatter follows repository conventions
- [X] Check markdown formatting and table structure
- [X] Ensure most used commands are prioritized at the top
- [X] Validate all sections use proper Jekyll formatting classes
- [X] Confirm links and references are accurate

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Le Coq Francis <f.lecoq@jacquetmetals.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-08-24 08:31:43 +10:00
cubangeorge
01ee3a82c6
adding an alternate shorter way that does not depend on the basename (#2191) 2025-08-24 08:30:43 +10:00
Tyler Woodcook
1f681bd293
Remove duplicate :disabled (#2195)
`:disabled` is listed twice in this table.
2025-08-24 08:30:24 +10:00
Grzegorz Wierzowiecki
c2ffe99a30
Add Set Theory section to vim-digraphs cheatsheet (#2186)
## Summary
- Added a new Set Theory section to the vim-digraphs cheatsheet
- Includes commonly used mathematical symbols for set theory operations
- Follows the existing format and style of the cheatsheet

## Changes
- Added Set Theory section with symbols for:
  - ∀ (forall) - `FA`
  - ∃ (exists) - `TE`
  - ∈ (element of) - `(-`
  - ∅ (empty set) - `/0`
  - ⊆ (subset or equal) - `(_`
  - ⊇ (superset or equal) - `)_`
  - ∩ (intersection) - `(U`
  - ∪ (union) - `)U`
  - ⊂ (subset) - `(C`
  - ⊃ (superset) - `)C`
- Removed duplicate set theory symbols from Math section
- Added descriptive labels for each symbol

## Test plan
- [x] Verified all digraph codes work in Vim
- [x] Checked formatting consistency with existing sections
- [x] Ensured no duplicate symbols across sections

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Greg OmniMind (claude) <gwgithub23+claude@wierzowiecki.pl>
Co-authored-by: Claude <noreply@anthropic.com>
2025-07-04 23:06:23 +10:00
Kjetil Torgrim Homme
b00d106985
bash: adjust example to read from file into array (#2187)
* use `$()` rather than deprecated ``
* illustrate shortcut for builtin read of file without `cat`
* don't imply this reads lines, it will split into words by default

perhaps the cheatsheet should have a section on IFS, but that's
off-topic for this patch.

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2025-07-01 08:25:49 +10:00
ales
1ba47a8e7e
Add additional keywords to jsdocs.md (#2171)
Add common keywords to js docs cheatsheets
2025-06-29 10:51:57 +10:00
Pierre Smeyers
93d0654801
Bash: add Herestring & Process substitution chapters (#2184)
This PR adds:

- link to the Heredoc refdoc (always handy for not straightforward
concepts)
- chapter about Herestring
- chapter about Process Substitution (I know it is already tackled in
the _Redirection_ chapter but I believe it deserves its own one...

Congrats for this cheatsheet, by far my most beloved one ever !!

---------

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2025-06-29 10:51:05 +10:00
Rico Sta. Cruz
17bd2c9b82
Fix playwright (#2188) 2025-06-29 10:08:39 +10:00
Manjunath Prabhakar
0df6062c3a
Updated the $X() usage as it supports chromium (#2183)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2025-05-11 01:12:59 +10:00
Denis Telnov
6253384e7d
Embedded Images in Markdown (#2174)
[GFM](https://loilo.github.io/gfm-preview/) now supports the ability to
embed Base64 encoded images in Markdown.
2025-01-20 14:34:19 +11:00
Mohamed Ziata
83e30b2c0e
📝 Add packs.md (#2152)
Adding a page per `packs` documentation on
https://github.com/rubyatscale/packs

`packs` is a system to modualize ruby projects.

---------

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2024-09-24 23:25:54 +10:00
Aarsh
db4b9363e0
fix: annoying browser suggestions (#2160)
I was looking for notes and then when i was searching svelte i couldn't
see the possible search hits.so i turned autocomplete off now it works
like charm.
2024-09-24 23:24:33 +10:00
Morten Siebuhr
25eaa9a78c
Update tar.md to show file-listing (#2162) 2024-09-24 23:23:51 +10:00
Nick Korostelev
1fa8ae160f
Python: add Set and modify Dict (#2163) 2024-09-24 23:23:27 +10:00
Cyprien
746bae2ebe
Update jsdoc.md to use the @import keyword (#2159)
Added the newer import syntax that works on TS 5.5
2024-07-29 21:40:12 +10:00
David Lakin
27970b1495
Add missing syntax highlighting to python.md (#2154)
Fixes missing code highlighting in half of the Python code snippets.

The top half of the page had code examples formatted as code blocks with
4 space character indentations and no syntax highlighting as a result.

The bottom half on the other hand, used code blocks surrounded by
"```py" formatting brackets which hints to many markdown renders that
syntax highlighting should be applied.

This unifies the code blocks in the top half of the page to use the same
formatting syntax used in the bottom half with syntax highlighting.

This change was prompted by requests to add the syntax highlighting in
comments on the https://devhints.io/python page.
2024-07-16 22:32:46 +10:00
Rico Sta. Cruz
edfb8bba78
Update cache GitHub action (#2147)
The `actions/cache`acrion uses the deprecated Node 16 runtime. Upgrading
actions/cache should fix this.
2024-06-27 21:00:10 +10:00
Çınar Civan
403cc72ee3
New shortcut for vim.md (#2143)
New shortcut `:q!` added for quit without checking changes in `vim.md`
file.
2024-06-27 20:38:14 +10:00
Chris​‌​‮ ‬Hayes‌​​​
5c9fd725cf
Include warning on polyfill.io sheet; use CF instead (#2146)
A warning is added to the polyfill.io sheet in relation to the malicious
script that is now being served by polyfill.io. Removed all links to
that domain.

The code snippets have also been updated to use Cloudflare's script
instead. This allows users to keep using polyfill securely while they
move their codebase away from using this polyfill.

Cloudflare press release:
https://blog.cloudflare.com/polyfill-io-now-available-on-cdnjs-reduce-your-supply-chain-risk

Fixes #2145

---------

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2024-06-27 20:35:59 +10:00
Rico Sta. Cruz
fffa95b86b
Bump updated for tmux 2024-04-08 18:36:29 +10:00
Mathis Chenuet
1325a4c6e6
Add search to tmux, explain mouse support for scrolling (#2036) 2024-04-08 18:34:11 +10:00
Rico Sta. Cruz
7f81a61d0d
Remove vestegial files (#2135)
Files that should have been removed in the recent refactors, but
weren't.
2024-04-08 18:33:43 +10:00
Rico Sta. Cruz
42dd9eff84
Readability updates (#2134)
This PR updates the headings to avoid thin font weights and low
constrast ratios.

<table>
<tr>
<th>Before</th>
<th>After</th>
</tr>
<tr>
<td>


![image](https://github.com/rstacruz/cheatsheets/assets/74385/b7313b99-0376-49c1-84cd-e3476b2c84ff)

</td>
<td>


![image](https://github.com/rstacruz/cheatsheets/assets/74385/c2aec010-9976-4543-910b-dd9112995846)

</td>
</tr>
<tr>
<td>


![image](https://github.com/rstacruz/cheatsheets/assets/74385/e214d4a5-9a20-4a86-abc8-3261fc418192)

</td>
<td>


![image](https://github.com/rstacruz/cheatsheets/assets/74385/71a91afc-aa7b-4b8b-adf2-30a976c4a324)

</td>
</tr>
</table>
2024-04-03 23:37:00 +11:00
Rico Sta. Cruz
511de900ba
Formatting updates (#2133)
- Update some sheets which have very long sections
- Remove `layout: 2017/sheet` (everything has the same layout now)
- Remove outdated sheets
2024-04-03 18:30:24 +11:00
Rico Sta. Cruz
641915c80c
Prevent double-build in PR's 2024-03-30 18:53:37 +11:00
Rob Barreca
d62bbeb024
Fix before/after with no arg (#2042)
No arg defaults to :each not :all 


https://www.rubydoc.info/github/rspec/rspec-core/RSpec%2FCore%2FHooks:before
2024-03-29 18:55:47 +11:00
Artem
758a48d9c5
Update pm2.md (#2080)
about counters :)
2024-03-29 18:55:36 +11:00
Sam Weaver
8e03519c2b
Add example of not operator to lua.md (#2095) 2024-03-29 18:55:22 +11:00
slockhax
e067bd588d
Updated out of date link in go.md (#2092)
Previous link for the Go wiki was no longer valid. Updated to the
current wiki site location.

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2024-03-29 18:48:34 +11:00
luka598
ba20f0bf67
Fix typo. Add second star to the beginning of jsdoc block. (#2085)
Change this
```js
/*
 * @alias Foo.bar
 * @name Foo.bar
 */
```
to this
```js
/**
 * @alias Foo.bar
 * @name Foo.bar
 */
```

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2024-03-29 18:48:15 +11:00
Rico Sta. Cruz
9ef88ffade
Run workflow on pull request 2024-03-29 18:46:24 +11:00
Menno Spijker
4b05ba3b0a
Update kotlin.md (#2096)
Added return type on method.

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2024-03-29 18:44:16 +11:00
Rico Sta. Cruz
a7b5dbe1e7
Remove inactive cheatsheets (#2131)
Remove some very old ones that may not be relevant anymore.
2024-03-29 18:41:21 +11:00
Rico Sta. Cruz
d138253d1e
Use aggressive CSS inlining 2024-03-28 23:57:44 +11:00
Rico Sta. Cruz
49f5585e62
Remove Cloudflare beacon 2024-03-28 22:01:42 +11:00
Rico Sta. Cruz
feb02eb551
Update carbon CDN URL 2024-03-28 21:13:20 +11:00
Rico Sta. Cruz
a7335649e2
Fix Cloudflare beacon 2024-03-28 21:07:58 +11:00
Rico Sta. Cruz
faa73e54b0
Bump HTTP caching in assets 2024-03-28 20:10:10 +11:00
Rico Sta. Cruz
44bdd413fb
Major rewrite (!) (#2130) 2024-03-28 19:59:22 +11:00
Rico Sta. Cruz
bf059536c6
Disable publishing to gh-pages branch (#2129)
* Delete .github/workflows/deploy.yml

* Move to links.ts
2024-03-28 00:44:09 +11:00
Rico Sta. Cruz
021ec16bf1
Remove auto deployment to gh-pages (#2127) 2024-03-25 10:36:00 +11:00
Rico Sta. Cruz
1c9e012802
Add Cloudflare Pages redirects file (#2126) 2024-03-24 23:57:02 +11:00
Rico Sta. Cruz
2ac6e0ed0c
Update Node/Ruby versions (#2125)
* Update versions

* Bump GitHub workflows
2024-03-24 23:48:08 +11:00
Yudai Takada
dc91d7f64e
Remove a case that is not negative examples in the capybara sheet (#2122)
The above case is a new Bad case added by https://github.com/rstacruz/cheatsheets/pull/1798 . It is designated as Bad due to performance issues, but it is not actually a Negative example. In practice, the following would be the same test:

```ruby
expect(page).to have_button('Save')
!expect(page).to have_button('Save')
```

This is not an example that will appear on the capybara cheat sheet, because it is a problem with how RSpec is written. I think it should be removed because it creates confusion.
2024-03-22 08:53:55 +11:00
Yudai Takada
e8bfec363f
Fix some typos (#2121)
* mispelling ==> misspelling

* boundry ==> boundary

* Subsituted ==> Substituted

* expresion ==> expression

* bandwith ==> bandwidth

* Contstructor ==> Constructor

* chaning ==> changing

* retrive ==> retrieve

* mached ==> matched

* devlopment ==> development

* inheritence ==> inheritance

* browers ==> browsers

* avalible ==> available

* funciton ==> function

* calulate ==> calculate
2024-03-22 08:53:26 +11:00
Jared Wenerd
bdf7fc2505
applescript handler example (#2124) 2024-03-22 08:53:08 +11:00
Tamas Papp
dc066dc18f
Remove redundant syntax (#2111)
Either use the `function` or `()` but not both, it's redundant.
2024-03-16 00:26:36 +11:00
BSD-Yassin
46907176f9
Two changes : Correction on Fish cheatsheet & version update on Docker compose (#2115)
* fixed conditional equal operator as per the official documentation https://fishshell.com/docs/current/cmds/test.html

* updated docker compose cheatsheet, added good to remember functionalities and added V2 mention

---------

Co-authored-by: yassin <yassin.bousaadi@sword-group.com>
2024-03-16 00:25:32 +11:00
Daniel Metzler
4f18d6a46b
Update cron.md (#2116)
Added missing special strings for crontab
2024-03-16 00:24:53 +11:00
Rico Sta. Cruz
d4cac4c37e
Fix some formating issues 2024-03-16 00:23:32 +11:00
Rico Sta. Cruz
3e4487a8ed
Fix formatting of /bash 2024-03-16 00:21:53 +11:00
JoeSSi
d328285853
new sed commands (#2104)
* delete and insert text with sed

* regex ranges and replacements

---------

Co-authored-by: joessi <jossipro9@gmail.com>
2024-02-15 07:43:19 +11:00
Rico Sta. Cruz
ccd97452a6
yum: update formatting 2024-02-15 07:42:47 +11:00
Guillaume Dorschner
3be696141e
Yum cheatsheet (#2101)
See the documentation used : https://access.redhat.com/sites/default/files/attachments/rh_yum_cheatsheet_1214_jcs_print-1.pdf
2024-02-15 07:41:45 +11:00
Mateus Caruccio
7317522a8c
Adds Indirection and prefix name expansion (#2102) 2024-02-15 07:40:36 +11:00
Drew Arrigoni
c7d50cdbe1
Add contains exactly and match array expectations (#2106) 2024-02-15 07:40:15 +11:00
Rico Sta. Cruz
6fbdf3efbe
Update dependencies, Ruby, Node (#2099)
* Update deps

* Update GitHub actions

* Update netlify runtimes

* Add csv

* Downgrade to Ruby 3.2.3
2024-02-04 22:35:55 +11:00
TheDarkTron
e21b17f5e7
Changed basics section to start/detach/list/reattach since these is the dominant usecase (#2098) 2024-02-04 19:25:40 +11:00
Rico Sta. Cruz
95c60a03b4
Update announcement 2023-12-14 08:58:10 +11:00
Iftakhar Husan
de4bb16b2d
Add multi range brace expansion to bash.md (#2071) 2023-12-14 08:54:12 +11:00
Mandeep Sekhon
1dbdb9c1aa
Fix spelling (#2069)
Changed "Conditinal" to "Conditional"
2023-12-14 08:46:17 +11:00
Mostafa Ahangarha
afb4634e79
Fix typo for grep (#2075) 2023-12-14 08:45:49 +11:00
hacktivista
122e4d4992
sequel.md: many_to_many {left,right}_{id=>key} (#2073) 2023-12-14 08:45:32 +11:00
Rico Sta. Cruz
af33da8de6
Update to github-pages@228 (#2067)
* Update to github-pages@228

* Add webrick
2023-10-11 21:39:23 +11:00
Sweidan Omár
3b16d4cf2c
Update vimscript.md (#2008)
Added a section on overwriting functions
2023-07-20 21:05:28 +10:00
Rico Sta. Cruz
9c2b6d725f
mako: Fix snippet and frontmatter (#1824) 2023-07-19 23:03:18 +10:00
Saikat Roy
ba8d9189ae
docker system commands added (#1778)
* docker system commands added

* .cache directory removed

* .cache directory remove along with all unncessary files inside it

* .cache directory added to gitignore

* .cache in git ignore modified
2023-07-19 22:59:31 +10:00
Mi!
90dbde9990
Update fish-shell.md (#2022) 2023-07-19 22:59:12 +10:00
Jakob (Koby) Shimony
a2d0c9279d
fix typo in tar.md (#2020)
* fix typo in tar.md

* Fix indentation
2023-07-19 22:58:25 +10:00
Brian Schonecker
ca529c9d4f
Minor update to the Variables section to BASH cheat sheet. (#2016) 2023-06-23 20:57:11 +10:00
Tyler Caceres
76e9d99fb9
Update graphql.md (#2014) 2023-06-23 20:56:53 +10:00
shhh7612
726e5c04b2
Consistent Dates in js-date.md (#2006)
Made all the dates be consistent to each other.
2023-06-06 15:44:55 +10:00
Habetdin
62e5f5f5ea
bash: Recover broken links using Web Archive (#2004) 2023-06-02 20:01:51 +10:00
Rico Sta. Cruz
748c2a65b5
Update Google Analytics settings (#1970) 2023-03-14 19:23:51 +11:00
Rico Sta. Cruz
39a6c1a6ab
Content formatting update (part 5) (#1969) 2023-03-14 15:40:29 +11:00
Rico Sta. Cruz
05890aa33d
Update clip.md 2023-03-14 15:14:48 +11:00
Allison Browne
db559f8898
Remove bad negative example from capybara sheet (#1798)
Removes the bad negative example and adds a new one
that still has bad performance. It use to be that `not_to` would wait
in a non-performant way:
https://www.cloudbees.com/blog/faster-rails-tests 
but now it it no longer waits: 
https://github.com/rubocop/rubocop-rspec/issues/378#issuecomment-463250177
2023-03-14 14:09:31 +11:00
Rico Sta. Cruz
ea5f9100f2
Content formatting update (part 3) (#1967) 2023-03-14 12:52:21 +11:00
Rico Sta. Cruz
c8d1d57d9f
Content formatting update (part 2) (#1966) 2023-03-13 23:08:02 +11:00
Rico Sta. Cruz
711ba22911
Content formatting update (#1965) 2023-03-13 23:02:33 +11:00
Emily Grace Seville
ab9ab48bc5
Add Command Line Interface Pages (CLIP) page syntax examples (#1953)
* Add CLIP page syntax examples

* Update urls

* Fix errors
2023-03-13 22:38:48 +11:00
Emily Grace Seville
cc9f2439cb
Refresh README: mention similar projects (#1961)
* Refresh README:

- mention similar projects

* Refresh README:

- change link text for TlDr
2023-03-13 22:37:39 +11:00
Rico Sta. Cruz
877f83fbed
Update _data/carbon.yml 2023-03-10 16:10:01 +11:00
Vivian De Smedt
9c1026d62f
Update vimscript.md (#1952)
Accessing key in dictionaries make use of `[` instead of `(`
2023-02-25 09:47:30 +11:00
Peter C. S. Scholtens
6afbde3c2d
Update find.md (#1783)
* Update find.md

Example to look very detailed in the past using a before and after condition.

* Update find.md

Co-authored-by: kang <1115610574@qq.com>

---------

Co-authored-by: kang <1115610574@qq.com>
2023-01-31 19:57:10 +11:00
Joshua Inho Jung
6b4c9ef35d
Add npm-version command to npm cheatsheet (#1553) 2023-01-31 19:56:35 +11:00
Dan Nissenbaum
b91885ec71
Alternative form of long prefix/suffix removal (#1941)
The ${foo/%from} is an alternative form of the long suffix removal.
Likewise, he ${foo/#from} is an alternative form of the long prefix removal.

Test cases:

~~~bash
foo=gododa

# The following are the same: Long prefix removal.
# Result: r=a
r=${foo/#g*d}
r=${foo##g*d}
# (Compare to short prefix removal)
# Result: r=oda
r=${foo#g*d}

foo=agogod

# The following are the same: Long suffix removal.
# Result: r=a
r=${foo/%g*d}
r=${foo%%g*d}
# (Compare to short suffix removal)
# Result: r=ago
r=${foo%g*d}
~~~
2023-01-31 19:55:15 +11:00
TheDarkTron
5efbf15d4f
Added basic syntax for dictionaries and lists (#1947) 2023-01-31 19:54:45 +11:00
Kevin Yue
cd02bb5a2c
Correct the --include option (#1948) 2023-01-31 19:53:46 +11:00
TheDarkTron
11cfb5c943
Added Search & Replace command (#1943) 2023-01-27 21:22:50 +11:00
TheDarkTron
04d0b8d9df
Removed :q! and :qa! (#1944) 2023-01-27 21:22:23 +11:00
not-a-patch
0d16abcb6a
Include have_current_path into expectations (#1938) 2023-01-18 22:46:59 +11:00
TheDarkTron
9b0e8f2203
Added nested list items, moved image embedding with reference to own block (#1939) 2023-01-18 22:44:08 +11:00
Andrei Curelaru
9cc370f984
Added 2 movement shortcuts (#1903)
* Added 2 movement shortcuts

In the Document section, "Move down/up by n lines"

* Update vim.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2023-01-04 20:45:26 +11:00
Jun Santilla
c8aa8f2aac
Add import useState (#1906) 2023-01-04 20:44:57 +11:00
Genesis
66b6648e49
go-updates: Added variables and constants additions (#1931)
Co-authored-by: Zhenya Sikirzhitsky <zhenya_sikirzhitsky@epam.com>
2023-01-04 20:44:10 +11:00
lzrdblzzrd
d7fc5ccf02
Update gnupg.md (#1932)
Fixed a typo: edit -> trust
2023-01-04 20:42:50 +11:00
Dimi Shahbaz
000441292e
tig: Fix traling newline in header (#1930)
There is no newline between the header and the table body, resulting in
a rendering issue at https://devhints.io/tig.

This PR adds a newline after the section header.
2023-01-02 21:28:24 +11:00
Dimi Shahbaz
58a1129c9b
Update tig cheatsheet (#1918)
* Update tig cheatsheet

The last update was in 2018, and some shortcuts were wrong, and many
were missing. This update adds the most pertinent shortcuts in the most
used tig views. This update matches tig version 2.4.1.

* Fix build

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-12-23 10:07:57 +11:00
Sonia Hamilton
83017d313e
Update bash.md (#1917)
* Update bash.md

declare variable as integer, then increment

* Update bash.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-12-16 08:05:23 +11:00
Xinpeng Wei
859d8e4f0b
fix: make the meaning of ^ and $ more precise (#1905)
* make the meaning of ^ and $ more clear

^ and $ work differently in multi-line pattern which are different from \A and \Z.

* Update regexp.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-12-02 20:16:09 +11:00
Lucendio
076c9d6b89
Fix merge flag name (#1623) 2022-11-01 14:30:02 +11:00
Antoine Mace
5522b615bc
fix(mysql): fix mysql backup typo (#1628) 2022-11-01 14:29:49 +11:00
Adam Leskis
71a0a6582a
update some links from http to https where supported (#1647) 2022-11-01 14:29:32 +11:00
Axel Ingadi
b7f08ce1e6
Update subgrid value (#1797) 2022-11-01 14:29:15 +11:00
Dennis Thompson
5f5ce3eb83
Using latest rollup babel plugin (#1536) 2022-11-01 14:28:58 +11:00
Léni Marvaud
287295eae1
docker: Add depends_on long syntax (#1891)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-11-01 14:23:53 +11:00
tripleee
a5abcaea10
sed: fix "!p" example (#1898) 2022-11-01 14:19:16 +11:00
tripleee
1a0c86e002
grep: slashes do not need backslashes (#1899) 2022-11-01 14:13:54 +11:00
Vadym Kurachevskyi
655647d5d4
npm: add "npm rm" (#1839)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-11-01 14:13:32 +11:00
Rico Sta. Cruz
f1dfc086e5
Bump github-pages gem (v227) (#1901) 2022-11-01 14:11:33 +11:00
Rico Sta. Cruz
58232cc505
Bump runtime versions (Node.js v18) (#1900) 2022-11-01 14:08:12 +11:00
Léni Marvaud
0a6785c3f1
Add Healthcheck cheatsheet (#1892) 2022-11-01 13:26:22 +11:00
original-taste
09d5779281
added capturing group reference term (#1896) 2022-10-30 23:27:48 +11:00
tripleee
271e0b7c5d
bash.md: update with best practices (#1897) 2022-10-30 22:55:55 +11:00
JonghwanWon
6999e947cb
Update typescript.md (#1863) 2022-10-27 13:23:21 +11:00
Ellie Tam
fac4d1e60b
Update kotlin.md (#1885) 2022-10-05 13:27:04 +11:00
whincwu
288baef931
Update mysql.md (#1879) 2022-09-14 13:08:20 +10:00
disksing
d8fb4189fd
Improve indent (#1874) 2022-09-14 13:07:57 +10:00
Rico Sta. Cruz
3cd65f1974
Update environment versions 2022-09-14 13:02:26 +10:00
Saravanakumar J
5fb0ab2a68
Added few methods to JS Array (#1865) 2022-08-12 07:41:13 +10:00
Loïc Doubinine
68758d5b26
Add tar cheatsheet (#1870)
Co-authored-by: Zed <zed@riper.fr>
2022-08-12 07:40:12 +10:00
Nicolas Zagulajew
e02473bcb5
add ${PIPESTATUS[c]} special var (#1800)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-07-07 23:09:23 +10:00
throny
d62209edf3
Added restart policy to other options (#1831)
* restart policy

* Update formatting

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-07-07 23:07:08 +10:00
Cayley Humphries
14068e6c4a
Add @async to JSDoc Other keywords section (#1819)
Async is so prevalent these days, felt like it was important to include in a cheatsheet.
2022-07-07 23:03:37 +10:00
tew
05b5e05d09
Added link to Introduction section (#1854)
Added Bash Hackers Wiki link to the Introduction section, as this is just as useful as the other two.
2022-07-07 22:57:06 +10:00
Zack Grannan
3a367c969c
Update git-log-format.md (#1853)
In date formatting: `rfc2822` should be `rfc2822`
2022-07-07 22:55:40 +10:00
Raigorx Hellscream
955bc18ead
fix react confusion Fragments don't require keys! (#1847)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-06-13 10:25:10 +10:00
Konstantin Komelin
34e7fe3d3c
Removed unnecessary dot from the require-dev command (#1842) 2022-06-09 15:42:38 +10:00
OmegaSquad82
5b68e050e0
Add usage of strict shell (#1841)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-06-09 12:11:24 +10:00
sontru
b50655f6dc
Update top.md (#1837) 2022-06-03 18:10:34 +10:00
Ben Adrian Sarmiento
994a66d843
Fix back button showing up on home (#1835) 2022-05-21 10:04:40 +10:00
jaw3l
b86ebd8968
Updated docker-compose.md (#1827) 2022-05-20 12:43:57 +10:00
Christophe Bliard
e7d44f5f8c
Update rdoc.md (#1832)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-05-19 22:58:57 +10:00
Julio Jordán
f142dce3f3
Fix typo (#1834) 2022-05-19 22:57:35 +10:00
Rico Sta. Cruz
689e6a5e69
Update rdoc.md 2022-05-18 15:48:54 +10:00
Mariusz Michalowski
484fba606f
Added new resources (#1823) 2022-05-08 08:08:26 +10:00
Rico Sta. Cruz
8b42b199dd
Update mako.md 2022-05-06 15:33:50 +10:00
hydrargyrum
685ac707b0
jinja: fix typo in front-matter (#1825) 2022-05-06 15:33:36 +10:00
Mike Harrison
1c43d9feb4
Add Logical Or example to RSpec (#1554)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-04-07 11:23:56 +10:00
akshay
cd27a164b3
Update heroku.md (#1807)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-04-06 20:36:55 +10:00
TimetravelerDD
2060d12b1d
Update top.md (#1604) 2022-04-04 22:14:34 +10:00
Dewald Swanepoel
5a312cd79e
Fixed bug in WaitGroup example (#1809) 2022-04-04 22:14:16 +10:00
whincwu
03a14640d7
update markdown (#1811)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-04-04 22:13:46 +10:00
Rico Sta. Cruz
95713890ce
Upgrade to Node v16 and new GitHub action steps (#1814) 2022-03-29 22:11:50 +11:00
Rico Sta. Cruz
3cbc5b1bcd
Update stimulus-reflex.md 2022-03-16 09:18:01 +11:00
verbatino
5a23b79e78
Add tr command to bash cheatsheet (#1802)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-03-13 22:08:22 +11:00
Luis Ezcurdia
c84d4c1b97
RubyOnRails: Order ActiveRecord callbacks and add missing methods (#1789)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2022-02-21 10:37:42 +11:00
Jose Pradenas Navarro
301d6b07f5
Added @use rule (#1765)
* Added @use rule

The new @use rule has been added, and a warning has been given regarding the phasing out of @import.

* Fixed md from ``` to `
2022-02-14 22:17:06 +11:00
Rico Sta. Cruz
8a3d8c3449
Update fish.md (formatted from #1758) (#1764)
Co-authored-by: EmilySeville7cfg <EmilySeville7cf@gmail.com>
2021-12-23 09:29:34 +11:00
Sami Harju
f5125bd1ec
Update bash.md (#1760) 2021-12-22 16:21:16 +11:00
Peter C. S. Scholtens
c1741f6923
Update bash.md (#1757) 2021-12-15 09:36:19 +11:00
techie2000
3e380ef4a2
Added iPhone 12/13, and some Galaxy details (#1729) 2021-12-13 10:25:53 +11:00
kyleVsteger
e5fcc03e3e
Elixir: Add with Example (#1731) 2021-12-13 10:25:41 +11:00
Lloric Mayuga Garcia
21c62b3729
Add composer outdated --direct (#1734) 2021-12-13 10:24:51 +11:00
Emily Grace Seville
8b6f889761
Fish shell page update (#1743) 2021-12-13 10:23:40 +11:00
Tomislav Gracin
0dae9e9f4d
Wrong range for TINYINT (#1753) 2021-12-13 10:23:19 +11:00
Gary Wang
03a4487e86
Correct the emphasis markup (#1747)
According to https://orgmode.org/manual/Emphasis-and-Monospace.html,
it should be =verbatim= and ~code~
2021-11-19 18:31:32 +11:00
guillem
6e34105043
Adds column names for transaction code and transaction notes. Fixes typo 'expneses'. (#1735) 2021-11-03 22:07:48 +11:00
Christopher Hopper
b28b6527f3
Add special parameter $_ to bash cheatsheet (#1736) 2021-11-03 22:06:31 +11:00
xianlaioy
3bf1169205
GROUPBY Space required (#1737) 2021-11-03 22:05:54 +11:00
Lloric Mayuga Garcia
ff5e63c9db
Use global (#1733) 2021-10-29 11:30:11 +11:00
nformis
e2680e5684
Update sublime-text.md (#1718)
Added shortcuts to moving and deleting lines
2021-10-21 14:31:36 +11:00
Dawit
f6faef05d8
Fix a couple of typos (#1720) 2021-10-21 14:30:57 +11:00
Angel Tabares
8041e914f3
update validation and middleware reference links (#1727) 2021-10-21 14:29:12 +11:00
danny-laa
918aa48327
Create LICENSE (#1613) 2021-10-07 21:51:13 +11:00
Godfery
028c578bc1
Update jsdoc.md (#1677) 2021-09-27 11:37:40 +10:00
John Karahalis
dcf31435ab
vimscript: Fix invalid code example (#1664) 2021-09-27 11:37:31 +10:00
hydrargyrum
ec1223800f
Add mako cheatsheet (#1687)
* Add mako cheatsheet

* Update mako.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-09-27 11:29:02 +10:00
Michael
154c4af2d6
Add grep.md (#1223)
* create grep.md

* update grep.md

* Update grep.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-09-27 11:17:58 +10:00
hydrargyrum
f0f4f05c92
Add Jinja cheatsheet (#1688)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-09-27 11:14:30 +10:00
Antwan G
ede185bf27
Update cron.md (#1701) 2021-09-27 11:12:30 +10:00
Dario Seidl
76ee217b88
Add --show-error to curl cheatsheet (#1713) 2021-09-27 11:12:12 +10:00
yeknomedoc
320c38959e
Expanded the cheat-sheet (#1694)
Expanded the cheat-sheet with:
- *, ** as expansion arguments for lists and dicts./
- A Tuple section
- 'mutable' and 'immutable' notation behind the Tuple and Lists header.
2021-09-18 23:46:50 +10:00
Ryan M
28c5f62de1
fix spelling issue in Python (#1683)
Fixing a spelling issue in the Python section.
2021-09-18 23:45:51 +10:00
Ehren Murdick
1bf9823bea
Add greek characters to vim-digraphs.md (#1710)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-09-17 09:33:18 +10:00
Rico Sta. Cruz
a2cec5f0f0
Empty out robots.txt (#1708) 2021-09-12 21:44:49 +10:00
Daniel Bergman
88f171cba2
Update atom.md (#1707) 2021-09-10 23:42:46 +10:00
Ilya Radchenko
a6de3c7882
Update Ember syntax (#1704)
It has been a while since Ember has moved away from views to components :)
2021-09-10 13:34:37 +10:00
Adrian A
e0379d3cb4
Update linux.md (#1681)
New command for newbies
2021-08-04 22:55:16 +10:00
Igor Grinchesku
b3c91e197a
Update pass.md (#1662)
* Update pass.md

Add `bash` to the code block

* Update pass.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-06-20 23:04:30 +10:00
Dušan Stokić
f7d4f61acf
Update markdown.md (#1657)
Added bold italic and Strikethrough to the emphases Heading
2021-06-03 22:29:44 +10:00
Rico Sta. Cruz
ee4ed02fa5
Update rdoc.md 2021-05-20 11:57:24 +10:00
Cristiane TK
9762ba1f75
Update curl.md (#1649)
Add curl -F
2021-05-06 11:39:07 +10:00
Julio Maniratunga
85d55d6e13
Fix typo in rails.md (#1641) 2021-04-16 23:58:10 +10:00
Eero Ränik
7e5ccb9336
Fix a few examples that were using wrong CSS pseudo-classes (#1639) 2021-04-05 22:44:47 +10:00
Pedro Assunção
c1de0e223c
Add Map.from_struct and Kernel.struct to maps section of Elixir cheatsheet (#1631)
* Update elixir.md

Added Map.from_struct and Kernel.struct to maps section.

* Update elixir.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-03-16 12:01:25 +11:00
codedhan
4d47cbd4e9
Update kotlin.md (#1629)
* Update kotlin.md

minor addition

* Update kotlin.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-03-12 16:22:20 +11:00
Emad Poursina
1acbf74350
Update cron.md (#1625)
* Update cron.md

Add Crons operators and some examples

* Formatting

* Formatting

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-03-11 23:44:35 +11:00
Mohammed Samir
02fed04a43
Update assignment section "=" (#1626)
I think these are more informative and precise examples for assignment expression.
2021-03-11 08:07:03 +11:00
Peter Avila
1e966a9ff1
Keep comments on combinatory arguments consistent. (#1622) 2021-02-19 16:57:24 +11:00
Matilde Bravo
8646bb2c89
Updated description for arguments section (#1620) 2021-02-18 17:56:44 +11:00
Gerrit Prößl
39f62fc3e9
Add Stringification to C Preprocessor (#1616) 2021-02-13 12:05:44 +11:00
Rico Sta. Cruz
3e12cb0b43
homebrew: fix cask install command 2021-02-11 10:40:13 +11:00
Julien Lamandé
6cf3493058
Add the mention of push --force-with-lease (#1611)
`--force-with-lease` is safer than `--force` as it checks that you are up-to-date with the remote branch.
2021-02-06 09:26:07 +11:00
Cecile Veneziani
9148ed237e
Fix view name for s key value (#1609)
`s` key value stands for Status instead of Stage view.
Stage view can be accessed with `c` key value
2021-02-03 11:25:01 +11:00
Peter Cole
9ec89aa788
Update homebrew.md (#1601)
The command for listing installed applications has changed.
`Error: Calling brew cask list is disabled! Use brew list [--cask] instead.`
2021-01-12 07:59:31 +11:00
Jonathan Baillais
e2a59f4ff9
Update emmet.md (#1575) 2021-01-07 23:08:33 +11:00
Andrew
246693576d
added port param (#1559)
connect to custom port
2021-01-07 22:43:55 +11:00
Rafe Rosen
c1f9f6f951
Create stimulus_reflex.md (#1576)
* Create stimulus_reflex.md

* Update and rename stimulus_reflex.md to stimulus-reflex.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2021-01-07 22:40:32 +11:00
Felix Gerschau
58ede74aec
httpie.md (#1569) 2021-01-07 22:38:06 +11:00
Vítězslav Ackermann Ferko
1729e1d2a7
Updated Property lookup to reflect new docs (#1577)
available here https://stylus-lang.com/docs/variables.html#property-lookup
2021-01-07 22:33:53 +11:00
Floffah
be0341938b
Screen (#1585)
* Create screen.md

* better formatting

* period because ocd
2021-01-07 22:33:01 +11:00
Lena
8ea3efc08b
html-email: add role=presentation
Add role="presentation" on table tag to help screenreaders' restitution. It is not a data table but a layout table so we do not need to make a screenreader reads all the table structure.
2021-01-07 22:32:24 +11:00
Joyce Babu
e1292194df
fix: typo (#1600) 2021-01-07 15:26:30 +11:00
Jan Keromnes
e8f302b290
gitpod: Make Gitpod's automated dev setup automatically run Jekyll and Parcel (#1586) 2020-12-18 08:44:09 +11:00
Steven Conaway
1fbacbc9f8
Resolutions: combine iPhone 6/6S and 7/8/SE2 (#1594) 2020-12-17 08:42:46 +11:00
Przemysław Pietras
f7f77ad479
go: add while loop example (#1583) 2020-12-03 19:37:40 +11:00
Rico Sta. Cruz
b27d7d7f55
GitHub actions: update Ruby version for deployment 2020-11-26 10:45:56 +11:00
Rico Sta. Cruz
2822b14a57
GitHub actions: update Ruby version 2020-11-26 10:45:29 +11:00
Jonathan
616896d1d8
Update php.md (#1581)
Use type hinting.
Use https URLs.
Adhere to PHP-FIG PSR-12.
2020-11-26 10:44:23 +11:00
Jonathan
fbd66d4838
Update rdoc.md (#1579)
Use https. Use IANA assigned example.com domain.
2020-11-25 06:28:05 +11:00
Anton Kochkov
9dd25959fa
tig: Add tig -C invocation tip (#1120)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:36:55 +10:00
Rico Sta. Cruz
18b09de08b Remove badges 2020-08-03 22:35:03 +10:00
Anton Pozhidaev
b407143e5e
xpath: Fix nesting predicates (#1158)
we need to use `.//` instead of `//` inside the predicate
2020-08-03 22:34:28 +10:00
Luong Vo
269c709c61
go: Add documentation for golang interfaces (#1332)
* Add documentation for golang interfaces

* Update go.md

Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:33:43 +10:00
James Prescott
c03aa5de51
Add example in moment.js cheatsheet (#1063)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:33:31 +10:00
Andrii Radyk
76acff1923
fix indentation in go.md (#1076)
fix broken indentation and align indentation with other examples
2020-08-03 22:32:21 +10:00
DJCrashdummy
8747708136
bash: Correct mistakes at $RANDOM (#1147)
- using `=` just throws an error!
- `200` limits the result to 200 possible numbers starting with 0! so the maximum is 199.
- added `$` straight before `RANDOM` to be on the safe side.
2020-08-03 22:31:11 +10:00
Rico Sta. Cruz
692375e0fc jsdoc: Update domain name 2020-08-03 22:27:34 +10:00
Maxis Kao
91e7bfe13b
flow: Update doc links (#1070)
Co-authored-by: Maxis Kao <maxis.kao@shopee.com>
2020-08-03 22:21:29 +10:00
bastianbowe2000
c051140380
docker: Supply more helpful docker run -p description (#1064)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:21:19 +10:00
Josua Schmid
dec49c3969
Add Slim whitespacing section (#1385) 2020-08-03 22:20:05 +10:00
headdetect
aef8d25a92
go: Update "statements in if" use case (#1199)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:19:23 +10:00
Akshay Kadam (A2K)
9e0dbeddce
Added more header tags & ordered lists (#1514) 2020-08-03 22:09:26 +10:00
Sumit Pore
f2066053f8
composer: Add examples of how to pass versions (#1516)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-08-03 22:08:55 +10:00
Rico Sta. Cruz
7a85a431af Update Carbon URL 2020-08-02 01:57:04 +10:00
Josh Howe
c719e2899d
[JSDoc] Link to the full list of keywords (#1506) 2020-08-02 00:08:38 +10:00
Dario Vladović
36337818d9
bluebird: Promise.prototype.finally is standard Promise API method (#1509) 2020-08-02 00:08:23 +10:00
Artemee
6a1378f310
Update vim.md (#1334)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-13 00:13:50 +10:00
Rico Sta. Cruz
cca13c9ca5 Update pubsrv URL 2020-07-13 00:11:51 +10:00
German Capuano
8a9907db52
fix accessibility and search form (#1501)
Co-authored-by: German Capuano <e@gcapu.com>
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-12 23:34:53 +10:00
Peter de Croos
ed7ad56266
phoenix-migrations: changed precision to apply to decimal (#1375)
adding `precision: 10, scale: 2` will result in an exception on migration due to malformed sql. precision and scale apply to decimal
2020-07-09 01:38:20 +10:00
小秦
11849e8464
Remove extra closing braces (#1376) 2020-07-09 01:37:49 +10:00
Qwerty-Space
2a4cbe953f
vim: Fix two minor errors (#1370) 2020-07-09 01:37:24 +10:00
Toni Dezman
16588e2efe
Update to new Minitest namespace synatx (#1027) 2020-07-08 10:58:58 +10:00
lsb
5c4b57691f
Fix link to serialization document (#1013)
This is current as of 972f2e7b12
2020-07-08 10:58:39 +10:00
Rico Sta. Cruz
901f457dc2 Update image sizes 2020-07-08 10:57:33 +10:00
Rico Sta. Cruz
3cf86447a3 Styling: update gray colors 2020-07-07 00:23:12 +10:00
Rico Sta. Cruz
e54458ad9c Remove some deprecated sheets 2020-07-06 01:54:07 +10:00
Rico Sta. Cruz
68af8e66f6 Delete mongodb.md 2020-07-06 01:50:16 +10:00
Rico Sta. Cruz
afc25b5e1f
Update styling (#1498) 2020-07-06 01:35:26 +10:00
Rico Sta. Cruz
c792f1b418
Add introduction sections (#1497) 2020-07-06 00:38:31 +10:00
Rico Sta. Cruz
ba699dd29e Cleanup: fix React formatting 2020-07-05 23:16:32 +10:00
Rico Sta. Cruz
aff701a600
Cleanup: formatting update (2020-07-05) (#1496) 2020-07-05 23:13:06 +10:00
Rico Sta. Cruz
6b43bf97da Cleanup: update timestamps 2020-07-05 21:11:36 +10:00
James Allen
18ebcc9b2e
react: Remove extra ending bracket (#972) 2020-07-05 21:07:19 +10:00
Rico Sta. Cruz
45160e4cc7
Tech: fix 301 redirects (#1495) 2020-07-05 21:05:57 +10:00
SZ-CHENG HUANG
04f28a1d76
Flow: Fix the example for width subtyping (#558) 2020-07-05 21:05:07 +10:00
hyww
a54b580e01
bash: Fix substring expansion with negative offset (#947)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-05 21:04:28 +10:00
Jakob Schöttl
aff27988e0
vimscript: Function stridx return value is an index (#988)
* Bugfix: function return value is an index

* White-space change

* Bugfix and clarification
2020-07-05 21:03:07 +10:00
Øyvind Eikeland
42950dfac7
sed: Added command for excluding lines while printing (#984)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-05 21:02:32 +10:00
Chris Hayes
959b471fb6
lua: Fix elseif conditional typo (#1157)
`elsif` should be `elseif`
2020-07-05 21:00:15 +10:00
Bryan Dady
31b8a9af45
Add CREATE USER (#1381)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-05 20:59:47 +10:00
Michael Kreusel
21306a7bfe
httpie: Add raw JSON example (#1477)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-07-05 20:58:21 +10:00
fREW Schmidt
d20fddb40a
vim: Fix spelling (#1000) 2020-07-05 20:57:28 +10:00
Hadrien Lepoutre
a0849391d2
sass: Fix typo (#1066) 2020-07-05 20:57:14 +10:00
Mike Hatch
e3cd185414
Formatting: capitalized first letter on some headings (#1044)
Capitalized first letter on "Keywords," "Description," and "Intro" to be more consistent with document's current style.
2020-07-05 20:56:59 +10:00
Rico Sta. Cruz
bec53c5405 Update CSS to increase contrast 2020-07-05 16:15:00 +10:00
Rico Sta. Cruz
360bb87287 Cleanup: update timestamps of files 2020-07-04 23:33:09 +10:00
Rico Sta. Cruz
d4e3421ac6 Format: update some table formatting 2020-07-04 23:29:16 +10:00
Rico Sta. Cruz
02c3e97f4a
Update URL for placements (#1492) 2020-07-04 00:12:32 +10:00
Rico Sta. Cruz
ee072214f7
Style updates (#1491) 2020-07-03 23:21:02 +10:00
Pavitra Behre
865ad2cd98
emmet: Fixed a typo in Emmet Cheatsheet (#1479)
Fixed a typo in emmet
section>p gives <section><p>...</p></section>
Earlier it was <section><pt>....</p></section>
2020-07-03 22:49:04 +10:00
Ye-Chan Kang
32fa7a6898
sass: Update sass.md (#1481) 2020-07-03 22:48:49 +10:00
techie2000
05e2dabc76
Update resolutions.md (#1482)
Added in newer iPhone models and some Galaxy models either side of what was already published.
2020-07-03 22:48:22 +10:00
Chl
ac3891cae8
vim: Added '%' as a quick delimiter navigator (#1483)
Works pour `{}`, `()`, `[]` and also `/* */`, `#ifdef` and other usual delimiters
in programming languages. See ':help %'.
2020-07-03 22:48:11 +10:00
Rico Sta. Cruz
969967363f
Formatting: update formatting of 20+ files (#1490) 2020-07-03 22:47:47 +10:00
Zeebrommer
87ed01b739
Bash: add else example (#1484)
I always forget if `else` is to be followed by a `;` or not. Add it to the conditionals chapter where I would expect it.
2020-07-03 00:45:04 +10:00
Rico Sta. Cruz
b82849e840
Sponsor update (#1489) 2020-07-03 00:42:02 +10:00
Rico Sta. Cruz
fcc6196aa4 Cleanup: remove extra spaces before {:...} tags 2020-07-02 10:02:38 +10:00
Josh
58d1602609
simple typo correction (#1486) 2020-07-01 22:09:19 +10:00
Kushal Arya
f3cef3c398
vim: Added key for 'A' (#1018) 2020-06-24 00:27:25 +10:00
Gautam Naik
b4e978f074
vim: Added system clipboard copy-paste shortcuts (#522)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-06-24 00:26:41 +10:00
mr-bolle
41a2964704
markdown: add checkbox (#971)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-06-24 00:25:39 +10:00
burhanudin hakim
26e0f381fb
factory_bot: Update static attributes using dynamic (#772)
Co-authored-by: Rico Sta. Cruz <rstacruz@users.noreply.github.com>
2020-06-24 00:24:02 +10:00
Petr Heinz
3a918a1619
bash: expanded working with arrays (#534) 2020-06-24 00:23:07 +10:00
SombreroElGringo
6b7e8ed460
[Lodash] Fix padding (#813) 2020-06-24 00:18:03 +10:00
Alessio
a595901d99
Fix typo (#1476) 2020-06-24 00:15:39 +10:00
Rico Sta. Cruz
25070809c1 Deploy to devhints-mirror 2020-06-23 09:34:06 +10:00
Rico Sta. Cruz
1fa97113d5
Use Netlify redirects (#1474) 2020-06-23 01:55:02 +10:00
Rico Sta. Cruz
5d514222d6 Dev: fix jekyll warnings; fade: make it more subtle 2020-06-23 01:10:54 +10:00
Rico Sta. Cruz
b3cab9aa28 Remove minifier again, it breaks some spaces 2020-06-23 00:56:21 +10:00
Rico Sta. Cruz
6076941a33 Remove CNAME in master 2020-06-23 00:55:29 +10:00
Rico Sta. Cruz
51924e42bd Try to deploy with gh-pages? 2020-06-23 00:42:19 +10:00
Rico Sta. Cruz
f534ec6c72
Reenable minifier, disable Travis (#1473) 2020-06-23 00:38:08 +10:00
Rico Sta. Cruz
c27d9bf443 Netlify: add CloudFlare purge plugin 2020-06-23 00:13:26 +10:00
Rico Sta. Cruz
46787089cd
Tech improvement: Fix CSS, and enable minification (#1472) 2020-06-22 23:47:07 +10:00
Rico Sta. Cruz
81aaaf064a Remove HTML minification 2020-06-22 22:14:35 +10:00
Rico Sta. Cruz
b1ff74a82f Simplify CSS 2020-06-22 22:14:35 +10:00
Rico Sta. Cruz
6722b20d19 Add postcss and cssnano 2020-06-22 22:14:35 +10:00
Rico Sta. Cruz
40e1c30405 Remove built files 2020-06-22 22:14:35 +10:00
Rico Sta. Cruz
048697b3d3
Merge pull request #1464 from rstacruz/feature-parcel 2020-06-22 20:44:30 +10:00
Rico Sta. Cruz
b0a436587f
Merge pull request #1111 from mantrax314/mantrax314-patch-1
Fix Typo in Golang cheatsheet # Methods -> Receivers
2020-06-21 14:01:35 +10:00
Rico Sta. Cruz
4dbdd73c52
Merge pull request #1421 from jakeherp/patch-1 2020-06-17 23:24:06 +10:00
Rico Sta. Cruz
75b102fca5
Update jest.md 2020-06-17 23:23:34 +10:00
Rico Sta. Cruz
214a4ed82e
Merge pull request #1462 from kozhemyak/patch/add-bash-lastindex
Add a way to get the last element
2020-06-17 23:22:27 +10:00
Rico Sta. Cruz
02bbc11dae Fix TravisCI script 2020-06-15 00:11:02 +10:00
Rico Sta. Cruz
ee1bbb06a3 Netlify: enable HTML minification 2020-06-15 00:11:02 +10:00
Rico Sta. Cruz
d8df859e5c Update Docker setup 2020-06-15 00:11:02 +10:00
Rico Sta. Cruz
57ed177028
Merge pull request #1382 from knw257/patch-1
Added [:print:] class to character classes
2020-06-15 00:07:17 +10:00
Rico Sta. Cruz
4c38e4ae49
Merge pull request #1425 from mehran-prs/patch-1 2020-06-15 00:06:45 +10:00
Rico Sta. Cruz
85cf4ec38f
Merge pull request #1374 from Mazyod/patch-2
Add --cvs-exclude flag docs
2020-06-14 23:56:26 +10:00
Rico Sta. Cruz
ae18baa7e9
Merge pull request #1383 from zhumengu/master 2020-06-14 23:55:27 +10:00
Rico Sta. Cruz
d5683a9ddf
Update bash.md 2020-06-14 23:54:47 +10:00
Rico Sta. Cruz
577bc0dae1
Merge pull request #1389 from T04435/patch-2
Update html-meta.md
2020-06-14 23:53:15 +10:00
Rico Sta. Cruz
66d30a519c
Merge pull request #1380 from typebrook/patch-1
Update curl.md
2020-06-14 23:36:24 +10:00
Rico Sta. Cruz
0a91b64a1a
Merge pull request #1422 from macvinpinto/patch-1
Update python.md
2020-06-14 23:35:57 +10:00
Rico Sta. Cruz
fef9dffd21
Merge pull request #1417 from m-thomson/patch-1 2020-06-14 23:35:25 +10:00
Rico Sta. Cruz
d3203a354c Add Netlify configuration 2020-06-14 23:14:43 +10:00
Rico Sta. Cruz
a20fdfe4e6 Update the critical path with Parcel too 2020-06-14 23:09:47 +10:00
Rico Sta. Cruz
9ed567ec08 Replace Webpack (_js) with Parcel (_parcel) 2020-06-14 22:21:27 +10:00
Rico Sta. Cruz
42bac34c80
Merge pull request #1438 from deepaknayan/patch-1
Delete current buffer
2020-06-14 10:48:42 +10:00
Rico Sta. Cruz
271d37ec33
Merge pull request #1453 from trickeydan/patch-1
Use example.com instead of service.com
2020-06-14 10:47:25 +10:00
Rico Sta. Cruz
a8475e711e
Merge pull request #1446 from Fasani/patch-1
Small improvement
2020-06-14 10:46:44 +10:00
Rico Sta. Cruz
17ac9a671b
Merge pull request #1390 from zavre-c/patch-1 2020-06-14 10:45:29 +10:00
Rico Sta. Cruz
aafab35c90 Update github-pages gemm 2020-06-13 22:57:33 +10:00
Rico Sta. Cruz
60f66d6750 Remove Bundler dependency lock 2020-06-13 22:14:23 +10:00
Rico Sta. Cruz
69b75e6d26
Merge pull request #1391 from tomatikrad/patch-1 2020-06-13 10:20:28 +10:00
Rico Sta. Cruz
d2cbc97ddf
Update css-flexbox.md 2020-06-13 10:20:17 +10:00
Rico Sta. Cruz
517343fcd9
Update go.md 2020-06-13 10:17:21 +10:00
Rico Sta. Cruz
242c5bccbf
Merge pull request #1397 from rajinder-yadav/patch-1 2020-06-13 10:16:20 +10:00
Rico Sta. Cruz
d0381c2254
Update bash.md 2020-06-13 10:16:14 +10:00
Rico Sta. Cruz
a78a39538b
Merge pull request #1402 from TaylorPzreal/patch-1 2020-06-13 10:15:22 +10:00
Rico Sta. Cruz
aa8c2632d7
Update bash.md 2020-06-13 10:15:03 +10:00
Rico Sta. Cruz
761fe6498e
Merge pull request #1408 from notapatch/patch-1 2020-06-13 10:13:03 +10:00
Rico Sta. Cruz
e961eb3a50
Update capybara.md 2020-06-13 10:12:49 +10:00
Rico Sta. Cruz
67850f71bc
Merge pull request #1410 from agoose77/master 2020-06-13 10:11:58 +10:00
Rico Sta. Cruz
bf22b55008
Update bash.md 2020-06-13 10:11:51 +10:00
Rico Sta. Cruz
9a73127177
Update lodash.md 2020-06-13 10:09:54 +10:00
Rico Sta. Cruz
147fd9351e
Update makefile.md 2020-06-13 10:09:28 +10:00
Rico Sta. Cruz
cd03070b11
Merge pull request #1431 from MaxVerevkin/master
fix words section
2020-06-13 10:09:16 +10:00
Rico Sta. Cruz
d42235b255
Merge pull request #1437 from rb-x/rb-x-patch-python 2020-06-13 10:09:09 +10:00
Rico Sta. Cruz
0114a74db2
Update python.md 2020-06-13 10:09:01 +10:00
Rico Sta. Cruz
2a51cfe548
Merge pull request #1440 from dougbeal/patch-1
Add %tag=value query
2020-06-13 10:08:23 +10:00
Rico Sta. Cruz
bfb2305e3b
Merge pull request #1443 from isaax2/master
Add brew upgrade to Global commands
2020-06-13 10:08:15 +10:00
Rico Sta. Cruz
1a76636dd5
Merge pull request #1451 from mahcloud/patch-1
Adding reference to whereNotIn
2020-06-13 10:07:54 +10:00
Rico Sta. Cruz
c46a9c2c6d
Merge pull request #1458 from rendyuwu/contribution
fix command First-time setup docker
2020-06-13 10:07:40 +10:00
Nikolay Kozhemyak
cd02419737 Add a way to get the last element 2020-06-12 21:10:54 +06:00
Rico Sta. Cruz
6b2cc8de1e
Merge pull request #1427 from radeesh/patch-1
Added pm2 save
2020-06-12 10:01:01 +10:00
Rico Sta. Cruz
6b4d445701
Merge pull request #1454 from onedebos/patch-1 2020-06-12 09:59:10 +10:00
Rico Sta. Cruz
d56fcc75bf
Update formatting 2020-06-12 09:59:02 +10:00
Rico Sta. Cruz
1ba32f1831
Merge pull request #1460 from tywmick/badges-duplicate-line
Remove duplicate MIT license line from Badges
2020-06-12 09:56:21 +10:00
Ty Mick
e7f7e28b5a Remove duplicate MIT license line from Badges 2020-06-10 16:34:46 -04:00
Rendy Wijaya
ec4b0cf9bd
fix command First-time setup docker 2020-06-09 13:11:18 +07:00
Adebola
9254692750
Update jest.md
Update jest.md to include optional flags.
2020-06-08 12:09:27 +01:00
Dan Trickey
20e0fac85b
Use example.com instead of service.com
service.com is a real domain name, and could potentially have a real API on api.service.com

example.com is specifically reserved by IANA and thus will never have an API on it. It is designated to be used in scenarios like this. See RFC 2606 for more information.
2020-06-06 16:50:40 +01:00
Michael Hoffert
ee079ad300
Adding reference to whereNotIn 2020-06-03 07:51:11 -06:00
Michael Fasani
9827f09f5c
Small improvement
Rearranged so that `Immutable` is above `Mutative` in both examples.
2020-05-28 23:16:42 +02:00
Isaac Cerda
ef43970680
Add brew upgrade to Global commands
brew upgrade to Upgrade all packages
2020-05-27 16:53:00 -05:00
Douglas Beal
59d47b33a3
Add %tag=value query 2020-05-23 20:18:17 -07:00
Deepak Nayan
734e13c744
Delete current buffer
File will remain intact.
2020-05-22 02:57:26 +05:30
Riadh Bch
574355b794
f string fix 2020-05-16 00:48:21 +02:00
Riadh Bch
efd0a4590a
Correction of small typing errors
There was some minor mistakes  in the file manipulation section, so I just rectified them.
2020-05-16 00:29:05 +02:00
MaxVerevkin
3973e58287 fix words section 2020-05-13 08:50:22 +03:00
Radeesh
9f6ea99c19
Added pm2 save 2020-05-08 09:39:43 -04:00
Mehran Poursadeghi
d48d956a5a
Update makefile.md 2020-05-08 14:27:15 +04:30
Macvin
799ca9ef39
Update python.md 2020-05-06 11:08:18 +05:30
Jacob Herper
6da706b706
Added inline snapshots to Jest 2020-05-05 10:25:10 +01:00
Mark Thomson
abf62e4868
findRight is actually findLast
Not sure if this was renamed at some point but there's no "findRight" in lodash, just findLast.

https://lodash.com/docs/4.17.15#findLast
2020-05-01 16:10:22 -07:00
Angus Hollands
0361fa173b
Update bash.md 2020-04-20 11:21:31 +01:00
Angus Hollands
7a2322761a Fix nullity checks for parameter expansion 2020-04-20 10:19:52 +00:00
not-a-patch
912afcd792
Update capybara.md
Capybara renamed click to click_on

From their history: 

Version 0.4.0.rc
Session#click has been renamed click_link_or_button and the old click has been deprecated

Version 0.4.1
New click_on alias for click_link_or_button, shorter yet unambiguous. [Jonas Nicklas]
2020-04-17 09:57:01 +01:00
TaylorPzreal
42df935e43
Update bash.md
Substring from the right should include __parentheses__
2020-04-07 08:45:15 +08:00
Rico Sta. Cruz
cb4e03077f
Merge pull request #1400 from srph/patch-1
React Hooks: Add deps to useEffect
2020-04-04 10:19:15 +11:00
Kier Borromeo
a652d427eb
Add deps to useEffect 2020-04-04 04:54:30 +08:00
Rajinder Yadav
3d839093e9
Correct conditions, removed superfluous brackets 2020-04-01 07:44:50 -04:00
Dima
455decd2c4
css-flexbox.md
added more container alignment options
2020-03-24 16:47:45 +02:00
zavre-c
a6fb6f3a26
Added new() to get pointer
Added function implementation of new() for getting a pointer.
2020-03-24 18:31:35 +05:30
Fidel Torres
47356a2e6a
Update html-meta.md
Updated broken link for twitter cards docs
2020-03-20 04:35:03 +11:00
zhumengu
ef9f00aa5c parent directory example 2020-03-14 15:08:20 +08:00
knw257
69ebb03cca
Added [:print:] class to character classes 2020-03-10 11:28:27 -04:00
Hsieh Chin Fan
81eb884b74
Update curl.md
Add example for how to check if a remote resource is available
2020-03-09 11:25:51 +08:00
Maz Jaleel
3f2d48a756
Add --cvs-exclude flag docs 2020-03-05 14:03:52 +03:00
Rico Sta. Cruz
447de944e4
Merge pull request #1176 from saulmestanza/patch-1
Update phoenix-migrations.md
2020-02-23 20:38:01 +11:00
Rico Sta. Cruz
0c7e52aafc
Merge pull request #1366 from tommic/patch-1
Adding command to update autoloader files
2020-02-23 20:37:45 +11:00
Rico Sta. Cruz
a2019a2aa1
Update composer.md 2020-02-23 20:37:33 +11:00
Rico Sta. Cruz
9c8df067e5
Merge pull request #1316 from johnramsden/master
Fix: Use room and remove user from gitter room link
2020-02-23 20:35:45 +11:00
Rico Sta. Cruz
ded62323ec
Merge pull request #1363 from aarti/patch-1
[YAML]: Add Reference content
2020-02-23 20:35:22 +11:00
Rico Sta. Cruz
132babca6e
Update yaml.md 2020-02-23 20:34:51 +11:00
Rico Sta. Cruz
ebd538f1f6
Merge pull request #1365 from ivorscott/patch-1
Display -i, --include
2020-02-23 20:33:52 +11:00
Rico Sta. Cruz
ecf5282f1f
Merge pull request #1367 from a-b/patch-1
Add bash $_ last argument of the previous command
2020-02-23 20:32:59 +11:00
Rico Sta. Cruz
1caa08f0ca
Merge pull request #1368 from Qwerty-Space/patch-2
Command to convert newlines from Windows to Unix
2020-02-23 20:32:46 +11:00
Rico Sta. Cruz
d8b2a29afa
Update vim.md 2020-02-23 20:32:37 +11:00
Qwerty-Space
9ba6e49d36
Command to convert newlines from Windows to Unix 2020-02-21 23:10:35 +00:00
Alexander Berezovsky
d0da7addd5
Add bash $_ last argument of the previous command 2020-02-20 12:11:57 -08:00
tommic
187fc495d3
Adding command to update autoloader files 2020-02-20 18:20:47 +01:00
Ivor Scott
4570737d5c
Display -i, --include
Include the HTTP-header in the output
2020-02-18 19:25:39 +01:00
aarti
cf52d5d7e3
Add Reference content 2020-02-17 15:13:10 -08:00
Rico Sta. Cruz
b5cd93a09f
Merge pull request #1163 from ZhdanovMV/patch-1
Update phoenix-migrations.md
2020-02-13 22:02:14 +11:00
Rico Sta. Cruz
2b6aeb322c
Merge pull request #1164 from A1RO/A1RO-patch-1
Swap "Previous/next end of word" shortcuts in vim.md
2020-02-13 22:01:56 +11:00
Rico Sta. Cruz
925abb960b
Merge pull request #1256 from glazec/patch-1
fix docker bug when building development environment
2020-02-13 22:01:36 +11:00
Rico Sta. Cruz
9490cf3adf
Merge pull request #1319 from filipve1994/patch-1
Update git-branch.md
2020-02-13 21:52:45 +11:00
Rico Sta. Cruz
d65e607ae2
Merge pull request #1318 from sebrink/master
Fixed tmux attach.
2020-02-13 21:52:29 +11:00
Rico Sta. Cruz
2b20b8549a
Merge pull request #1339 from r3s/patch-2
Update go.md
2020-02-13 21:52:15 +11:00
Rico Sta. Cruz
ebe8a85148
Merge pull request #1340 from Gennnji/patch-1
Update rollup.md
2020-02-13 21:50:28 +11:00
Rico Sta. Cruz
5342ff47df
Merge pull request #1349 from Ethereum77/patch-2
Update emmet.md
2020-02-13 21:50:07 +11:00
Rico Sta. Cruz
0db542841d
Merge pull request #1356 from JapMul/patch-1
Update moment.md
2020-02-13 21:49:47 +11:00
Rico Sta. Cruz
25ca53525c
Merge pull request #1357 from pixmin/master
Add tmux shortcut to show pane numbers
2020-02-13 21:49:34 +11:00
Rico Sta. Cruz
f58b5070c0
Merge pull request #1358 from mercedesb/patch-1
Updated accessing a single prop's value
2020-02-13 21:49:25 +11:00
Mercedes
d55d4f9fc8
Updated accessing a single prop's value
Instead of `.props('name')`, use `.prop('name')` to access a single prop's value for testing
2020-02-12 13:06:28 -06:00
Gaëtan PRIOUR
2d70df1fbb Add tmux shortcut to show pane numbers 2020-02-12 15:20:02 +01:00
Jap
a0e23ed4f4
Update moment.md
Separated the format function to avoid confusion. Old syntax made it look like these functions could be chained.
2020-02-12 10:56:48 +01:00
Ethereum77
a4e0b6c7df Update emmet.md 2020-02-08 10:38:24 +03:00
Genji
e5fbc750ff
Update rollup.md 2020-01-29 16:43:22 +03:00
Rahul
0e9b7337ab
Update go.md
Added the usage of WaitGroup in go
2020-01-29 18:09:27 +05:30
Rico Sta. Cruz
48a96fd920
add uninstall command (#1322)
add uninstall command
2020-01-28 11:04:28 +11:00
Rico Sta. Cruz
ffdf83a45f
Update knex.md with seed docs. (#1328)
Update knex.md with seed docs.
2020-01-28 11:04:14 +11:00
Rico Sta. Cruz
30ca1950aa
bash: fix line reading example (#1336)
bash: fix line reading example
2020-01-28 11:02:45 +11:00
Matthew Pfeiffer
0b8a65c575 bash: fix line reading example
`< file.txt | cmd` only works in zsh, not bash (as of bash 5.0.11).
2020-01-24 21:07:10 -05:00
Rico Sta. Cruz
4704baedfa
Merge pull request #1323 from erok415/patch-2
Update git-branch.md
2020-01-20 16:16:15 +11:00
Rico Sta. Cruz
85ed8e15aa
Update git-branch.md 2020-01-20 16:15:41 +11:00
Rico Sta. Cruz
b81b7b73c9
Update git-branch.md 2020-01-20 16:15:24 +11:00
Rico Sta. Cruz
ada2e95afb
escape characters for string (#1324)
escape characters for string
2020-01-20 16:14:26 +11:00
Rico Sta. Cruz
08773a877a
Update git-branch.md (#1329)
Update git-branch.md
2020-01-20 16:14:10 +11:00
Rico Sta. Cruz
ef74b689ef
Update git-branch.md 2020-01-20 16:13:57 +11:00
Rahul
fd9ccf25d5
Update git-branch.md
To delete a branch already pushed and merged with remote, use `git branch -d $branchname`
2020-01-17 12:51:18 +05:30
Vicente Canales
63bde1e309 add knex seed docs 2020-01-13 18:43:14 -03:00
Nicholas Chen
e815651821
escape characters for string
referenced string documentation here: https://docs.python.org/3.9/tutorial/introduction.html
2020-01-10 19:14:13 -05:00
Erik Cochran
eb2a0eabe1
Update git-branch.md 2020-01-09 18:45:50 -08:00
Nicholas Chen
caa7a045a9
add uninstall command 2020-01-09 14:41:11 -05:00
Filip Vanden Eynde
f2844aee9f
Update git-branch.md
to delete a remote branch, you have to add the parameter --delete

https://www.educative.io/edpresso/how-to-delete-remote-branches-in-git
2020-01-07 10:55:21 +01:00
sebrink
129d586ef6
Fixed tmux attach.
Was originally -s instead of -t, so it would not work.
2020-01-06 09:35:47 -05:00
John Ramsden
60a2de77fb
Use room and remove user from gitter room link 2020-01-05 17:29:13 -08:00
Rico Sta. Cruz
bc51528f1a
Merge pull request #1315 from yrammos/patch-1
Add schema for USE command.
2020-01-04 14:13:08 +11:00
Rico Sta. Cruz
b1155732aa
Merge pull request #1314 from nickycutesc/patch-9
brew search command
2020-01-04 14:12:53 +11:00
yrammos
86918eb0c1
Add schema for USE command. 2020-01-03 10:50:12 +02:00
Nicholas Chen
d472f10861
brew search command
add brew search command
2020-01-01 17:46:36 -05:00
Rico Sta. Cruz
71a59adbca
Merge pull request #1213 from mhienle/top-cheatsheet
Issue #767: Add top cheatsheet
2020-01-01 10:09:29 +11:00
Rico Sta. Cruz
e9ca32b14a
Update top.md 2020-01-01 10:09:22 +11:00
Rico Sta. Cruz
afda4c70dc
Update top.md 2020-01-01 10:08:59 +11:00
Rico Sta. Cruz
005789bb91
Merge pull request #1185 from Richard70NL/patch-1
OSX spotlight and system utils changes
2020-01-01 10:07:17 +11:00
Rico Sta. Cruz
e8acd9672d
Merge pull request #1224 from izzergh/feature/update-regexp
Add Lookahead and Lookbehind to regexp.md
2020-01-01 10:06:57 +11:00
Rico Sta. Cruz
46dd46edf1
Merge branch 'master' into feature/update-regexp 2020-01-01 10:06:49 +11:00
Rico Sta. Cruz
b3a27632df
Update regexp.md 2020-01-01 10:06:17 +11:00
Rico Sta. Cruz
fe34c4d738
Merge pull request #1235 from eheydrick/ec2
Add EC2 instance termination command
2020-01-01 10:05:44 +11:00
Rico Sta. Cruz
2906fc9c6e
Merge pull request #1238 from btandersen383/patch-1
Fix if regex match
2020-01-01 10:05:33 +11:00
Rico Sta. Cruz
7a8e661857
Merge pull request #1247 from thakkaryash94/patch-4
Added named volume in docker-compose.md
2020-01-01 10:03:05 +11:00
Rico Sta. Cruz
aa4bca1180
Merge pull request #1243 from thakkaryash94/patch-docker
Add argument --build-args in docker
2020-01-01 10:02:55 +11:00
Rico Sta. Cruz
b497f41d18
Merge pull request #1225 from Vanguard90/patch-2
Update obs. Enzyme methods 'getNode' & 'getNodes'
2020-01-01 10:00:08 +11:00
Rico Sta. Cruz
fbca147904
Update enzyme.md 2020-01-01 09:59:57 +11:00
Rico Sta. Cruz
6d9358a908
Merge pull request #1065 from bastianbowe2000/patch-2
Add docker logs instructions
2020-01-01 09:58:52 +11:00
Rico Sta. Cruz
0bc396c632
Merge pull request #986 from ilhan-mstf/feature/linux-disk-size
Adds disk space and disk usage commands to linux.
2020-01-01 09:58:33 +11:00
Rico Sta. Cruz
caa337d5ea
Update linux.md 2020-01-01 09:58:25 +11:00
Rico Sta. Cruz
19d2158efb
Merge pull request #1305 from bourhaouta/patch-2
Update vue.md
2020-01-01 09:55:58 +11:00
Rico Sta. Cruz
c3a4bd411b
Merge pull request #1307 from NoobTW/master
Add some common tmux commands for window
2020-01-01 09:55:19 +11:00
Rico Sta. Cruz
d5b83196c3
Merge pull request #1311 from SyberToto/patch-1
Fix typo of Hyphenated ranges
2020-01-01 09:55:06 +11:00
SyberToto
039979de41
Fix typo of Hyphenated ranges
Fix typo of Hyphenated ranges
2019-12-31 13:12:00 -05:00
Noob Tsai
5e41424a3e
add some common tmux commands 2019-12-29 11:34:23 +08:00
Rico Sta. Cruz
a3bc51825a
makefile: Add more links (#1306) 2019-12-28 11:27:37 +11:00
bourhaouta
cbac026d47 Uncomment updated 2019-12-26 15:49:01 +01:00
bourhaouta
2211c7f3ec Update vue.md 2019-12-26 15:44:39 +01:00
Rico Sta. Cruz
b74da3ccd0
Merge pull request #1252 from kolapsys/master
Update 'Anchors' in regexp basic cheatsheets
2019-12-25 19:10:53 +11:00
Rico Sta. Cruz
1d4e572260
Merge branch 'master' into master 2019-12-25 19:10:46 +11:00
Rico Sta. Cruz
04b1d6212e
Merge pull request #1303 from rstacruz/chore-add-slack-notifications
Add Slack notifications to Travis config
2019-12-25 19:09:31 +11:00
Rico Sta. Cruz
8f73df1d15
Merge pull request #1302 from nickycutesc/patch-8
brew doctor
2019-12-25 19:08:49 +11:00
Rico Sta. Cruz
2aaf864757
Update rebase workflow 2019-12-25 19:07:51 +11:00
Rico Sta. Cruz
31351e989c
Add Slack notifications to Travis config 2019-12-25 19:03:22 +11:00
Nicholas Chen
6c461dbb7c
brew doctor
Mention brew doctor as a common and useful brew command
2019-12-24 22:57:17 -05:00
Rico Sta. Cruz
c9d091c264
Merge pull request #1196 from hjJunior/patch-1
Fix unexpected quotes closing
2019-12-24 22:10:50 +11:00
Rico Sta. Cruz
09ddca4962
Merge pull request #509 from henriquegdantas/patch-2
Improved superagent.md with more properties
2019-12-24 22:09:49 +11:00
Rico Sta. Cruz
7010476b4f
Merge pull request #1234 from ashur1k/patch-1
Update regexp.md
2019-12-24 22:07:42 +11:00
Rico Sta. Cruz
055c3c795d
Merge pull request #1258 from sombriks/patch-1
fix tmux pane creations
2019-12-24 22:07:22 +11:00
Rico Sta. Cruz
743ac3ab20
Merge pull request #1242 from thakkaryash94/patch-1
Add ARG syntax in dockerfile.md
2019-12-24 22:07:01 +11:00
Rico Sta. Cruz
6f0d6e5160
Merge pull request #1249 from setiawanjeje/md/css
update css cheatsheet
2019-12-24 22:06:17 +11:00
Rico Sta. Cruz
24f7cc6197
Update css.md 2019-12-24 22:06:00 +11:00
Rico Sta. Cruz
3c5040facb
Update css.md 2019-12-24 22:04:39 +11:00
Rico Sta. Cruz
c6ee300406
Merge pull request #1260 from jojijacobk-forks/master
[Add] few more npm options to the cheatsheet
2019-12-24 22:03:57 +11:00
Rico Sta. Cruz
41ad26474e
Update npm.md 2019-12-24 22:03:49 +11:00
Rico Sta. Cruz
d6cfb7b9a4
Merge pull request #1301 from bourhaouta/patch-1
Update enzyme.md
2019-12-24 22:02:25 +11:00
Omar Bourhaouta
c9cde14fef
Update enzyme.md 2019-12-24 10:43:42 +01:00
Rico Sta. Cruz
b78de6b210
Merge pull request #1094 from benjamin-guibert/patch-1
Replace has_many deprecated ordering
2019-12-18 13:44:09 +11:00
Rico Sta. Cruz
0527273f27
Merge pull request #1088 from dremex/patch-1
Fix broken link for Stencil
2019-12-18 13:43:57 +11:00
Rico Sta. Cruz
e3f165a90b
Merge pull request #1072 from telluz/patch-1
Update go.md
2019-12-18 13:43:43 +11:00
Rico Sta. Cruz
13d7dd9e72
Merge pull request #1034 from broven/patch-1
add vim zt
2019-12-18 13:43:32 +11:00
Rico Sta. Cruz
d3ba69bbc5
Merge pull request #1006 from andyhunt-ici/patch-1
Update css-grid.md
2019-12-18 13:43:21 +11:00
Rico Sta. Cruz
9661eff7dc
Merge pull request #963 from chimit/patch-1
Fix indentation for Golang
2019-12-18 13:43:07 +11:00
Rico Sta. Cruz
3c90dc2117
Update python.md (#1281)
Update python.md
2019-12-18 13:41:39 +11:00
Rico Sta. Cruz
947d9c3135
Update formatting 2019-12-18 13:41:29 +11:00
Rico Sta. Cruz
4d4ae7bfc7
Merge pull request #1268 from whiskey/patch-1
Added aws configuration profile option
2019-12-18 13:38:53 +11:00
Rico Sta. Cruz
9aa5716f18
Add React Hooks (#1058)
Add React Hooks
2019-12-18 13:36:02 +11:00
Rico Sta. Cruz
b54a975c74
Fix tables for the hooks list 2019-12-18 13:34:15 +11:00
Rico Sta. Cruz
3176e8c706
Merge pull request #1126 from vinipsmaker/patch-1
[lua] Fix typo
2019-12-18 13:32:23 +11:00
Rico Sta. Cruz
4f3ef7db34
Update Vue's page template (#1279)
Update Vue's page template
2019-12-18 13:32:15 +11:00
Rico Sta. Cruz
b340d90631
Update vue.md 2019-12-18 13:32:07 +11:00
Rico Sta. Cruz
62b7da238b
Merge pull request #1083 from Brad-Christie/patch-1
MomentJS: Only 12 months for `Mo`.
2019-12-18 13:31:38 +11:00
Rico Sta. Cruz
5c30fa8f4a
Fix ports syntax (#1277)
Fix ports syntax
2019-12-18 13:31:08 +11:00
Rico Sta. Cruz
33581a946a
Merge pull request #1285 from behnam/patch-1
Update bash.md
2019-12-18 13:30:55 +11:00
Rico Sta. Cruz
997e7bc0e0
Merge pull request #1290 from jemise111/patch-1
Fix JSDoc function param with multiple types
2019-12-18 13:29:41 +11:00
Rico Sta. Cruz
eb78a6f5fe
gitpod: Cache 'bundle install' (#1298)
gitpod: Cache 'bundle install'
2019-12-18 13:26:19 +11:00
Kreyren
0aed72ece6 gitpod: Cache 'bundle install' 2019-12-14 18:48:26 +00:00
Rico Sta. Cruz
cb50928040
Merge pull request #1295 from RXT067/gitpod
gitpod: deploy
2019-12-14 17:01:36 +11:00
Rico Sta. Cruz
bf06214da9
Merge pull request #1023 from qoomon/master
add missing favicon
2019-12-14 17:00:46 +11:00
Kreyren
dcc12e5c00 gitpod: deploy
Disclaimer: i'm not gitpod staff i just like their product

Proposing to integrate gitpod with this repository which is online IDE based on Theia which allows contributors to open an online environment without the need to fetch deps on their local system.

This service is free for open-source repositories.

Example of the runtime:
https://gitpod.io/#https://github.com/RXT067/cheatsheets/tree/gitpod

Signed-off-by: Jacob Hrbek <kreyren@rixotstudio.cz>
2019-12-13 22:45:47 +00:00
Jesse Sessler
50271b5925
Fix function param with multiple types 2019-12-09 12:27:23 -05:00
Behnam Esfahbod ❄
f7a365b23d
Update bash.md
Use `shopt -s` for setting Bash-specific options.
2019-11-30 14:07:21 -08:00
Riadh Bch
d5623e46fb
Update python.md
Adding file managing cheatsheet
2019-11-24 18:19:00 +01:00
BosEriko
4d88c763ff update vue.md 2019-11-22 15:30:47 +08:00
David Gonzalez
ab73124b11
Fix ports syntax 2019-11-18 16:34:02 +01:00
Rico Sta. Cruz
1ed003c8f4 Merge pull request #1251 from eheydrick/docker 2019-11-17 18:09:51 +11:00
Rico Sta. Cruz
6a12e5827b Update formatting 2019-11-17 18:09:41 +11:00
eric
b6272988d4 Add docker run example 2019-11-17 18:09:41 +11:00
Rico Sta. Cruz
f402f171b7 Merge pull request #1244 from thakkaryash94/patch-3 2019-11-17 18:00:46 +11:00
Yash Thakkar
7d314b24a4 Add compose build args
Add compose build args. https://docs.docker.com/compose/compose-file/#args
2019-11-17 18:00:33 +11:00
Rico Sta. Cruz
4cdd05f9aa Merge pull request #1264 from kamil2079/patch-1 2019-11-17 17:58:43 +11:00
kamil2079
cdbdd559ca Update xpath.md 2019-11-17 17:58:24 +11:00
Rico Sta. Cruz
7813be2238 bash: Move examples to the bottom 2019-11-17 17:15:12 +11:00
Rico Sta. Cruz
c8b99a83ff Merge pull request #1273 from samtrion/patch-1 2019-11-17 17:01:19 +11:00
Rico Sta. Cruz
35b6899663 Update formatting 2019-11-17 17:01:11 +11:00
Martin Stühmer
1a17fe6148 Added match a single character that is not contained within the brackets. For example, [^abc]
Matches a single character that is not contained within the brackets. For example, [^abc] matches any character other than "a", "b", or "c". [^a-z] matches any single character that is not a lowercase letter from "a" to "z". Likewise, literal characters and ranges can be mixed.
2019-11-17 17:01:11 +11:00
Rico Sta. Cruz
5735718b7b Merge pull request #1200 from nickycutesc/patch-3 2019-11-17 16:52:36 +11:00
Nicholas Chen
746cbff8fe Remove Homebrew Cask Link
Remove the Homebrew Cask Link as it just redirects to https://brew.sh/ link.
2019-11-17 16:38:48 +11:00
Rico Sta. Cruz
08ee61d2a4
Merge pull request #1272 from SteamTank/patch-1
Added missing ')'
2019-11-17 16:37:58 +11:00
Rico Sta. Cruz
1333ccada0 Merge pull request #1218 from mtking2/find-cheatsheet 2019-11-17 16:34:54 +11:00
Rico Sta. Cruz
7e787c0a76 Add note about compatibility of mtime conditions 2019-11-17 16:31:53 +11:00
SteamTank
76dc2ef27d
Added missing ')'
Added missing ')' at the end of `fat arrow` example
2019-11-14 10:12:01 +01:00
Carsten Knoblich
14134685c7
Added aws configuration profile option
Using multiple aws credentials is a very common scenario, so hinting to the `--profile` option is highly encouraged.
2019-11-12 12:57:07 +01:00
Joji Jacob
66b3324759
Merge pull request #1 from jojijacobk/jojijacobk-patch-1
Update npm.md
2019-11-04 17:34:58 +05:30
Joji Jacob
27d8585107
Update npm.md
Add few more npm options
2019-11-04 17:34:08 +05:30
Leonardo Silveira
58f0dad61d
fix tmux pane creations
tried on fedora 30 and mac os mojave (tmux from brew), horizontal pane are **C-b "** and vertical pane are **C-b %**
2019-10-30 22:22:04 -03:00
glaze
1d4bca0e19
fix docker bug 2019-10-29 12:15:28 -07:00
kolapsys
b7510ac455 Update 'Anchors' in regexp basic cheatsheets 2019-10-24 15:28:41 +03:00
jessica
31fa66ce5d update css md 2019-10-22 22:24:51 +07:00
Yash Thakkar
70f39563b4
Added named volume in docker-compose.md
More info. https://docs.docker.com/compose/compose-file/#volumes
2019-10-21 22:59:47 +05:30
Yash Thakkar
86b951267b
Add argument --build-args in docker
Add --build-args argument in docker CLI. https://docs.docker.com/engine/reference/commandline/build/#set-build-time-variables---build-arg
2019-10-20 12:31:36 +05:30
Yash Thakkar
5c0d96cbf4
Add ARG syntax in dockerfile.md
Add ARG syntax in dockerfile. https://docs.docker.com/engine/reference/builder/#arg
2019-10-20 12:08:13 +05:30
Beathan Andersen
c5006cfd4f
fix if regex match
The regex string should not have any quotes around it. To validate test:
$ if [[ "A" =~ . ]]; then echo pass; else echo fail; fi
with and without quotes
2019-10-16 13:52:50 -05:00
is
0c740038e2 Revert "Yarn's js updates"
This reverts commit e2d29e30a4d0075d54faf8186b144470b0d323e2.
2019-10-15 07:54:12 -04:00
Rico Sta. Cruz
4da6b9adbe
Merge pull request #1212 from cjmling/patch-1
Add typedef shorthand in jsdoc
2019-10-15 20:31:31 +11:00
Rico Sta. Cruz
1de147b430
Merge pull request #1211 from wowawiwa/patch-3
Add `yarn init` to equivalences.
2019-10-15 20:31:13 +11:00
Rico Sta. Cruz
46d700336f
Merge pull request #1220 from mtking2/bash-cheatsheet
Update bash.md
2019-10-15 20:30:10 +11:00
Rico Sta. Cruz
7bc7228728
Fix extra fences 2019-10-15 20:30:00 +11:00
Rico Sta. Cruz
23274c85e9
Merge pull request #1219 from amiraliakbari/patch-1
Corrected links to Ansible documentation
2019-10-15 20:29:12 +11:00
Rico Sta. Cruz
5f56569a11
Merge pull request #1227 from Roei-Bracha/patch-1
add some clean up commends
2019-10-15 20:27:51 +11:00
Rico Sta. Cruz
8820f58f31
Update docker.md 2019-10-15 20:27:06 +11:00
Rico Sta. Cruz
25a2090a84
Merge pull request #1231 from eheydrick/master
Update chef hints to be more modern
2019-10-15 20:24:42 +11:00
Rico Sta. Cruz
df11d9ed8b
Update regexp.md 2019-10-15 20:24:15 +11:00
eric
9f66c5d998 Add EC2 instance termination command 2019-10-14 23:04:26 -07:00
Mustafa İlhan
e21dcf1028
Merge branch 'master' into feature/linux-disk-size 2019-10-14 19:13:52 +02:00
ashur1k
41babf9c07
Update regexp.md
Added patterns of groups.
2019-10-14 11:27:55 +03:00
Eric Heydrick
a5490a0641 Update chef hints to be more modern 2019-10-09 12:44:58 -07:00
Roei
c44a075f78
add some clean up commends 2019-10-08 11:18:25 +03:00
Enes Kirimi
d5ee7731e6
Update obs. Enzyme methods 'getNode' & 'getNodes'
`getNode` and `getNodes` methods are depreciated and no longer in use. They are renamed to `getElement` and `getElements` instead. 

See Enzyme docs here: 
- https://airbnb.io/enzyme/docs/api/ShallowWrapper/getElement.html
- https://airbnb.io/enzyme/docs/api/ShallowWrapper/getElements.html
2019-10-05 11:50:03 +02:00
is
e2d29e30a4 Yarn's js updates 2019-10-04 22:01:32 -04:00
is
8769155f5e update regexp 2019-10-04 21:59:58 -04:00
Michael King
452c07e78a update metadata 2019-10-04 17:27:26 -04:00
Michael King
f1a7af534f update metadata 2019-10-04 17:26:14 -04:00
Michael King
8843c62e6d add the $0 special variable to bash.md 2019-10-02 11:27:23 -04:00
AmirAli Akbari
bbe2b8c20d
Corrected links to Ansible documentation
The external links for inventory and playbook where displaced and needed to be swapped.
2019-10-02 16:30:51 +03:30
Michael King
b879ad3316 add -atime, -ctime, and -mtime to find.md 2019-10-01 17:19:11 -04:00
Chandrajeet Maurya
a001fdcc00
Add typedef shorthand in jsdoc 2019-10-01 12:29:36 +07:00
Charles
1ac4600426
Add yarn init to equivalences. 2019-09-30 15:08:39 +02:00
Michael Hienle
e7b9a592b9 Issue #767: Add top cheatsheet 2019-09-28 11:03:50 +02:00
Rico Sta. Cruz
1e927dccfc Add GitHub workflow for auto-rebase 2019-09-25 19:03:47 +10:00
Rico Sta. Cruz
f3b1d593e8
Update travis configuration (#1210)
Update travis configuration
2019-09-25 18:54:22 +10:00
Rico Sta. Cruz
b0133fbe85
Publish frequently used Homebrew Cask commands (#1201)
Publish frequently used Homebrew Cask commands
2019-09-25 10:11:53 +10:00
Rico Sta. Cruz
ccd9127c52
Update homebrew.md 2019-09-25 10:11:33 +10:00
Rico Sta. Cruz
74ba88e2da
Merge pull request #1205 from herschel666/patch-1
Add "Begins with" attribute selector to CSS sheet
2019-09-25 10:10:37 +10:00
Rico Sta. Cruz
cfa6a1a08f Update travis configuration 2019-09-25 10:07:09 +10:00
Rico Sta. Cruz
bc68aeea82
Merge pull request #1206 from nickycutesc/patch-5
Updating printf functions
2019-09-25 10:05:22 +10:00
Rico Sta. Cruz
88c2807868
Merge pull request #1209 from 10sr/patch-1
Use https for EditorConfig URL
2019-09-25 10:04:57 +10:00
Rico Sta. Cruz
39a691de4e
Merge pull request #1207 from wowawiwa/patch-1
Fix typo
2019-09-25 10:03:28 +10:00
10sr
c5e46d65e9
Use https for EditorConfig URL 2019-09-25 00:35:57 +09:00
Charles
b9ba6a1ca7
Fix typo 2019-09-21 16:13:48 +02:00
Nicholas Chen
0655d01d62
Updating printf functions
Updating printf functions to print numbers and floats.
2019-09-18 21:41:04 -04:00
Emanuel Kluge
27be18e66b
Add "Begins with" attribute selector to CSS sheet 2019-09-18 15:01:33 +02:00
Nicholas Chen
f2f6cafab6
Publish frequently used Homebrew Cask commands
Publish frequently used Homebrew Cask commands which I have found useful.
2019-09-16 21:54:09 -04:00
Helio S. Junior
f4070993d6
Fix unexpected quotes closing 2019-09-12 13:36:31 -03:00
Rico Sta. Cruz
c353827bc4
Merge pull request #1166 from wreckah/patch-1
Add promised type
2019-09-01 16:33:11 +10:00
Rico Sta. Cruz
013be6f383
Merge pull request #1182 from smoralesjr/patch-1
Fixing typos "tamplate" -> "template"
2019-09-01 16:32:43 +10:00
Rico Sta. Cruz
7c933b55be
Merge pull request #1188 from gkubisa/patch-1
Fix "and" operator in lua.md
2019-09-01 16:32:16 +10:00
Rico Sta. Cruz
c98bbd5b7d
Merge pull request #1165 from osiyuk/master
useful rsync options
2019-09-01 16:31:52 +10:00
Rico Sta. Cruz
daed05eac0
Merge pull request #1173 from vsilverman/patch-1
Updated python.md
2019-09-01 16:31:21 +10:00
Rico Sta. Cruz
c2d101f521
Merge pull request #1180 from l3satwik/patch-1
Update rollup.md
2019-09-01 16:30:10 +10:00
Greg Kubisa
6710ba8dc7
Fix "and" operator in lua.md 2019-08-30 08:39:08 +02:00
Richard
f58b48c931
additional changes to spotlight indexing 2019-08-27 15:22:59 +02:00
Richard
462e38c332
Update on spotlight indexing and system utils
- /etc/hostconfig is no longer supported since Yosemite.
- removed the s from `mdutils` and `tmutils`
2019-08-26 16:17:10 +02:00
Samuel Morales, Jr
6a8b3e2174
Fixing typos "tamplate" -> "template"
I noticed three areas where the guide had the misspelling "tamplate."
2019-08-23 18:05:59 -04:00
Satwik Gupta
29de4b74d0
Update rollup.md 2019-08-22 17:15:19 +05:30
Saul Mestanza
7957c3bee4
Update phoenix-migrations.md 2019-08-15 16:19:56 -05:00
Vlad Silverman
2175c6275c
Updated python.md
Provided correct description for list elements replacement
2019-08-12 15:41:46 -07:00
Alexander Perlamutrov
27714bd874
Add promised type
https://github.com/jsdoc/jsdoc/issues/1197
2019-08-06 13:53:26 +03:00
osiyuk
9657713dde
rsync bwlimit option
useful for downloading from small and weak hosting
2019-08-05 21:28:26 +03:00
osiyuk
00a0c399cf
rsync stats option
very useful if you use -a option with large directories
2019-08-05 21:23:45 +03:00
A1RO
331b30e13f
Swap "Previous/next end of word" shortcuts 2019-08-03 16:48:18 -04:00
ZhdanovMV
55d018bc87
Update phoenix-migrations.md 2019-08-03 21:57:44 +02:00
Rico Sta. Cruz
090d42f103
Create new API category (#1123) 2019-07-07 20:55:30 +10:00
Rico Sta. Cruz
3c76e512a6
Merge pull request #1136 from xvazquezc/patch-2
upper/lowercase manipulation
2019-07-06 01:42:46 +10:00
xvazquezc
b3e81e0da9
upper/lowercase manipulation 2019-07-05 15:30:00 +10:00
Vinícius dos Santos Oliveira
5bb0b19505
[lua] Fix typo 2019-06-22 13:48:42 -03:00
Daniel Saavedra
8d5a749df3
Fix Typo 2019-06-07 21:16:14 -06:00
Benjamin Guibert
8662fd4d3d
Replace has_many deprecated ordering 2019-05-17 17:21:58 +02:00
Kerry Peterson
87b52d5186
Fix broken link for Stencil 2019-05-08 00:37:31 -04:00
Brad Christie
b21150deeb
Only 12 months. 2019-05-01 22:17:51 -04:00
telluz
e2d9dc7772
Update go.md
Lazy input with defer, independent of where where its defined in codeland
2019-04-17 14:08:33 +02:00
bastianbowe2000
665406da15
Add docker logs instructions 2019-04-10 14:06:35 +02:00
James
303813e74a Added React Hooks 2019-04-04 11:22:04 +11:00
Ahmedur Rahman Shovon
c706d50ca4
updated git-branch.md
- Added branch listing
- Added branch deleting
2019-03-28 11:24:55 +06:00
Rico Sta. Cruz
fc41560d71
Merge pull request #1052 from rstacruz/fix/old-styles
Fix styles for older pages
2019-03-27 20:02:17 +08:00
Rico Sta. Cruz
fd64f68d80
Fix sass extentsion 2019-03-27 19:38:24 +08:00
Rico Sta. Cruz
aed89335d9
Make 'missing jekyll' a warning instead 2019-03-27 19:22:13 +08:00
Rico Sta. Cruz
c0835bcb29
Check for presence of Jekyll before proceeding 2019-03-27 19:17:17 +08:00
Rico Sta. Cruz
3957e0f973
Add old /til/ styles 2019-03-27 19:14:40 +08:00
Rico Sta. Cruz
e05517f9f7
Show warning when binfiles aren't available 2019-03-27 19:14:34 +08:00
Rico Sta. Cruz
fa039e5b65
Merge pull request #994 from yuklia/docs/linux
Linux commands
2019-03-24 07:43:51 +08:00
Rico Sta. Cruz
a18063bb9a
Update linux.md 2019-03-24 07:43:41 +08:00
Rico Sta. Cruz
7f7e899014
Merge branch 'pr-974' 2019-03-24 07:40:26 +08:00
Rico Sta. Cruz
f79ab86a2c
regexp: Update formatting 2019-03-24 07:38:52 +08:00
Rico Sta. Cruz
aaa1f64e65
Merge branch 'pr-975' 2019-03-24 07:35:57 +08:00
Rico Sta. Cruz
61dd655951
Merge branch 'pr-982' 2019-03-24 07:34:55 +08:00
Rico Sta. Cruz
94db676cfe
jsdoc: Note that importing is TypeScript-specific 2019-03-24 07:34:48 +08:00
Rico Sta. Cruz
a328be7419
Merge branch 'pr-980' 2019-03-24 07:31:08 +08:00
Rico Sta. Cruz
a6cc2eade2
Update bash.md timestamp 2019-03-23 22:32:39 +08:00
Rico Sta. Cruz
34839f27d8
Merge branch 'pr-998' 2019-03-23 22:26:48 +08:00
Rico Sta. Cruz
8ea2be4731
Update formatting 2019-03-23 22:26:44 +08:00
Rico Sta. Cruz
15ec89d069
Merge branch 'pr-1019' 2019-03-23 22:13:19 +08:00
Rico Sta. Cruz
2349f623c2
Fix formatting 2019-03-23 22:10:27 +08:00
metaJS
dfce59b09f
update: vim zt 2019-03-09 15:33:31 +08:00
Bengt Brodersen
327932b685
add favicon 2019-02-28 10:35:40 +01:00
Gabriel Petry
57c49cd8aa
add c-like for loop 2019-02-22 07:30:15 -03:00
Andy Hunt
376563ba4b
Update css-grid.md
Line 42 -  grid-tamplate-areas to grid-template-areas
2019-02-05 13:16:48 -05:00
Rico Sta. Cruz
fa16f8134c
Update CodeFund snippet 2019-01-23 14:46:18 +08:00
Edson Ticona
69f50888f4 Adds associative array usage 2019-01-20 13:18:13 +01:00
Rico Sta. Cruz
a930009433
Merge pull request #991 from chandsie/patch-1
Correct description of ":=" and "=" operators
2019-01-20 14:49:25 +08:00
Rico Sta. Cruz
4c2bdaa050
Update makefile.md 2019-01-20 14:49:16 +08:00
Rico Sta. Cruz
2d565ceec4
Merge pull request #997 from rstacruz/rstacruz/2019-01-20-codefund-update
Update Docker setup and sponsor code
2019-01-20 14:46:32 +08:00
Rico Sta. Cruz
9ce285d9ac
Prettier config 2019-01-20 14:19:08 +08:00
Rico Sta. Cruz
b9ab467545
Update CodeFund snippet 2019-01-20 14:15:29 +08:00
Rico Sta. Cruz
2dea4f4c8e
Update critical path CSS 2019-01-20 14:12:28 +08:00
Rico Sta. Cruz
07d6304a0f
Update Docker setup with new Node, Yarn, etc 2019-01-20 14:11:35 +08:00
Rico Sta. Cruz
11b4c983a1
Remove trace of old sponsor code 2019-01-20 13:59:01 +08:00
Yulia Kostrikova
3b758480db Linux commands 2019-01-17 21:45:56 +02:00
Shreyas Chand
f2583a9960
Correct description of ":=" and "=" operators
The description of the ":=" and "=" assignment operators were flipped. As documented in the GNU make manual (https://www.gnu.org/software/make/manual/make.html#Reading-Makefiles), the ":=" assignment operatory is the immediate assignment operation and "=" is the deferred assignment operation. This change switches the descriptions to correspond to the correct operator and augments the description to clarify the behaviour.
2019-01-15 22:59:49 -08:00
Mustafa İlhan
57540e6d64 Seperates disk usage 2019-01-12 21:43:58 +03:00
Mustafa İlhan
d184261ab0 Adds disk space commands to linux. 2019-01-12 21:36:17 +03:00
Ben
fa9f16c5ee
Update jsdoc.md
Add a section demonstrating how to import types from typescript libraries.
2019-01-10 08:33:55 -06:00
Will Ware
a75bec82da
"not digit" => "d" is upper case? 2019-01-08 12:05:23 -05:00
David Winterstein
4f0fb36e6d
regexp.md - add {,x} character class 2019-01-04 14:49:58 +01:00
Dien Luong
eccede41ed
jsdoc.md: Fixed Types table
Escape the '|' in the "Multiple types" row.
2019-01-02 11:21:33 -05:00
Rico Sta. Cruz
79f35133f0
Merge pull request #956 from bhargavgv/patch-1
Add AppleScript "delay" command
2018-12-29 14:22:16 +08:00
Rico Sta. Cruz
b2b544e9bd
Merge pull request #968 from rstacruz/mysql-formatting
mysql: Update formatting
2018-12-29 14:20:57 +08:00
Rico Sta. Cruz
4588c31ee9
Merge pull request #969 from rstacruz/rstacruz-patch-1
rest-api: Update formatting
2018-12-29 14:20:29 +08:00
Rico Sta. Cruz
945942faa3
Merge pull request #970 from freezeeedos/patch-1
Copy password to clipboard
2018-12-29 14:20:05 +08:00
Quentin Gibert
4d3077222d
Copy password to clipboard 2018-12-25 17:38:58 +01:00
Rico Sta. Cruz
c65dc4811d
Merge pull request #634 from moviuro/patch-1
Update bash.md
2018-12-25 20:39:07 +08:00
Rico Sta. Cruz
7406b2bc71
Merge pull request #964 from lucywyman/add-puppet-bolt
Create bolt.md for puppet-bolt
2018-12-25 20:38:44 +08:00
Rico Sta. Cruz
4eacb18b60
Merge pull request #952 from hrvoj3e/patch-1
slicing from right
2018-12-25 20:34:48 +08:00
Rico Sta. Cruz
79384c2e24
bash: Update timestamp 2018-12-25 20:34:40 +08:00
Rico Sta. Cruz
d1a15b33d9
Merge pull request #960 from hanoii/composer
Improving composer cheatsheet
2018-12-25 20:34:00 +08:00
Rico Sta. Cruz
996e1829a1
Merge pull request #954 from vastpeng/cheatsheet/scp
add(cheatsheet): scp
2018-12-25 20:32:55 +08:00
Rico Sta. Cruz
11a00de0db
bolt: Add attribution 2018-12-25 20:31:39 +08:00
Rico Sta. Cruz
37a0cf7d5e
rest-api: Update formatting 2018-12-25 20:30:10 +08:00
Rico Sta. Cruz
5d99c3619f
scp: Update timestamp 2018-12-25 20:28:54 +08:00
Rico Sta. Cruz
7d2217779a
scp: Fix wrong layout 2018-12-25 20:28:06 +08:00
Rico Sta. Cruz
08d176e787
scp: Update formatting 2018-12-25 20:27:52 +08:00
Rico Sta. Cruz
28fac2ae2a
mysql: Update formatting 2018-12-25 20:25:48 +08:00
Rico Sta. Cruz
0e64b13d77
Merge pull request #698 from senyaak/master
Update typescript.md
2018-12-25 20:24:57 +08:00
Moviuro
0b74fe127d
Merge branch 'master' into patch-1 2018-12-20 11:39:41 +01:00
Lucy Wyman
dc74c2b5ea
Create bolt.md for puppet-bolt tool
This adds a cheatsheet for [bolt](https://github.com/puppetlabs/bolt)
2018-12-17 21:18:58 -08:00
Chimit
5cff5267ab
Fix indentation 2018-12-16 13:26:44 +08:00
Ariel Barreiro
938b9d00b1 Improving composer cheatsheet 2018-12-11 13:53:39 -03:00
Ian Zabel
b922942c55 Fix "Factory Girl" category (#820)
It was incorrectly categorized as a JavaScript library, but it was meant to be a Ruby library
2018-12-06 16:03:57 -07:00
chad d
16ab1ceb31 Emmet cleanup 2018-12-06 15:46:04 -07:00
danieljauch
c695eb7add Added Emmet cheatsheet (#737)
* Added Emmet cheatsheet

* Oops, forgot prism_lanugages property
2018-12-06 15:40:38 -07:00
chad d
d77bc9e67a Rebuild 2018-12-06 15:39:02 -07:00
danieljauch
34009ee911 Added new Haml cheatsheet. Includes Ruby injection with some examples of variable declaration and output. (#736) 2018-12-06 15:36:12 -07:00
chad d
639085251c Vim-diff cleanup 2018-12-06 15:33:10 -07:00
Ali Karbassi
f871d96e3b Beginning of vimdiff (#218) 2018-12-06 15:30:27 -07:00
chad d
066d825b91 Goby cleanup 2018-12-06 15:29:30 -07:00
Shozo Hatta
db405af253 Apply feedback (#487) 2018-12-06 15:23:31 -07:00
chad d
26c6ed30ad Regexp cleanup 2018-12-06 15:19:55 -07:00
Rizqy Hidayat
15f8649fd9 Update regexp basic cheatsheets (#906) 2018-12-06 15:17:16 -07:00
chad d
b46a977600 Categorizing 2018-12-06 15:15:40 -07:00
Adam McNeilly
04ea319247 Added Kotlin cheatsheet. (#724) 2018-12-06 14:48:31 -07:00
chad d
dccb59103e Adding C-like category and C# cleanup 2018-12-06 14:40:34 -07:00
chad d
de5f5a4f2b Merge branch 'master' of github.com:rstacruz/cheatsheets 2018-12-06 14:26:49 -07:00
Akram Shaari
2f7fcbe089 Add C# 7 (#200)
* Added C# 7

* Some changes to Tuple Deconstruction section
2018-12-06 14:26:16 -07:00
chad d
fdad334b45 CSS grid updated date 2018-12-06 14:23:22 -07:00
danieljauch
e722384011 Feature/new cheatsheet css grid (#738)
* Started grid file. Looking at weight properties

* Finished compiling cheatsheet from Malven's site and CSS Tricks
2018-12-06 14:15:01 -07:00
Bhargav GV
37a09ba016
Add AppleScript "delay" command 2018-12-06 15:35:34 -05:00
Vast
fd17d3f1b6 add(cheatsheet): scp 2018-12-06 09:59:38 +08:00
hrvoj3e
8365f5e761
slicing from right 2018-12-02 11:37:15 +01:00
Arsenij Schützer
c2e9c8fc36 Update typescript.md 2018-07-31 17:24:26 +02:00
Moviuro
194bd28bf9
Update bash.md
`[` use is made obsolete by `[[` (which should be used only for bash scripts).
Add examples with commands conditionals (if ping ...; then...)
Add link to shellcheck + mywiki.wooledge.org
2018-07-23 15:34:18 +02:00
henriquegdantas
76b013411a
Improved superagent.md with more properties
- Better identation
- Markdown with correct syntax highlighting
- Comment for every property
- Added more properties (with examples)
2018-04-21 09:37:49 -03:00
642 changed files with 21735 additions and 15429 deletions

View File

@ -1,10 +0,0 @@
{
"presets": [
[
"env",
{
"forceAllTransforms": true
}
]
]
}

View File

@ -1 +0,0 @@
node_modules

37
.eslintrc.cjs Normal file
View File

@ -0,0 +1,37 @@
/* eslint-env node */
module.exports = {
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:astro/recommended',
'prettier'
],
env: {
browser: true // enables window, document, etc
},
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint'],
root: true,
ignorePatterns: ['dist/**'],
overrides: [
{
files: ['*.test.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off'
}
},
{
files: ['*.astro'],
parser: 'astro-eslint-parser',
parserOptions: {
parser: '@typescript-eslint/parser',
extraFileExtensions: ['.astro']
}
// rules: {
// override/add rules settings here, such as:
// "astro/no-set-html-directive": "error"
// },
}
]
}

BIN
.github/images/gitpod_preview_tut.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 504 KiB

View File

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

39
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Run tests
on:
push:
branches: [main, master]
pull_request:
branches: [main, master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
- uses: actions/setup-node@v4
with:
node-version-file: .node-version
- uses: pnpm/action-setup@v3
with: { run_install: false }
# https://github.com/pnpm/action-setup?tab=readme-ov-file#use-cache-to-reduce-installation-time
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v4
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install playwright browsers
run: pnpm playwright install --with-deps chromium
- name: Run tests
run: pnpm run ci

31
.gitignore vendored
View File

@ -1,5 +1,26 @@
_output
_site
.jekyll-metadata
/node_modules
/vendor
# build output
dist/
# generated types
.astro/
# dependencies
node_modules/
# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
# environment variables
.env
.env.production
# macOS-specific files
.DS_Store
.cache
# playwright
test-results

1
.node-version Normal file
View File

@ -0,0 +1 @@
20.11.1

6
.prettierignore Normal file
View File

@ -0,0 +1,6 @@
src/sass/vendor
vendor
.cache
dist
*.md
pnpm-lock.yaml

6
.prettierrc Normal file
View File

@ -0,0 +1,6 @@
{
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"plugins": ["prettier-plugin-astro"]
}

View File

@ -1,13 +0,0 @@
{
"*.md": {
"type": "cheat",
"template": [
"---",
"title: {basename|capitalize}",
"category: Ruby",
"layout: 2017/sheet",
"updated: DATE",
"---"
]
}
}

1
.ruby-version Normal file
View File

@ -0,0 +1 @@
3.2.2

View File

@ -1,10 +0,0 @@
language: ruby
rvm:
- 2.5.0
script:
- make -B _site
- if ! make test; then make test-warning; exit 16; fi
cache:
directories:
- node_modules
- _site

4
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode"],
"unwantedRecommendations": []
}

11
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}

8
.vscode/markdown.code-snippets vendored Normal file
View File

@ -0,0 +1,8 @@
{
"Test snip": {
"prefix": ["about"],
"body": "Copyright. Foo Corp 2028",
"description": "Adds copyright...",
"scope": "markdown"
}
}

1
101.md
View File

@ -1,7 +1,6 @@
---
title: 101
category: JavaScript libraries
layout: 2017/sheet
updated: 2017-09-21
intro: |
[101](https://www.npmjs.com/package/101) is a JavaScript library for dealing with immutable data in a functional manner.

View File

@ -1,5 +0,0 @@
---
layout: 2017/not_found
type: error
permalink: /404.html
---

1
CNAME
View File

@ -1 +0,0 @@
devhints.io

View File

@ -1,8 +1,29 @@
# Developer notes
## Runtimes
Requires Node.js, Ruby, Yarn v1.
See `.ruby-version` and `.node-version` for supported versions.
## Gitpod
This repository supports contribution using [gitpod](https://gitpod.io) which is online IDE using [Theia](https://github.com/eclipse-theia/theia).
To open-up the environment simple natigate on https://gitpod.io/#https://github.com/rstacruz/cheatsheets
Or using a button:<br>
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rstacruz/cheatsheets)
### Preview built website
To preview the website you need to first build it then you can navigate to file that you are trying to contribute and preview directly.
<img src='.github/images/gitpod_preview_tut.png' width=828 height=459/>
## Starting a local instance
This starts Jekyll and Webpack. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
This starts Jekyll and Parcel. This requires recent versions of [Node.js], [Yarn], [Ruby] and [Bundler] installed.
```bash
yarn install
@ -27,7 +48,7 @@ First time setup:
docker-compose build
# First-time setup
docker-compose run --rm web bundle install && yarn
docker-compose run --rm web bundle install && docker-compose run --rm web yarn install
```
Starting the server:
@ -42,9 +63,11 @@ See <https://devhints.io/cheatsheet-styles> for a reference on styling.
## JavaScript
When updating JavaScript, be sure webpack is running (`yarn run dev` takes care of this).
When updating JavaScript, be sure Parcel is running (`yarn dev` takes care of this).
This auto-updates `/assets/packed/` with sources in `_js/`.
This auto-updates `/assets/packed/` and `_includes/2017/critical/` with sources in `_parcel/`.
Before committing, run `yarn parcel:build` first.
## JavaScript tests
@ -61,16 +84,14 @@ Each sheet supports these metadata:
```yml
---
title: React.js
layout: 2017/sheet # 'default' | '2017/sheet'
# Optional:
category: React
updated: 2017-08-30 # To show in the updated list
ads: false # Add this to disable ads
weight: -5 # lower number = higher in related posts list
deprecated: true # Don't show in related posts
deprecated_by: /enzyme # Point to latest version
prism_languages: [vim] # Extra syntax highlighting
updated: 2020-06-14
ads: false # Add this to disable ads
weight: -5 # lower number = higher in related posts list
deprecated: true # Don't show in related posts
deprecated_by: /enzyme # Point to latest version
prism_languages: [vim] # Extra syntax highlighting
intro: |
This is some *Markdown* at the beginning of the article.
tags:
@ -79,9 +100,10 @@ tags:
# Special pages:
# (don't set these for cheatsheets)
type: home # home | article | error
og_type: website # opengraph type
type: home # home | article | error
og_type: website # opengraph type
---
```
## Prism languages
@ -101,6 +123,7 @@ title: ES2015
category: Hidden
redirect_to: /es6
---
```
## Localizations
@ -128,7 +151,7 @@ The site devhints.io is backed by CloudFlare. Updates will take 2 days to propag
There are multiple ways to set meta description.
### keywords (and intro)
### Keywords (and intro)
Set `keywords` (and optionally `intro`). This is the easiest and the preferred
way for now.
@ -141,7 +164,7 @@ React.Component · render() · componentDidMount() · props/state · React is a
JavaScript library for building web...
```
### description (and intro)
### Description (and intro)
Set `description` (and optionally `intro`)
@ -153,29 +176,6 @@ One-page reference to React and its API. React is a JavaScript library for
building web user interfaces...
```
### intro only
### Intro only
If you left out `description` or `keywords`, a default description will be added.
## Critical path CSS
The critical path CSS is stored in:
- `_includes/2017/critical/home.html`
- `_includes/2017/critical/sheet.html`
You'll need to update these every now and then when you change something in the CSS. Use this to update these snippets:
```
yarn run critical
```
You can temporarily disable critical path optimizations by loading it with `?nocrit=1`, eg, `https://devhints.io/?nocrit=1`.
## Critical path JS
There's JavaScript that's included inline in every page. It's entrypoint is:
- `_js/critical.js`
This is automatically compiled into the partial `_includes/2017/critical/critical.js`. Keep this bundle as small as possible.

View File

@ -1,9 +0,0 @@
FROM ruby:2.5.1-alpine3.7
RUN apk update && apk add --no-cache nodejs build-base
RUN apk add yarn --no-cache --repository http://dl-3.alpinelinux.org/alpine/v3.8/community/ --allow-untrusted
RUN mkdir -p /app
WORKDIR /app
# COPY Gemfile Gemfile.lock ./
# RUN bundle install -j 4
# COPY package.json yarn.lock ./
# RUN yarn

View File

@ -1,2 +1,4 @@
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
source "https://rubygems.org"
gem "minitest"
gem "kramdown"
gem "kramdown-parser-gfm"

View File

@ -1,216 +1,21 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.8)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.5.2)
public_suffix (>= 2.0.2, < 4.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.12.2)
colorator (1.1.0)
ethon (0.10.1)
ffi (>= 1.3.0)
execjs (2.7.0)
faraday (0.13.1)
multipart-post (>= 1.2, < 3)
ffi (1.9.18)
forwardable-extended (2.6.0)
gemoji (3.0.0)
github-pages (156)
activesupport (= 4.2.8)
github-pages-health-check (= 1.3.5)
jekyll (= 3.5.2)
jekyll-avatar (= 0.4.2)
jekyll-coffeescript (= 1.0.1)
jekyll-default-layout (= 0.1.4)
jekyll-feed (= 0.9.2)
jekyll-gist (= 1.4.1)
jekyll-github-metadata (= 2.8.0)
jekyll-mentions (= 1.2.0)
jekyll-optional-front-matter (= 0.2.0)
jekyll-paginate (= 1.1.0)
jekyll-readme-index (= 0.1.0)
jekyll-redirect-from (= 0.12.1)
jekyll-relative-links (= 0.4.1)
jekyll-sass-converter (= 1.5.0)
jekyll-seo-tag (= 2.3.0)
jekyll-sitemap (= 1.0.0)
jekyll-swiss (= 0.4.0)
jekyll-theme-architect (= 0.1.0)
jekyll-theme-cayman (= 0.1.0)
jekyll-theme-dinky (= 0.1.0)
jekyll-theme-hacker (= 0.1.0)
jekyll-theme-leap-day (= 0.1.0)
jekyll-theme-merlot (= 0.1.0)
jekyll-theme-midnight (= 0.1.0)
jekyll-theme-minimal (= 0.1.0)
jekyll-theme-modernist (= 0.1.0)
jekyll-theme-primer (= 0.5.0)
jekyll-theme-slate (= 0.1.0)
jekyll-theme-tactile (= 0.1.0)
jekyll-theme-time-machine (= 0.1.0)
jekyll-titles-from-headings (= 0.4.0)
jemoji (= 0.8.0)
kramdown (= 1.13.2)
liquid (= 4.0.0)
listen (= 3.0.6)
mercenary (~> 0.3)
minima (= 2.1.1)
rouge (= 1.11.1)
terminal-table (~> 1.4)
github-pages-health-check (1.3.5)
addressable (~> 2.3)
net-dns (~> 0.8)
octokit (~> 4.0)
public_suffix (~> 2.0)
typhoeus (~> 0.7)
html-pipeline (2.7.0)
activesupport (>= 2)
nokogiri (>= 1.4)
i18n (0.8.6)
jekyll (3.5.2)
addressable (~> 2.4)
colorator (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 4.0)
mercenary (~> 0.3.3)
pathutil (~> 0.9)
rouge (~> 1.7)
safe_yaml (~> 1.0)
jekyll-avatar (0.4.2)
jekyll (~> 3.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-default-layout (0.1.4)
jekyll (~> 3.0)
jekyll-feed (0.9.2)
jekyll (~> 3.3)
jekyll-gist (1.4.1)
octokit (~> 4.2)
jekyll-github-metadata (2.8.0)
jekyll (~> 3.1)
octokit (~> 4.0, != 4.4.0)
jekyll-mentions (1.2.0)
activesupport (~> 4.0)
html-pipeline (~> 2.3)
jekyll (~> 3.0)
jekyll-optional-front-matter (0.2.0)
jekyll (~> 3.0)
jekyll-paginate (1.1.0)
jekyll-readme-index (0.1.0)
jekyll (~> 3.0)
jekyll-redirect-from (0.12.1)
jekyll (~> 3.3)
jekyll-relative-links (0.4.1)
jekyll (~> 3.3)
jekyll-sass-converter (1.5.0)
sass (~> 3.4)
jekyll-seo-tag (2.3.0)
jekyll (~> 3.3)
jekyll-sitemap (1.0.0)
jekyll (~> 3.3)
jekyll-swiss (0.4.0)
jekyll-theme-architect (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-cayman (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-dinky (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-hacker (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-leap-day (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-merlot (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-midnight (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-minimal (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-modernist (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-primer (0.5.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.2)
jekyll-theme-slate (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-tactile (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-theme-time-machine (0.1.0)
jekyll (~> 3.5)
jekyll-seo-tag (~> 2.0)
jekyll-titles-from-headings (0.4.0)
jekyll (~> 3.3)
jekyll-watch (1.5.0)
listen (~> 3.0, < 3.1)
jemoji (0.8.0)
activesupport (~> 4.0)
gemoji (~> 3.0)
html-pipeline (~> 2.2)
jekyll (>= 3.0)
kramdown (1.13.2)
liquid (4.0.0)
listen (3.0.6)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9.7)
mercenary (0.3.6)
mini_portile2 (2.2.0)
minima (2.1.1)
jekyll (~> 3.3)
minitest (5.10.3)
multipart-post (2.0.0)
net-dns (0.8.0)
nokogiri (1.8.0)
mini_portile2 (~> 2.2.0)
octokit (4.7.0)
sawyer (~> 0.8.0, >= 0.5.3)
pathutil (0.14.0)
forwardable-extended (~> 2.6)
public_suffix (2.0.5)
rb-fsevent (0.10.2)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
rouge (1.11.1)
safe_yaml (1.0.4)
sass (3.5.1)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sawyer (0.8.1)
addressable (>= 2.3.5, < 2.6)
faraday (~> 0.8, < 1.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
thread_safe (0.3.6)
typhoeus (0.8.0)
ethon (>= 0.8.0)
tzinfo (1.2.3)
thread_safe (~> 0.1)
unicode-display_width (1.3.0)
kramdown (2.4.0)
rexml
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
minitest (5.18.0)
rexml (3.2.5)
PLATFORMS
ruby
aarch64-linux-android
x86_64-linux
DEPENDENCIES
github-pages
kramdown
kramdown-parser-gfm
minitest
BUNDLED WITH
1.11.2
2.4.1

View File

@ -1,45 +0,0 @@
npmbin := ./node_modules/.bin
PORT ?= 3000
HOST ?= 127.0.0.1
# Builds intermediate files. Needs a _site built first though
update: _site critical
# Builds _site
_site:
bundle exec jekyll build --incremental
# Builds critical path CSS/JS
critical: _site
node _support/critical.js
# Starts development server
dev:
$(npmbin)/concurrently -k -p command -c "blue,green" \
"make dev-webpack" \
"make dev-jekyll"
dev-webpack:
$(npmbin)/webpack --watch --colors -p
dev-jekyll:
if [ -f _site ]; then \
bundle exec jekyll serve --safe --trace --drafts --watch --incremental --host $(HOST) --port $(PORT); \
else \
bundle exec jekyll serve --safe --trace --drafts --watch --host $(HOST) --port $(PORT); \
fi
test: _site
@test -f _site/vim.html
@test -f _site/react.html
@test -f _site/index.html
@grep "<script src" _site/index.html >/dev/null
@grep "<script src" _site/vim.html >/dev/null
@grep "<script src" _site/react.html >/dev/null
test-warning:
@echo "========="
@echo "If your build failed at this point, it means"
@echo "the site failed to generate. Check the project"
@echo "out locally and try to find out why."
@echo "========="

View File

@ -1,13 +1,13 @@
# Devhints
<h1 align='center'>Devhints</h1>
> TL;DR for developer documentation - a ridiculous collection of cheatsheets
[![Status](https://travis-ci.org/rstacruz/cheatsheets.svg?branch=master)](https://travis-ci.org/rstacruz/cheatsheets "See test builds")
<blockquote align='center'>
TL;DR for developer documentation - a ridiculous collection of cheatsheets
</blockquote>
<br>
<p align='center'>
<a href='https://devhints.io/'><img src='_docs/images/screenshot.png' width=600></a>
<a href='https://devhints.io/'><img src='.github/images/screenshot.png' width=600></a>
<br>
<b><a href='https://devhints.io/'>devhints.io</a></b>
</p>
@ -17,3 +17,12 @@
---
See [CONTRIBUTING.md](CONTRIBUTING.md) for developer notes.
[![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/rstacruz/cheatsheets)
<h2 align='center'>Similar projects</h1>
- [Command Line Interface Pages](https://github.com/command-line-interface-pages)
- [tldr-pages](https://github.com/tldr-pages/tldr)
- [Cheat](https://github.com/cheat/cheat)
- [Eg](https://github.com/srsudar/eg)

View File

@ -1,61 +0,0 @@
# Jekyll configuration
whitelist:
- jekyll-redirect-from
- jekyll-github-metadata
plugins:
- jekyll-redirect-from
- jekyll-github-metadata
exclude:
- Makefile
- README.md
- CONTRIBUTING.md
- Gemfile
- Gemfile.lock
- CNAME
- vendor
- package.json
- .babelrc
- yarn.lock
- package-lock.json
- webpack.config.js
- node_modules
- Dockerfile
- docker_compose.yml
# Markdown
highlighter: false
markdown: kramdown
kramdown:
input: GFM
hard_wrap: false
parse_block_html: true
syntax_highlighter_opts:
disable: true
# Defaults
defaults:
- scope:
path: ""
type: pages
values:
layout: "default"
og_type: article
type: article
category: "Others"
excerpt_separator: "<!--more-->"
prism_languages: []
# Site info
url: https://devhints.io
title: Devhints.io cheatsheets
# GitHub metadata
# https://help.github.com/articles/repository-metadata-on-github-pages/
repository: rstacruz/cheatsheets

View File

@ -1,2 +0,0 @@
# No trailing slash
preview_host: https://assets.devhints.io/previews

View File

@ -1,4 +0,0 @@
enabled: false
token: "653d56e083fec2a9ae1b6c7cde4e5f5f"
title: "Rollbar"
description: "Real-time error monitoring, alerting, and analytics for developers 🚀"

View File

@ -1,2 +0,0 @@
enabled: false
src: //cdn.carbonads.com/carbon.js?zoneid=1673&serve=C6AILKT&placement=ricostacruzcom

View File

@ -1,27 +0,0 @@
enabled: true
names:
- Analytics
- Ansible
- Apps
- CLI
- CSS
- Databases
- Devops
- Elixir
- Git
- HTML
- JavaScript
- JavaScript libraries
- Jekyll
- Ledger
- Markup
- macOS
- Node.js
- PHP
- Rails
- React
- Ruby
- Ruby libraries
- Vim
- Fitness
- Others

View File

@ -1,2 +0,0 @@
enabled: true
token: "c2c8bc62-c275-4c7a-a304-74335c5a1cd0"

View File

@ -1,50 +0,0 @@
home:
title: "Rico's cheatsheets"
tagline: |
Hey! I'm <a href='https://ricostacruz.com'>@rstacruz</a> and this is a modest collection of cheatsheets I've written.
top_nav:
title: Devhints.io
edit: Edit
edit_on_github: Edit this page on GitHub
sheet:
suffix: cheatsheet
social_list:
default_description: "Ridiculous collection of web development cheatsheets"
description: "The ultimate cheatsheet for TITLE."
facebook_share: Share on Facebook
twitter_share: Share on Twitter
related_posts_callout:
description: Over SIZE curated cheatsheets, by developers for developers.
link: Devhints home
related_posts_group:
top: Top cheatsheets
other: Other cheatsheets
category: Other CATEGORY cheatsheets
search_form:
default_placeholder: Search SIZE+ cheatsheets
home_placeholder: Search...
prefix: devhints.io
comments_area:
suffix: for this cheatsheet.
link: "Write yours!"
not_found:
title: Not found
description: Sorry, we don't have a cheatsheet for this yet. Try searching!
home: Back to home
announcement:
id: 2017-10-26-twitter
title: |
New: We're on Twitter ♥️
body: |
Follow [@devhints](https://twitter.com/devhints) on Twitter for daily "today I learned" snippets!
[![](https://img.shields.io/twitter/follow/devhints.svg?style=social&label=@devhints)](https://twitter.com/devhints)

View File

@ -1,2 +0,0 @@
enabled: true
host: devhints.disqus.com

View File

@ -1,3 +0,0 @@
enabled: true
hostname: devhints.io
id: "UA-106902774-1"

View File

@ -1,81 +0,0 @@
---
title: Ansible
category: Ruby
---
## Looping
### Array (with_items)
```yaml
vars:
security_groups:
- name: 'hello'
desc: 'world'
- name: 'hola'
desc: 'mundo'
tasks:
- name: Create required security groups
ec2_group:
name: "{{ item.name }}"
description: "{{ item.desc }}"
with_items: "{{ security_groups }}"
```
### Object (with_dict)
```yaml
tasks:
- name: Print phone records
debug: msg="User {{ item.key }} is {{ item.value.name }} ({{ item.value.telephone }})"
with_dict: "{{ users }}"
```
## with_file
```yaml
- name: "Send key"
ec2_key:
key_material: "{{ item }}"
with_file: ./keys/sshkey.pub
# or
with_fileglob: ./keys/*.pub
```
### Conditionals
```yml
- include: setup-debian.yml
when: ansible_os_family == 'Debian'
when: (ansible_distribution == "CentOS" and ansible_distribution_major_version == "6") or
(ansible_distribution == "Debian" and ansible_distribution_major_version == "7")
# Just like "and"
when:
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "6"
```
## Expressions
```
{{ item }}
{{ item.name }}
{{ item[0].name }}
{{ item | default('latest') }}
```
## Includes
```
tasks:
- include: wordpress.yml
vars:
wp_user: timmy
```

View File

@ -1,78 +0,0 @@
# Installing
wget "http://kohanaphp.com/download?modules%5Bauth%5D=Auth&languages%5Ben_US%5D=en_US&format=zip" -O k.zip &&\
unzip -q k.zip && rm k.zip &&\
mv Kohana_*/* . && rm -rf Kohana_* &&\
rm -f "Kohana License.html" &&\
# htaccess
cat example.htaccess | sed 's/RewriteBase .*/RewriteBase \//g' > .htaccess && rm example.htaccess &&\
echo Done! Go and edit application/config/config.php and change the site stuff.
# Public HTML
mkdir -p public_html &&\
mv index.html public_html &&\
mv .htaccess public_html &&\
echo Done. Now edit index.html's paths
Git ignore
(echo \*.swo; echo \*.swp; echo .DS_Store; echo Thumbs.db; echo \*~; echo application/logs; echo application/cache ) > .gitignore &&\
# Database
$config['default'] = array
(
'benchmark' => TRUE,
'persistent' => FALSE,
'connection' => array
(
'type' => 'mysql',
'user' => 'leet', // set to db user name
'pass' => 'l33t', // set to db user password
'host' => 'localhost',
'port' => FALSE,
'socket' => FALSE,
'database' => 'leetdb' // set to db name
),
'character_set' => 'utf8',
'table_prefix' => '',
'object' => TRUE,
'cache' => FALSE,
'escape' => TRUE
);
// ORM model
class Post_Model extends ORM {
protected $has_one = array('user'); // has_many, belong_to, has_one, has_and_belongs_to_many
}
// ORM
$post = ORM::factory('post', 1);
$post->name = "Post name";
$post->save();
foreach ($post->categories as $category)
{
echo $category->name;
}
// Find (returns even if no row is found)
$o = ORM::factory('article')->find(1);
$o = ORM::factory('article')->where('title', $title)->find();
if (!$o->loaded) { die('Not found'); }
echo $o->title;
// Find_all
$o = ORM::factory('article')->find_all();
foreach ($o as $article) { echo $article->title; }
// ->$saved
// ->$changed[]
// ->$object_name (Blog_Post_Model => "blog_post")
// ->$primary_key ('id')
// ->$primary_val ('username') - more userfriendly identifier
// ->$table_name
// ->$ignored_columns = array('whatever')
// ->$table_columns = array('id', 'username')
// ->$sorting = array('last_login' => 'desc') -- default sorting
//

View File

@ -1,104 +0,0 @@
# Debug
logger.debug "xx"
# Controller stuff
class MyController < ApplicationController::Base
controller.response.body
# Filters
before_filter :require_login # Looks for require_login method
before_filter MyFilter # Looks for MyFilter class
before_filter { |ct| head(400) if ct.params["stop_action"] }
around_filter :catch_exceptions
after_filter :xx
layout "admin_area" # Looks for the view file
layout "admin_area", :except => [ :rss, :whatever ]
layout :foo # Looks for private function foo
private
def whatever ...
class MyFilter
def self.filter(controller, &block)
# Model
belongs_to :user
validates_presence_of :user
default_scope :order => 'id DESC'
named_scope :today, :conditions = "created_at x"
named_scope :today, lambda {{ :conditions = [ "created_at between ? and ?", 1.hour.ago.utc, 300.seconds.ago.utc ] }}
# Then you can call feed.today
# Controller methods
render :action => 'help', :layout => 'help'
render :text => 'so and so'
render :status => :created, :location => post_url(post) # With HTTP headers
redirect_to :action => 'index'
render :partial => 'product', :collection => @products, :as => :item, :spacer_template => "product_ruler"
return head(:method_not_allowed)
head :created, :location => '...'
url_for :controller => 'posts', :action => 'recent'
location = request.env["SERVER_ADDR"]
# For views
auto_discovery_link_tag(:rss, {:action => "feed"}, {:title => "RSS Feed"})
javascript_include_tag "foo"
stylesheet_link_tag
image_tag
# Ruby stuff!
# Defining a class method (not a typo)
Fixnum.instance_eval { def ten; 10; end }
Fixnum.ten # => 10
# Defining an instance method
Fixnum.class_eval { def number; self; end }
7.number #=> 7
# Multiple arguments, send()
class Klass
def hello(*args); "Hello " + args.join(' '); end
end
Klass.new.send :hello, "gentle", "readers"
def can(*args)
yield if can?(*args)
end
# can(x) {...} => if can?(x) {...}
# Struct
class Foo < Struct.new(:name, :email)
end
j = Foo.new("Jason", "jason@bateman.com")
j.name = "Hi"
print j.name
# Struct
class Foo < Struct.new(:name, :email)
end
j = Foo.new("Jason", "jason@bateman.com")
j.name = "Hi"
print j.name
# Method missing
def method_missing(method_name, *arguments)
if method_name.to_s[-1,1] == "?"
self == method_name.to_s[0..-2]
# Rails logger
Rails.logger.info("...")
# To string
:hello_there.to_s

View File

@ -1,7 +0,0 @@
---
title: Cinema4d
category: Apps
---
E R T : Move/rotate/scale
P : snapping

View File

@ -1,56 +0,0 @@
---
title: Compass sprites
---
### Compass: Sprites
@import compass/utilities/sprites
$sprites: sprite-map('sprites/*.png')
$sprites: sprite-map('sprites/*.png', $spacing: 20px)
@mixin sprite($name)
background-image: sprite-url($sprite)
+sprite-dimensions($sprite, $name)
width: image-width(sprite-file($sprite, $name)
height: image-height(sprite-file($sprite, $name)
+sprite-background-position($sprite, $name[, $offset-x, $offset-y])
background-position: sprite-position($sprite, $name)
nth(sprite-position($sprite, $name), 1) # X position
nth(sprite-position($sprite, $name), 2) # Y position
### Compass: Sprites (the @import way)
// Sprite sets (applies to icon/*.png)
$icon-spacing: 0
$icon-dimensions: true
$icon-repeat: no-repeat
$icon-position: 0
// Individual (applies to icon/mail.png)
$icon-mail-spacing: 0
@import 'icon/*.png'
@include all-icon-sprites
// Usage
.image1
@extend .icon-mail
.image2
@extend .icon-refresh;
// ### Advanced control
// The sprite map is available as $icon-sprites. You can then use
// `sprite()` on it.
.image3
background: sprite($icon-sprites, refresh)
//background: url(...) 0 -16px;
.image3-with-offset
background: sprite($icon-sprites, refresh, -2px, -9px)
//background: url(...) -2px -19px;

View File

@ -1,43 +0,0 @@
---
title: Docker on OSX
category: Devops
---
You'll need these:
* [boot2docker] - bootstraps a Virtualbox VM to run a docker daemon
* [docker] - docker client
### Install
$ brew install boot2docker
$ brew install docker
$ boot2docker init
### Turning on
$ boot2docker start
Waiting for VM to be started...... Started.
To connect the Docker client to the Docker daemon, please set:
export DOCKER_HOST=tcp://192.168.59.103:2375
$ export DOCKER_HOST=tcp://192.168.59.103:2375
### Try it
$ docker search ubuntu
$ docker pull ubuntu
$ docker start ubuntu
### Turning off
$ boot2docker save
# save state to disk
### Vagrant
[boot2docker]: https://github.com/boot2docker/boot2docker
[docker]: https://www.docker.com/

View File

@ -1,18 +0,0 @@
---
title: eslint
category: JavaScript libraries
---
```js
// "comma-dangle": "always" ("always-multiline", "never")
var foo = {
bar: "baz",
qux: "quux",
};
var arr = [1,2,];
```
```
// "yoda": "always" ("never")
if ("red" === color)
```

View File

@ -1,9 +0,0 @@
---
title: GitHub
category: Git
---
### URLs
github.com/:userrepo/blame/:branch/:path
github.com/:userrepo/commit/:commit

View File

@ -1,28 +0,0 @@
---
title: jQuery mobile events
category: JavaScript libraries
---
### Mobile events
For support for `tap`, `swipe`, `swipeLeft`, et al, use
[jquery.mobile.event.js][m]. Be sure to set `$.support.touch` first.
To get `$.support.touch` (and family), use this from
[jquery.mobile.support.js][s]:
$.extend($.support, {
orientation: "orientation" in window && "onorientationchange" in window,
touch: "ontouchend" in document,
cssTransitions: "WebKitTransitionEvent" in window,
pushState: "pushState" in history && "replaceState" in history,
mediaquery: $.mobile.media( "only all" ),
cssPseudoElement: !!propExists( "content" ),
touchOverflow: !!propExists( "overflowScrolling" ),
boxShadow: !!propExists( "boxShadow" ) && !bb,
scrollTop: ( "pageXOffset" in window || "scrollTop" in document.documentElement || "scrollTop" in fakeBody[ 0 ] ) && !webos && !operamini,
dynamicBaseTag: baseTagTest()
});
[m]:https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.event.js
[s]:https://github.com/jquery/jquery-mobile/blob/master/js/jquery.mobile.support.js

View File

@ -1,32 +0,0 @@
---
title: node-gh
category: JavaScript libraries
---
## Everywhere
| Flag | Description |
| ---- | ---- |
| `-u rstacruz -r nprogress` | Repo name |
| `--browser` | Browser |
{:.no-head}
## Notifications
```
gh nt
gh nt --watch
```
## Issues
| Command | Description |
| ---- | ---- |
| `gh is 'Issue name'` | Create issue |
| `gh is --search 'foo'` | Search issues |
| `gh is 'Name' 'Description'` | Create issue |
| `gh is 123` | Modify issue `123` (use with flags below) |
| ... `-L`/`--label x,y,z` | Add label |
| ... `-A`/`--assignee` | Assign to user |
| ... `-c`/`--comment 'Thanks'` | Add a comment
{:.no-head}

View File

@ -1,7 +0,0 @@
---
title: Git one-liners
---
When did someone work
git log --all --author='Rico' --pretty="%ai" | awk '{ print $1 }' | sort | uniq

View File

@ -1,26 +0,0 @@
### Encrypt decrypt
gpg --encrypt --recepient 'James Receiverson' foo.txt
gpg --decrypt foo.txt.gpg
### Making keys
gpg --gen-key
### Share your public key
# via file
gpg --armor --output pub.txt --export "Rico Sta. Cruz"
# via server
gpg --send-keys "Rico Sta. Cruz" --keyserver http://...
### Key management
gpg --list-keys
gpg --delete-key 'email@addie'
### See
* https://www.madboa.com/geek/gpg-quickstart/

View File

@ -1,19 +0,0 @@
---
title: Homebrew formula
---
brew create http://example.com/foo-0.1.tar.gz
https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Formula-Cookbook.md#formula-cookbook
assert(this.ary.indexOf(zero) === two)
```
def install
system "./configure", "--prefix=#{prefix}", "--disable-debug", "--disable-dependency-tracking"
system "make", "install"
cd "build/cmake"
mv "a", "b"
end
```

View File

@ -1,21 +0,0 @@
---
title: iOS
---
Multiple Exchange accounts:
scp root@iphone.local:/private/var/mobile/Library/Preferences/com.apple.accountsettings.plist .
Paths:
/Library/Themes # Winterboard themes
/User/Media/DCIM/100APPLE # Photos
/User/Media/Recordings # Voice recordings
Copy photos:
rsync -v -r root@iphone.local:/User/Media/DCIM/100APPLE ./photos
Ringtone conversion using ffmpeg:
ffmpeg -i foo.mp3 -ac 1 -ab 128000 -f mp4 -acodec libfaac -y target.m4r

View File

@ -1,10 +0,0 @@
{% if site.data.content.announcement %}
<div class='announcements-list'>
<div class='announcements-item item -hide' data-js-dismissable='{"id":"{{ site.data.content.announcement.id }}"}'>
<h3 class='title'>{{ site.data.content.announcement.title }}</h3>
<div class='body'>{{ site.data.content.announcement.body | markdownify }}</div>
<button data-js-dismiss class='close'></button>
</div>
</div>
{% endif %}

View File

@ -1,34 +0,0 @@
<script type='application/ld+json'>
{
"@context": "http://schema.org",
"@type": "NewsArticle",
"mainEntityOfPage": {
"@type": "WebPage",
"@id": "https://google.com/article"
},
"headline": {{ meta_title | jsonify }},
"image": [ {{ meta_image | jsonify }} ],
"description": {{ meta_description | jsonify }}
}
</script>
<script type='application/ld+json'>
{
"@context": "http://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"item": {
"@id": "{{ site.url }}/#{{ page.category | downcase | replace: ' ', '-' }}",
"name": "{{ page.category }}"
}
},{
"@type": "ListItem",
"position": 2,
"item": {
"@id": {{ page_url | jsonify }},
"name": {{ page.title | jsonify }}
}
}]
}
</script>

View File

@ -1,13 +0,0 @@
{% assign pixel_href = 'https://codefund.io/t/l/TOKEN/pixel.png' | replace: 'TOKEN', site.data.berry.token %}
{% assign link_href = 'https://codefund.io/t/c/TOKEN/' | replace: 'TOKEN', site.data.berry.token %}
<aside class='berry-sponsor' data-js-no-preview>
<div class='cs__wrapper'>
<div class='cs__header'>Proudly sponsored by</div>
<a href='{{ link_href }}' class='cs__blurb' target='_blank' rel='noopener'>
<strong>{{ site.data.berry.title }}</strong>
<span>{{ site.data.berry.description }}</span>
</a>
<img class='cs__pixel' src='{{ pixel_href }}' />
</div>
</aside>

View File

@ -1,4 +0,0 @@
<aside class='codefund-sponsor' data-js-no-preview>
<script src='https://codefund.io/scripts/{{ site.data.codefund.token }}/embed.js?template=centered'></script>
<div id='codefund_ad'></div>
</aside>

View File

@ -1,22 +0,0 @@
{% assign identifier = include.page.url | remove: '.html' | remove_first: '/' %}
{% if site.data.disqus.enabled %}
<section class='comments-area' id='comments' data-js-no-preview>
<div class='container'>
<details class='comments-details'>
<summary>
<strong class='count'>
<span class='disqus-comment-count' data-disqus-identifier="{{ identifier }}" data-disqus-url='{{ site.url }}/{{ identifier }}'>0 Comments</span>
</strong>
<span class='suffix'>{{ site.data.content.comments_area.suffix }}</span>
<span class='fauxlink'>{{ site.data.content.comments_area.link }}</span>
</summary>
<div class='comments-section'>
<div class='comments'>
<div id='disqus_thread'></div>
</div>
</div>
</details>
</div>
<noscript data-js-disqus='{"host":"{{ site.data.disqus.host }}","url":"{{ site.url }}/{{ identifier }}","identifier":"{{ identifier }}"}'></noscript>
</section>
{% endif %}

View File

@ -1 +0,0 @@
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var t={};n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="",n(n.s=2)}([function(e,n){function t(e,n){var t=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.webkitMatchesSelector||e.oMatchesSelector;if(t)return t.call(e,n);if(e.parentNode){for(var r=e.parentNode.querySelectorAll(n),o=r.length;o--;0)if(r[o]===e)return!0;return!1}}e.exports=t},function(e,n,t){function r(e,n){if(n){if(Array.isArray(n))return void o(n,function(n){r(e,n)});if(e.classList){var t=n.split(" ").filter(Boolean);o(t,function(n){e.classList.add(n)})}else e.className+=" "+n}}var o=t(4);e.exports=r},function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(){d||((0,c.default)(document.documentElement,"LoadDone"),d=!0)}var i=t(3),u=r(i),a=t(1),c=r(a),f=t(6),l=r(f),s=document.querySelector("[data-js-main-body]");s&&((0,u.default)(s),(0,c.default)(s,"-wrapified")),(0,l.default)(window,"load",o),setTimeout(o,5e3);var d=void 0},function(e,n,t){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function o(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}return Array.from(e)}function i(e){u(e).forEach(function(e){(0,p.findChildren)(e,"[data-js-h3-section-list]").forEach(function(e){a(e)})})}function u(e){return c(e,{tag:"h2",wrapperFn:function(){return(0,p.createDiv)({class:"h2-section"})},bodyFn:function(){return(0,p.createDiv)({class:"body h3-section-list","data-js-h3-section-list":""})}})}function a(e){return c(e,{tag:"h3",wrapperFn:function(){return(0,p.createDiv)({class:"h3-section"})},bodyFn:function(){return(0,p.createDiv)({class:"body"})}})}function c(e,n){function t(e,n,t){var r=i(),o=e.className;o&&(0,d.default)(r,o),(0,p.before)(e,r);var a=u();return o&&(0,d.default)(a,o),(0,p.appendMany)(a,t),n&&r.appendChild(n),r.appendChild(a),r}var r=n.tag,i=n.wrapperFn,u=n.bodyFn,a=e.children[0],c=[];if(a&&!(0,l.default)(a,r)){var f=(0,p.nextUntil)(a,r);c.push(t(a,null,[a].concat(o(f))))}return(0,p.findChildren)(e,r).forEach(function(e){var n=(0,p.nextUntil)(e,r);c.push(t(e,e,n))}),c}Object.defineProperty(n,"__esModule",{value:!0}),n.default=i,n.groupify=c;var f=t(0),l=r(f),s=t(1),d=r(s),p=t(5)},function(e,n){function t(e,n){var t,r,o=e.length;if("number"==typeof o)for(t=0;t<o;t++)n(e[t],t);else{r=0;for(t in e)e.hasOwnProperty(t)&&n(e[t],t,r++)}return e}e.exports=t},function(e,n,t){"use strict";function r(e){if(Array.isArray(e)){for(var n=0,t=Array(e.length);n<e.length;n++)t[n]=e[n];return t}return Array.from(e)}function o(e,n){n.forEach(function(n){e.appendChild(n)})}function i(e,n){return u(e.nextSibling,n,[])}function u(e,n,t){return e?(0,s.default)(e,n)?t:u(e.nextSibling,n,[].concat(r(t),[e])):t}function a(e,n){e.parentNode.insertBefore(n,e)}function c(e,n){return[].slice.call(e.children).filter(function(e){return(0,s.default)(e,n)})}function f(e){var n=document.createElement("div");return Object.keys(e).forEach(function(t){n.setAttribute(t,e[t])}),n}Object.defineProperty(n,"__esModule",{value:!0}),n.appendMany=o,n.nextUntil=i,n.before=a,n.findChildren=c,n.createDiv=f;var l=t(0),s=function(e){return e&&e.__esModule?e:{default:e}}(l)},function(e,n){function t(e,n,t){e.addEventListener?e.addEventListener(n,t):e.attachEvent("on"+n,function(){t.call(e)})}e.exports=t}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,5 +0,0 @@
<!-- critical js -->
<script>{% include 2017/critical/critical.js %}</script>
<script src='{{base}}/assets/packed/vendor.js?t={{ timestamp }}'></script>
<script src='{{base}}/assets/packed/app.js?t={{ timestamp }}'></script>
{% for lang in page.prism_languages %}<script src='https://cdn.jsdelivr.net/npm/prismjs@1.6.0/components/prism-{{lang}}.min.js'></script>{% endfor %}

View File

@ -1,24 +0,0 @@
{% include meta.html %}
{% include polyfills.html %}
<!-- critical css -->
{% if include.critical == 'home'
%}<style id='critical-css'>{% include 2017/critical/home.css %}</style>{%
endif
%}{%
if include.critical == 'sheet'
%}<style id='critical-css'>{% include 2017/critical/sheet.css %}</style>{%
endif %}
<!-- allow disabling critical CSS optimization by passing ?nocrit=1 -->
<script id='critical-css-disable'>if (~window.location.search.indexOf('nocrit')){;[].slice.call(document.querySelectorAll('#critical-css')).map(function(e){e.parentNode.removeChild(e)})}</script>
<!-- deferred css -->
<script id='deferred-css'>;(function(links){(requestAnimationFrame||mozRequestAnimationFrame||webkitRequestAnimationFrame||msRequestAnimationFrame||(function(fn){window.addEventListener('load',fn)}))(function(){var h=document.getElementsByTagName('head')[0],l,i;for (i=0;i<links.length;i++){l=document.createElement('link');l.rel='stylesheet';l.href=links[i];h.appendChild(l);}})})([
'https://fonts.googleapis.com/css?family=Cousine',
'{{base}}/assets/2017/style.css?t={{ timestamp }}'
])</script>
<noscript id='deferred-css-fallback'>
<link rel='stylesheet' href='https://fonts.googleapis.com/css?family=Cousine'>
<link rel='stylesheet' href='{{base}}/assets/2017/style.css?t={{ timestamp }}'>
</noscript>

View File

@ -1,41 +0,0 @@
{% comment %}
This partial assigns these variables:
meta_image: "https://assets.devhints.io/previews/react.jpg"
meta_description: "A comprehensive cheatsheet for React."
meta_title: "React cheatsheet"
depth: "1"
base: "./"
timestamp: "293048189123"
page_url: "https://devhints.io/react"
It emits some blank lines because Jekyll, lol.
{% endcomment %}
{% assign depth = page.url | split: '/' | size | minus: 1 %}
{% assign base = '' %}
{% if depth <= 1 %}{% assign base = '.' %}
{% elsif depth == 2 %}{% assign base = '..' %}
{% elsif depth == 3 %}{% assign base = '../..' %}
{% elsif depth == 4 %}{% assign base = '../../..' %}{% endif %}
{% assign timestamp = site.time | date: "%Y%m%d%H%M%S" %}
{% if site.data.assets.preview_host %}{% capture meta_image %}{%
if page.url == '/'
%}{{ site.data.assets.preview_host }}/index.jpg?t={{ timestamp }}{%
else
%}{{ site.data.assets.preview_host }}{{ include.page.url | remove: '.html' }}.jpg?t={{ timestamp }}{%
endif
%}{% endcapture %}{% endif %}
{% capture meta_title %}{% include values/title.html page=include.page %}{% endcapture %}
{% assign meta_title = meta_title | strip_newlines %}
{% capture meta_description %}{% include values/description.html page=include.page %}{% endcapture %}
{% assign meta_description = meta_description | strip_newlines %}
{% capture page_url %}{{ site.url }}{{ page.url | remove: '.html' }}{% endcapture %}

View File

@ -1,14 +0,0 @@
{% assign slug = include.page.url | remove: '.html' | remove_first: '/' %}
<a class='{{ include.class }} -item-{{ slug }}'
href="{{base}}{{ include.page.url | remove: '.html' }}"
data-js-searchable-item='{"slug":"{{ slug }}","category":"{{ include.page.category }}"}'>
<span class='info'>
<code class='slug'>{{ slug }}</code>
{% if include.page.layout == '2017/sheet' %}
<abbr class='attribute-peg -new-layout hint--bottom' data-hint='New layout!'><span></span></abbr>
{% endif %}
<span class='title'>{{ include.page.title }} {{ include.page.redirect_to }}</span>
</span>
</a>

View File

@ -1,12 +0,0 @@
<li class='{{ include.class }}'>
<a href='{{ base }}{{ include.page.url | remove: '.html' }}'>
<strong>{{ include.page.title }}</strong>
<span>
cheatsheet
{% if include.page.layout == '2017/sheet' %}
<abbr class='attribute-peg -new-layout hint--bottom' data-hint='New layout!'><span></span></abbr>
{% endif %}
</span>
</a>
</li>

View File

@ -1,62 +0,0 @@
{% assign category_pages = site.pages
| where: "category", include.page.category
| where_exp: "page", "page.url != include.page.url"
| where_exp: "page", "page.deprecated != true"
| where_exp: "page", "page.redirect_to == null"
| sort: "weight", "last"
%}
{% assign top_pages = site.pages
| where_exp: "page", "page.url != include.page.url"
| where_exp: "page", "page.deprecated != true"
| sort: "weight", "last"
%}
{% assign size = site.pages | size %}
<footer class='related-posts-area' id='related' data-js-no-preview>
<div class='container'>
<div class='related-posts-section'>
<div class='callout'>
<a class='related-posts-callout' href='{{ base }}'>
<div class='text'>
<i class='icon'></i>
<span class='description'>
{{ site.data.content.related_posts_callout.description | replace: "SIZE", size }}
</span>
<span class='push-button -dark'>
{{ site.data.content.related_posts_callout.link }}
</span>
</div>
</a>
</div>
<div class='group'>
<div class='related-posts-group'>
{% if include.page.category == 'Others' %}
<h3>{{ site.data.content.related_posts_group.other }}</h3>
{% else %}
<h3>{{ site.data.content.related_posts_group.category | replace: "CATEGORY", include.page.category }}</h3>
{% endif %}
<ul class='related-post-list'>
{% for page in category_pages limit: 6 %}
{% include 2017/related-posts-item.html page=page class='item related-post-item' %}
{% endfor %}
</ul>
</div>
</div>
<div class='group'>
<div class='related-posts-group'>
<h3>{{ site.data.content.related_posts_group.top }}</h3>
<ul class='related-post-list'>
{% for page in top_pages limit: 6 %}
{% include 2017/related-posts-item.html page=page class='item related-post-item' %}
{% endfor %}
</ul>
</div>
</div>
</div>
</div>
</footer>

View File

@ -1,12 +0,0 @@
<footer class='search-footer' data-js-no-preview>
<div class='container'>
<div class='search-footer-section'>
<div class='search'>
{% include 2017/search-form.html class="-small" %}
</div>
<div class='links'>
<a class='home-button' href='{{ base }}'><i></i></a>
</div>
</div>
</div>
</footer>

View File

@ -1,19 +0,0 @@
<form
{% if include.live %}data-js-search-form{% endif %}
class='search' action='{{ base }}' method='get'>
<label class='search-box {{ include.class }}'>
<span class='prefix'>{{ site.data.content.search_form.prefix }}</span>
<span class='sep'>/</span>
<input name='q'
type='text'
{% if include.live %}
{% assign placeholder = site.data.content.search_form.home_placeholder | replace: "%{size}", size %}
autofocus data-js-search-input
placeholder='{{ placeholder }}'
{% else %}
{% assign size = site.pages | size %}
{% assign placeholder = site.data.content.search_form.default_placeholder | replace: "SIZE", size %}
placeholder='{{ placeholder }}'
{% endif %}>
</label>
</form>

View File

@ -1,35 +0,0 @@
{% comment %}
Params:
- noshare
- noedit
- noback
{% endcomment %}
<nav class='top-nav' data-js-no-preview role='navigation'>
<div class='container'>
{% unless include.page.noback %}
<div class='left'>
<a class='home back-button' href='{{base}}'></a>
</div>
{% endunless %}
<a class='brand' href='{{base}}'>
{{ site.data.content.top_nav.title }}
</a>
{% unless include.noshare %}
<div class='actions'>
{% include social-list.html class="social page-actions" page=include.page %}
{% unless include.noedit %}
<ul class='page-actions'>
<li class='link github -button hint--bottom' data-hint='{{ site.data.content.top_nav.edit_on_github }}'>
<a href='{{ site.github.repository_url }}/blob/master/{{ page.path | remove: '.html' }}'>
<span class='text -visible'>{{ site.data.content.top_nav.edit }}</span>
</a>
</li>
</ul>
{% endunless %}
</div>
{% endunless %}
</div>
</nav>

View File

@ -1,20 +0,0 @@
<div class="about-the-site">
<div class="container">
<p class='blurb'>
<strong><a href="{{ base }}">{{ site.title }}</a></strong> is a collection of cheatsheets I've written over the years.
Suggestions and corrections? <a href='https://github.com/rstacruz/cheatsheets/issues/907'>Send them in</a>.
<i class='fleuron'></i>
I'm <a href="http://ricostacruz.com">Rico Sta. Cruz</a>.
Check out my <a href="http://ricostacruz.com/til">Today I learned blog</a> for more.
</p>
{% if page.url != '/index.html' %}
<p class='back'>
<a class='big-button -back -slim' href='.#toc'></a>
</p>
{% endif %}
<p>
</p>
</div>
</div>

View File

@ -5,18 +5,17 @@
#### Date
| Example | Output |
| --- | --- |
| `YYYY-MM-DD` | `2014-01-01` |
| `dddd, MMMM Do YYYY` | `Friday, May 16th 2014` |
{: .-shortcuts}
| Example | Output |
| ------------------------- | ---------------------- |
| `YYYY-MM-DD` | 2014-01-01 |
| `dddd, MMMM Do YYYY` | Friday, May 16th 2014 |
| `dddd [the] Do [of] MMMM` | Friday the 16th of May |
#### Time
| Example | Output |
| --- | --- |
| `hh:mm a` | `12:30 pm` |
{: .-shortcuts}
| Example | Output |
| --------- | -------- |
| `hh:mm a` | 12:30 pm |
Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format](https://date-fns.org/v1.28.5/docs/format). Similar to Java [SimpleDateFormat](https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html).
@ -33,7 +32,7 @@ Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format
| `YYYY` | `2013` | |
| --- | --- | --- |
| `M` | `1`..`12` _(Jan is 1)_ | **Month** |
| `Mo` | `1st`..`31st` | |
| `Mo` | `1st`..`12th` | |
| `MM` | `01`..`12` _(Jan is 1)_ | |
| `MMM` | `Jan` | |
| `MMMM` | `January` | |
@ -86,17 +85,16 @@ Used by [Moment.js](http://momentjs.com/docs/#/displaying/) and [date-fns/format
### Presets
| Example | Output |
| --- | --- |
| `LT` | `8:30 PM` |
| `LTS` | `8:30:25 PM` |
| --- | --- |
| `LL` | `August 2 1985` |
| `ll` | `Aug 2 1985` |
| --- | --- |
| `LLL` | `August 2 1985 08:30 PM` |
| `lll` | `Aug 2 1985 08:30 PM` |
| --- | --- |
| `LLLL` | `Thursday, August 2 1985 08:30 PM` |
| `llll` | `Thu, Aug 2 1985 08:30 PM` |
{: .-shortcuts}
| Example | Output |
| ------- | -------------------------------- |
| `LT` | 8:30 PM |
| `LTS` | 8:30:25 PM |
| --- | --- |
| `LL` | August 2 1985 |
| `ll` | Aug 2 1985 |
| --- | --- |
| `LLL` | August 2 1985 08:30 PM |
| `lll` | Aug 2 1985 08:30 PM |
| --- | --- |
| `LLLL` | Thursday, August 2 1985 08:30 PM |
| `llll` | Thu, Aug 2 1985 08:30 PM |

View File

@ -1,14 +0,0 @@
{% include about-the-site.html %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/highlight.min.js"></script>
{% comment %}<!-- https://github.com/highlightjs/cdn-release/tree/master/build/languages -->{% endcomment %}
{% for lang in page.hljs_languages %}
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.5/languages/{{lang}}.min.js"></script>
{% endfor %}
<script src="https://cdn.rawgit.com/rstacruz/unorphan/v1.0.1/index.js"></script>
<script>hljs.initHighlightingOnLoad()</script>
<script>unorphan('h1, h2, h3, p, li, .unorphan')</script>
</body>
</html>

View File

@ -1,12 +0,0 @@
<!doctype html>
<html lang='en' class='no-js {{ page.html_class }}'>
<head>
{% include meta.html %}
{% include polyfills.html %}
<style>html{opacity:0}</style>
<link href="https://ricostacruz.com/til/assets/style.css?t={{ timestamp }}" rel="stylesheet" />
<link href="{{base}}/assets/style.css?t={{ timestamp }}" rel="stylesheet" />
<link href="{{base}}/assets/print.css?t={{ timestamp }}" rel="stylesheet" media="print" />
</head>
<body>
<div class='all'>

View File

@ -1,85 +0,0 @@
{% include 2017/meta-vars.html page=page %}
<meta charset='utf-8'>
<meta content='width=device-width, initial-scale=1.0' name='viewport'>
<link href='{{ base }}/assets/favicon.png' rel='shortcut icon'>
<meta content='{{ page.url }}' name='app:pageurl'>
{% if meta_title %}
<title>{{ meta_title }}</title>
<meta content='{{ meta_title }}' property='og:title'>
<meta content='{{ meta_title }}' property='twitter:title'>
<meta content='{{ page.og_type | default: "article" }}' property='og:type'>
{% endif %}
{% if meta_image %}
<meta content='{{ meta_image | escape }}' property='og:image'>
<meta content='{{ meta_image | escape }}' property='twitter:image'>
<meta content='900' property='og:image:width'>
<meta content='471' property='og:image:height'>
{% endif %}
{% if meta_description %}
<meta content="{{ meta_description | escape }}" name="description">
<meta content="{{ meta_description | escape }}" property="og:description">
<meta content="{{ meta_description | escape }}" property="twitter:description">
{% endif %}
<link rel="canonical" href="{{ page_url }}">
<meta name="og:url" content="{{ page_url }}">
{% if page.url == '/' %}
<link rel="prefetch" href="{{ site.url }}">
<link rel="prerender" href="{{ site.url }}">
{% endif %}
{% if page.author %}
{% for author in site.authors | where: "name", page.author %}
<meta content='{{ author.name }}' name='author'>
{% if author.ogp %}
<meta content='{{ author.ogp }}' property='article:author'>
{% endif %}
{% endfor %}
{% endif %}
{% if site.title %}
<meta content='{{ site.title }}' property='og:site_name'>
{% endif %}
{% if site.facebook.app_id %}
<meta content='{{ site.facebook.app_id }}' property='fb:app_id'>
{% endif %}
{% if site.facebook.admin %}
<meta content='{{ site.facebook.admin }}' property='fb:admins'>
{% endif %}
{% if page.date %}
<meta content='{{ page.date | date: "%Y-%m-%d" }}' property='article:published_date'>
{% endif %}
{% if page.category %}
<meta content='{{ page.category }}' property='article:section'>
{% endif %}
{% if page.tags %}
{% for tag in page.tags %}
<meta content='{{ tag }}' property='article:tag'>
{% endfor %}
{% endif %}
{% if site.data.google_analytics.enabled %}
<script async src='https://www.googletagmanager.com/gtag/js?id={{ site.data.google_analytics.id }}'></script>
<script>
{% comment %} if(~location.hostname.indexOf('{{site.data.google_analytics.hostname}}')){ {% endcomment %}
window.dataLayer=window.dataLayer||[];
function gtag(){dataLayer.push(arguments)};
gtag('js',new Date());
gtag('config','{{ site.data.google_analytics.id }}');
</script>
{% endif %}
{% if depth %}
<meta property='page:depth' content='{{depth}}'>
{% endif %}
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
<script>(function(H){H.className=H.className.replace(/\bNoJs\b/,'WithJs')})(document.documentElement)</script>

View File

@ -1,9 +0,0 @@
<script>(function(d,s){if(window.Promise&&[].includes&&Object.assign&&window.Map)return;var js,sc=d.getElementsByTagName(s)[0];js=d.createElement(s);js.src='https://cdn.polyfill.io/v2/polyfill.min.js';sc.parentNode.insertBefore(js, sc);}(document,'script'))</script>
<!--[if lt IE 9]>{%comment%}
{%endcomment%}<script src='https://cdnjs.cloudflare.com/ajax/libs/nwmatcher/1.2.5/nwmatcher.min.js'></script>{%comment%}
{%endcomment%}<script src='https://cdnjs.cloudflare.com/ajax/libs/json2/20140204/json2.js'></script>{%comment%}
{%endcomment%}<script src='https://cdn.rawgit.com/gisu/selectivizr/1.0.3/selectivizr.js'></script>{%comment%}
{%endcomment%}<script src='https://cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.3/html5shiv.min.js'></script>{%comment%}
{%endcomment%}<script src='https://cdnjs.cloudflare.com/ajax/libs/respond.js/1.4.2/respond.js'></script>{%comment%}
{%endcomment%}<![endif]-->

View File

@ -1,6 +0,0 @@
<div class='site-header'>
<div class='container'>
This is <a href="."><em>{{ site.title }}</em></a> &mdash; a collection of cheatsheets I've written.
</div>
</div>

View File

@ -1,12 +0,0 @@
{% if include.page.type == 'home' %}
{% assign description = site.data.content.social_list.default_description %}
{% else %}
{% assign description = site.data.content.social_list.description | replace: "TITLE", include.page.title %}
{% endif %}
<ul class="social-list {{ include.class }}">
<li class="facebook link hint--bottom" data-hint="{{ site.data.content.social_list.facebook_share }}"><a href="https://www.facebook.com/sharer/sharer.php?u={{ site.url | uri_escape }}{{ include.page.url | uri_escape }}" target="share"><span class="text"></span></a></li>
<li class="twitter link hint--bottom" data-hint="{{ site.data.content.social_list.twitter_share }}"><a href="https://twitter.com/intent/tweet?text={{ description | uri_escape }}%20{{ site.url | uri_escape }}{{ include.page.url | uri_escape }}" target="share"><span class="text"></span></a></li>
{% comment %}
<li class="googleplus link hint--bottom" data-hint="Share on Google Plus"><a href="https://plus.google.com/share?url={{ site.url }}{{ include.page.url }}" target="share"><span class="text">+1</span></a></li>-->
{% endcomment %}
</ul>

View File

@ -1,17 +0,0 @@
{%
if page.description and page.intro
%}{{ page.description }} {{ page.intro | markdownify | strip_html }}{%
elsif page.description
%}{{ page.description }} · One-page guide to {{ page.title }}{%
elsif page.keywords and page.intro
%}{{ page.keywords | join: ' · ' }} · {{ page.intro | markdownify | strip_html }}{%
elsif page.keywords
%}{{ page.keywords | join: ' · ' }} · One-page guide to {{ page.title }}{%
elsif page.intro
%}One-page guide to {{ page.title }}: usage, examples, and more. {{ page.intro | markdownify | strip_html }}{%
elsif page.type == 'article'
%}The one-page guide to {{ page.title }}: usage, examples, links, snippets, and more.{%
else
%}The one-page guide to {{ page.title }}: usage, examples, links, snippets, and more.{%
endif
%}

View File

@ -1,11 +0,0 @@
{%
if page.full_title
%}{{ page.full_title }}{%
elsif page.type == 'article'
%}{{ page.title }} cheatsheet{%
elsif page.title
%}{{ page.title }}{%
else
%}{{ site.title }}{%
endif
%}

View File

@ -1,7 +0,0 @@
// 3rd party libs
window.Prism = require('prismjs')
// All the others
function requireAll (r) { r.keys().forEach(r) }
requireAll(require.context('./initializers/', true, /\.js$/))
requireAll(require.context('./behaviors/', true, /\.js$/))

View File

@ -1,44 +0,0 @@
import onmount from 'onmount'
import prepend from 'dom101/prepend'
const DEFAULTS = {
// select elements to put anchor on
rule: 'h2[id]',
// class name for anchor
className: 'local-anchor anchor',
// text of anchor
text: '#',
// append before or after innerText?
shouldAppend: false,
}
/*
* Behavior: Add local anchors
*/
onmount('[data-js-anchors]', function () {
const data = JSON.parse(this.getAttribute('data-js-anchors') || '{}')
const rules = Array.isArray(data)
? (data.length ? data : [DEFAULTS])
: [Object.assign({}, DEFAULTS, data)]
for (const { rule, className, text, shouldAppend } of rules) {
for (const el of this.querySelectorAll(rule)) {
if (!el.hasAttribute('id')) {
continue
}
const id = el.getAttribute('id')
const anchor = document.createElement('a')
anchor.setAttribute('href', `#${id}`)
anchor.setAttribute('class', className)
anchor.innerText = String(text || DEFAULTS.text)
if (shouldAppend) {
el.appendChild(anchor)
} else {
prepend(el, anchor)
}
}
}
})

View File

@ -1,22 +0,0 @@
import closest from 'dom101/closest'
import remove from 'dom101/remove'
import on from 'dom101/on'
import { getData } from '../helpers/data'
import onmount from 'onmount'
import * as Dismiss from '../helpers/dismiss'
/**
* Dismiss button
*/
onmount('[data-js-dismiss]', function () {
const parent = closest(this, '[data-js-dismissable]')
const dismissable = getData(parent, 'js-dismissable')
const id = (dismissable && dismissable.id) || ''
on(this, 'click', e => {
Dismiss.setDismissed(id)
e.preventDefault()
if (parent) remove(parent)
})
})

View File

@ -1,17 +0,0 @@
import onmount from 'onmount'
import remove from 'dom101/remove'
import removeClass from 'dom101/remove-class'
import { getData } from '../helpers/data'
import { isDismissed } from '../helpers/dismiss'
import { isPreview } from '../helpers/preview'
onmount('[data-js-dismissable]', function () {
const id = getData(this, 'js-dismissable').id || ''
if (isPreview() || isDismissed(id)) {
remove(this)
} else {
removeClass(this, '-hide')
}
})

View File

@ -1,32 +0,0 @@
import onmount from 'onmount'
import injectDisqus from '../helpers/inject_disqus'
/**
* Delay disqus by some time. It's at the bottom of the page, there's no need
* for it to load fast. This will give more time to load more critical assets.
*/
const DISQUS_DELAY = 100
/**
* Injects Disqus onto the page.
*/
onmount('[data-js-disqus]', function () {
const data = JSON.parse(this.getAttribute('data-js-disqus'))
const $parent = this.parentNode
$parent.setAttribute('hidden', true)
window.disqus_config = function () {
this.page.url = data.url
this.page.identifier = data.identifier
}
// Disqus takes a while to load, don't do it so eagerly.
window.addEventListener('load', () => {
setTimeout(() => {
injectDisqus(data.host)
$parent.removeAttribute('hidden')
}, DISQUS_DELAY)
})
})

View File

@ -1,32 +0,0 @@
/* eslint-disable no-new */
import Isotope from 'isotope-layout/dist/isotope.pkgd.js'
import onmount from 'onmount'
import on from 'dom101/on'
import qsa from 'dom101/query-selector-all'
/*
* Behavior: Isotope
*/
onmount('[data-js-h3-section-list]', function () {
const iso = new Isotope(this, {
itemSelector: '.h3-section',
transitionDuration: 0
})
const images = qsa('img', this)
images.forEach(image => {
on(image, 'load', () => {
iso.layout()
})
})
// Insurance against weirdness on pages like devhints.io/vim, where the
// critical path CSS may look different from the final CSS (because of the
// tables).
on(window, 'load', () => {
iso.layout()
})
})

View File

@ -1,16 +0,0 @@
import remove from 'dom101/remove'
import onmount from 'onmount'
import addClass from 'dom101/add-class'
import { isPreview } from '../helpers/preview'
/*
* Behavior: Things to remove when preview mode is on
*/
onmount('[data-js-no-preview]', function (b) {
if (isPreview()) {
remove(this)
addClass(document.documentElement, 'PreviewMode')
}
})

View File

@ -1,17 +0,0 @@
import onmount from 'onmount'
import on from 'dom101/on'
/**
* Submitting the search form
*/
onmount('[data-js-search-form]', function () {
on(this, 'submit', e => {
e.preventDefault()
const link = document.querySelector('a[data-search-index]:visible')
const href = link && link.getAttribute('href')
if (href) window.location = href
})
})

View File

@ -1,22 +0,0 @@
import onmount from 'onmount'
import * as Search from '../helpers/search'
import qs from '../helpers/qs'
import on from 'dom101/on'
onmount('[data-js-search-input]', function () {
on(this, 'input', () => {
const val = this.value
if (val === '') {
Search.showAll()
} else {
Search.show(val)
}
})
const query = (qs(window.location.search) || {}).q
if (query && query.length) {
this.value = query
setTimeout(() => { Search.show(query) })
}
})

View File

@ -1,22 +0,0 @@
import onmount from 'onmount'
import { nextUntil } from '../helpers/dom'
import matches from 'dom101/matches'
// Ensure that search-index is set first
import './searchable-item'
/**
* Propagate item search indices to headers
*/
onmount('[data-js-searchable-header]', function () {
const els = nextUntil(this, '[data-js-searchable-header]')
.filter(el => matches(el, '[data-search-index]'))
const keywords = els
.map(n => n.getAttribute('data-search-index'))
.join(' ')
.split(' ')
this.setAttribute('data-search-index', keywords.join(' '))
})

View File

@ -1,13 +0,0 @@
import onmount from 'onmount'
import permutate from '../helpers/permutate'
/**
* Sets search indices (`data-search-index` attribute)
*/
onmount('[data-js-searchable-item]', function () {
const data = JSON.parse(this.getAttribute('data-js-searchable-item') || '{}')
const words = permutate(data)
this.setAttribute('data-search-index', words.join(' '))
})

View File

@ -1,27 +0,0 @@
/*
* This is the "critical path" JavaScript that will be included INLINE on every
* page. Keep this as small as possible!
*/
import wrapify from './wrapify'
import addClass from 'dom101/add-class'
import on from 'dom101/on'
// Transform the main body markup to make it readable.
const body = document.querySelector('[data-js-main-body]')
if (body) {
wrapify(body)
addClass(body, '-wrapified')
}
// Be "done" when we're done, or after a certain timeout.
on(window, 'load', done)
setTimeout(done, 5000)
let isDone
function done () {
if (isDone) return
addClass(document.documentElement, 'LoadDone')
isDone = true
}

View File

@ -1,21 +0,0 @@
/* eslint-env jest */
import qs from '../qs'
describe('qs()', () => {
test('basic', run({
input: '?preview=1',
output: { preview: '1' }
}))
test('two fragments', run({
input: '?a=1&b=2',
output: { a: '1', b: '2' }
}))
function run ({ input, output }) {
return function () {
const result = qs(input)
expect(result).toEqual(output)
}
}
})

View File

@ -1,61 +0,0 @@
import matches from 'dom101/matches'
/*
* Just like jQuery.append
*/
export function appendMany (el, children) {
children.forEach(child => { el.appendChild(child) })
}
/*
* Just like jQuery.nextUntil
*/
export function nextUntil (el, selector) {
const nextEl = el.nextSibling
return nextUntilTick(nextEl, selector, [])
}
function nextUntilTick (el, selector, acc) {
if (!el) return acc
const isMatch = matches(el, selector)
if (isMatch) return acc
return nextUntilTick(el.nextSibling, selector, [ ...acc, el ])
}
/*
* Just like jQuery.before
*/
export function before (reference, newNode) {
reference.parentNode.insertBefore(newNode, reference)
}
/*
* Like jQuery.children('selector')
*/
export function findChildren (el, selector) {
return [].slice.call(el.children)
.filter(child => matches(child, selector))
}
/**
* Creates a div
* @private
*
* @example
*
* createDiv({ class: 'foo' })
*/
export function createDiv (props) {
const d = document.createElement('div')
Object.keys(props).forEach(key => {
d.setAttribute(key, props[key])
})
return d
}

View File

@ -1 +0,0 @@
/* blank */

View File

@ -1,71 +0,0 @@
/**
* Permutates a searcheable item.
*
* permutate({
* slug: 'hello-world',
* category: 'greetings'
* })
*/
export default function permutate (data) {
let words = []
if (data.slug) {
words = words.concat(permutateString(data.slug))
}
if (data.category) {
words = words.concat(permutateString(data.category))
}
return words
}
/**
* Permutates strings.
*
* @example
* permutateString('hi joe')
* => ['h', 'hi', 'j', 'jo', 'joe']
*/
export function permutateString (str) {
let words = []
let inputs = splitwords(str)
inputs.forEach(word => {
words = words.concat(permutateWord(word))
})
return words
}
/**
* Permutates a word.
*
* @example
* permutateWord('hello')
* => ['h', 'he', 'hel', 'hell', 'hello']
*/
export function permutateWord (str) {
let words = []
const len = str.length
for (var i = 1; i <= len; ++i) {
words.push(str.substr(0, i))
}
return words
}
/**
* Helper for splitting to words.
*
* @example
* splitWords('Hello, world!')
* => ['hello', 'world']
*/
export function splitwords (str) {
const words = str.toLowerCase()
.split(/[ /\-_]/)
.filter(k => k && k.length !== 0)
return words
}

View File

@ -1,40 +0,0 @@
import { splitwords } from './permutate'
import qsa from 'dom101/query-selector-all'
/**
* Show everything.
*
* @example
* Search.showAll()
*/
export function showAll () {
qsa('[data-search-index]').forEach(el => {
el.removeAttribute('aria-hidden')
})
}
/**
* Search for a given keyword.
*
* @example
* Search.show('hello')
*/
export function show (val) {
const keywords = splitwords(val)
if (!keywords.length) return showAll()
const selectors = keywords
.map(k => `[data-search-index~=${JSON.stringify(k)}]`)
.join('')
qsa('[data-search-index]').forEach(el => {
el.setAttribute('aria-hidden', true)
})
qsa(selectors).forEach(el => {
el.removeAttribute('aria-hidden')
})
}

View File

@ -1,10 +0,0 @@
import ready from 'dom101/ready'
import onmount from 'onmount'
/**
* Behavior: Wrapping
*/
ready(() => {
setTimeout(() => { onmount() })
})

View File

@ -1,274 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`h2 + pre 1`] = `
<div>
<div
class="h2-section"
>
<h2>
heading
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
>
<div
class="h3-section language-markdown"
>
<div
class="body language-markdown"
>
<pre
class="language-markdown"
>
(code)
</pre>
</div>
</div>
</div>
</div>
</div>
`;
exports[`h3 with class 1`] = `
<div>
<div
class="h2-section -hello"
>
<div
class="body h3-section-list -hello"
data-js-h3-section-list=""
>
<div
class="h3-section -hello"
>
<h3
class="-hello"
>
install
</h3>
<div
class="body -hello"
>
<p>
(install)
</p>
</div>
</div>
</div>
</div>
</div>
`;
exports[`multiple h2s 1`] = `
<div>
<div
class="h2-section"
>
<h2>
multiple h2
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
/>
</div>
<div
class="h2-section"
>
<h2>
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
>
<div
class="h3-section"
>
<h3>
install
</h3>
<div
class="body"
>
<p>
(install)
</p>
</div>
</div>
<div
class="h3-section"
>
<h3>
usage
</h3>
<div
class="body"
>
<p>
(usage)
</p>
</div>
</div>
</div>
</div>
<div
class="h2-section"
>
<h2>
getting started
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
/>
</div>
<div
class="h2-section"
>
<h2>
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
>
<div
class="h3-section"
>
<h3>
first
</h3>
<div
class="body"
>
<p>
(first)
</p>
</div>
</div>
<div
class="h3-section"
>
<h3>
second
</h3>
<div
class="body"
>
<p>
(second)
</p>
</div>
</div>
</div>
</div>
</div>
`;
exports[`simple usage 1`] = `
<div>
<div
class="h2-section"
>
<h2>
simple usage
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
/>
</div>
<div
class="h2-section"
>
<h2>
</h2>
<div
class="body h3-section-list"
data-js-h3-section-list=""
>
<div
class="h3-section"
>
<h3>
install
</h3>
<div
class="body"
>
<p>
(install)
</p>
</div>
</div>
<div
class="h3-section"
>
<h3>
usage
</h3>
<div
class="body"
>
<p>
(usage)
</p>
</div>
</div>
</div>
</div>
</div>
`;

View File

@ -1,63 +0,0 @@
/* eslint-env jest */
import wrapify from '../index'
import $ from 'jquery'
it('simple usage', run(`
<div>
<h2>simple usage<h2>
<h3>install</h3>
<p>(install)</p>
<h3>usage</h3>
<p>(usage)</p>
</div>
`, $div => {
expect($div.find('.h2-section .h3-section-list .h3-section').length).toEqual(2)
}))
it('h3 with class', run(`
<div>
<h3 class='-hello'>install</h3>
<p>(install)</p>
</div>
`, $div => {
expect($div.find('div.h3-section.-hello').length).toEqual(1)
expect($div.find('div.h3-section-list.-hello').length).toEqual(1)
}))
it('multiple h2s', run(`
<div>
<h2>multiple h2<h2>
<h3>install</h3>
<p>(install)</p>
<h3>usage</h3>
<p>(usage)</p>
<h2>getting started<h2>
<h3>first</h3>
<p>(first)</p>
<h3>second</h3>
<p>(second)</p>
</div>
`))
function run (input, fn) {
return function () {
const $div = $(input)
wrapify($div[0])
expect($div[0]).toMatchSnapshot()
if (fn) fn($div)
}
}
it('h2 + pre', run(`
<div>
<h2>heading</h2>
<pre class='language-markdown'>(code)</pre>
</div>
`))

View File

@ -1,110 +0,0 @@
import matches from 'dom101/matches'
import addClass from 'dom101/add-class'
import { appendMany, nextUntil, before, findChildren, createDiv } from '../helpers/dom'
/**
* Wraps h2 sections into h2-section.
* Wraps h3 sections into h3-section.
*
* @private
*/
export default function wrapify (root) {
// These are your H2 sections. Returns a list of .h2-section nodes.
const sections = wrapifyH2(root)
// For each h2 section, wrap the H3's in them
sections.forEach(section => {
const bodies = findChildren(section, '[data-js-h3-section-list]')
bodies.forEach(body => { wrapifyH3(body) })
})
}
/**
* Wraps h2 sections into h2-section.
* Creates and HTML structure like so:
*
* .h2-section
* h2.
* (title)
* .body.h3-section-list.
* (body goes here)
*
* @private
*/
function wrapifyH2 (root) {
return groupify(root, {
tag: 'h2',
wrapperFn: () => createDiv({ class: 'h2-section' }),
bodyFn: () => createDiv({
class: 'body h3-section-list',
'data-js-h3-section-list': ''
})
})
}
/**
* Wraps h3 sections into h3-section.
* Creates and HTML structure like so:
*
* .h3-section
* h3.
* (title)
* .body.
* (body goes here)
*
* @private
*/
function wrapifyH3 (root) {
return groupify(root, {
tag: 'h3',
wrapperFn: () => createDiv({ class: 'h3-section' }),
bodyFn: () => createDiv({ class: 'body' })
})
}
/**
* Groups all headings (a `tag` selector) under wrappers like `.h2-section`
* (build by `wrapperFn()`).
* @private
*/
export function groupify (el, { tag, wrapperFn, bodyFn }) {
const first = el.children[0]
let result = []
// Handle the markup before the first h2
if (first && !matches(first, tag)) {
const sibs = nextUntil(first, tag)
result.push(wrap(first, null, [ first, ...sibs ]))
}
// Find all h3's inside it
const children = findChildren(el, tag)
children.forEach(child => {
const sibs = nextUntil(child, tag)
result.push(wrap(child, child, sibs))
})
return result
function wrap (pivot, first, sibs) {
const wrap = wrapperFn()
const pivotClass = pivot.className
if (pivotClass) addClass(wrap, pivotClass)
before(pivot, wrap)
const body = bodyFn()
if (pivotClass) addClass(body, pivotClass)
appendMany(body, sibs)
if (first) wrap.appendChild(first)
wrap.appendChild(body)
return wrap
}
}

View File

@ -1,90 +0,0 @@
<!doctype html>
<html class='NoJs' lang='en'><head>
{% assign featured_pages = site.pages
| where_exp: "page", "page.tags contains 'Featured'"
%}
{% assign recent_pages = site.pages
| where_exp: "page", "page.updated"
| sort: "updated", "first"
%}
{% include 2017/head.html critical='home' %}
</head><body>
{% include 2017/top-nav.html page=page is_home=true noedit=true noback=true %}
{% if site.data.carbon.enabled %}
<div class='SideAd' role='complementary'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
<div class='body-area -slim'>
<div class='site-header' role='banner'>
<h1>
{{ site.data.content.home.title }}
</h1>
<p>
{{ site.data.content.home.tagline }}
</p>
{% include 2017/search-form.html live=true %}
{% if site.data.berry.enabled %}
<div class='adbox' role='complementary'>
{% include 2017/berry-sponsor.html %}
</div>
{% endif %}
{% if site.data.codefund.enabled %}
<div class='adbox' role='complementary'>
{% include 2017/codefund.html %}
</div>
{% endif %}
</div>
<div class='pages-list' role='main'>
{% for page in featured_pages %}
{% include 2017/pages-list-item.html page=page class='item top-sheet' %}
{% endfor %}
<h2 class='category item' data-js-searchable-header>
<span>Recently updated</span>
</h2>
{% for page in recent_pages reversed %}
{% if forloop.index <= 18 %}
{% include 2017/pages-list-item.html page=page class='article item' %}
{% endif %}
{% endfor %}
{% for category in site.data.categories.names %}
<h2 class='category item' id='{{ category | downcase | replace: " ", "-" }}' data-js-searchable-header>
<span>{{ category }}</span>
</h2>
{% for page in site.pages %}
{% if page.category == category %}
{% if page.title %}
{% include 2017/pages-list-item.html page=page class='article item' %}
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
<div class='message item missing-message'>
<h3>See something missing?</h3>
<p>
<a class='push-button' href='{{ site.github.repository_url }}/issues/907'>Request cheatsheet</a>
</p>
</div>
</div>
</div>
{% include 2017/announcements-list.html %}
{% include 2017/foot.html %}
</body>
</html>

View File

@ -1,26 +0,0 @@
<!doctype html>
<html lang='en'><head>
{% include 2017/head.html %}
</head><body>
{% include 2017/top-nav.html page=page noshare=true %}
<div class='body-area -slim'>
<div class='site-header'>
<h1>{{ site.data.content.not_found.title }}</h1>
<p>{{ site.data.content.not_found.description }}</p>
{% include 2017/search-form.html %}
<p class='action'>
<a class='push-button' href='./'>{{ site.data.content.not_found.home }}</a>
</p>
</div>
</div>
{% include 2017/foot.html %}
</body>
</html>

View File

@ -1,68 +0,0 @@
<!doctype html>
<html class='NoJs' lang='en'><head>
{% include 2017/head.html critical='sheet' %}
{% include 2017/article-schema.html page=page %}
</head><body>
{% include 2017/top-nav.html page=page %}
<div class='body-area'>
<header class='main-heading -center' role='banner'>
<h1 class='h1'>{{ page.title }} <em>{{ site.data.content.sheet.suffix }}</em></h1>
<div class='adbox' data-js-no-preview>
{% if site.data.berry.enabled %}
<div class='ad -berry' role='complementary'>
{% include 2017/berry-sponsor.html %}
</div>
{% endif %}
{% if site.data.codefund.enabled %}
<div class='ad -codefund' role='complementary'>
{% include 2017/codefund.html %}
</div>
{% endif %}
{% if site.data.carbon.enabled %}
<div class='HeadlineAd ad -carbon' role='complementary'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
</div>
</header>
{% if page.tags contains 'WIP' %}
<aside class='notice-box'>
This page is a work in progress. You can help by <a href='{{ site.github.repository_url }}/blob/master/{{ page.path | remove: '.html' }}'>suggesting edits</a>!
</aside>
{% endif %}
{% if page.deprecated_by %}
<aside class='notice-box'>
<strong>Deprecated:</strong> This guide covers an older version.
<a href='{{ base }}{{ page.deprecated_by }}'>A newer version is available here.</a>
</aside>
{% endif %}
{% if page.intro %}
<div class='intro-content MarkdownBody'>
{{ page.intro | markdownify }}
</div>
{% endif %}
<main class='post-content MarkdownBody' data-js-main-body data-js-anchors role='main'>
{{ content }}
</main>
</div>
<div class='pre-footer' data-js-no-preview><i class='icon'></i></div>
{% include 2017/comments-area.html page=page %}
{% include 2017/search-footer.html %}
{% include 2017/related-posts.html page=page %}
{% include 2017/foot.html %}
</body>
</html>

View File

@ -1 +0,0 @@
{{content}}

View File

@ -1,30 +0,0 @@
---
type: article
---
{% include head.html %}
{% include site-header.html %}
<div class='post-list -single -cheatsheet'>
<div class='post-item'>
{% include social-list.html page=page class="-collapse" %}
<div class='post-headline -cheatsheet'>
<p class='prelude'><span></span></p>
<h1><span>{{ page.title }}</span></h1>
</div>
{% if site.data.carbon.enabled %}
<div class='headline-ad'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
<div class='post-content -cheatsheet'>
{{ content }}
</div>
{% include social-list.html page=page %}
</div>
</div>
{% include foot.html %}

View File

@ -1,25 +0,0 @@
---
type: article
---
{% include head.html %}
{% include site-header.html %}
{% include 2017/article-schema.html page=page %}
<div class='post-list -single -cheatsheet'>
<div class='post-item'>
<div class='post-headline -cheatsheet'>
<p class='prelude'><span></span></p>
<h1><span>{{ page.title }}</span></h1>
{% include social-list.html page=page %}
</div>
<div class='post-content -cheatsheet'>
{{ content }}
</div>
{% include social-list.html page=page %}
</div>
</div>
{% include foot.html %}

View File

@ -1,30 +0,0 @@
---
html_class: home
type: home
---
{% include head.html %}
{% include site-header.html %}
{% for category in site.data.categories.names %}
<div class='pages-header'>
<h2 id='{{ category | downcase | replace: " ", "-" }}'>{{ category }}</h2>
</div>
<div class='pages-list'>
{% for page in site.pages %}
{% if page.category == category %}
<a href="{{base}}{{ page.url }}">
<span class='title'>{{ page.title }}</span>
<span class='date'>{{ page.url | remove: '.html' | remove: '/' }}</span>
</a>
{% endif %}
{% endfor %}
</div>
{% endfor %}
{% if site.data.carbon.enabled %}
<div class='side-ad'>
<script async src='{{ site.data.carbon.src }}' id="_carbonads_js"></script>
</div>
{% endif %}
{% include foot.html %}

View File

@ -1,11 +0,0 @@
<!DOCTYPE html>
{% assign target = page.redirect.to | remove: '.html' | replace: 'cheatsheets/cheatsheets', 'cheatsheets' %}
<html lang="en-US">
<meta charset="utf-8">
<title>Redirecting…</title>
<link rel="canonical" href="{{ target }}">
<meta http-equiv="refresh" content="0; url={{ target }}">
<h1>Redirecting...</h1>
<a href="{{ target }}">Click here if you are not redirected.</a>
<script>location="{{ target }}"</script>
</html>

View File

@ -1,47 +0,0 @@
$bounce: cubic-bezier(.75,-0.5,0,1.75);
/*
* "Preloader":
* This makes the content semi-transparent before the page ad loads.
*/
.post-content {
html.WithJs & {
opacity: 0;
}
}
/*
* Pop it in as the page loads
*/
.berry-sponsor {
html.WithJs & {
transform: scale(0.9) translate3d(0, -16px, 0);
opacity: 0;
}
html.WithJs.LoadDone & {
transform: scale(1) translate3d(0, 0, 0);
opacity: 1;
transition: transform 500ms $bounce, opacity 500ms linear;
}
}
/*
* Defer "loading" until page's onload event fires.
* (The page actually already loaded, we just pretend like it hasn't)
*/
.pages-list,
.post-content.-wrapified,
.intro-content {
html.WithJs & {
opacity: 0.4;
}
html.WithJs.LoadDone & {
opacity: 1;
transition: opacity 100ms linear 100ms;
}
}

View File

@ -1,16 +0,0 @@
.attribute-peg {
& {
display: inline-block;
height: 12px;
width: 20px;
text-align: center;
}
& > span {
display: inline-block;
width: 8px;
height: 8px;
background: saturate(lighten(#5a8, 16%), 24%);
border-radius: 50%;
}
}

View File

@ -1,62 +0,0 @@
.berry-sponsor {
text-align: center;
position: relative;
overflow: hidden;
max-width: 320px;
margin-left: auto;
margin-right: auto;
}
/*
* Berry styles
*/
.cs__header {
color: $base-mute;
@include font-size(-1);
display: block;
margin-bottom: 8px;
&::before,
&::after {
content: '';
margin: 0 0.5em;
opacity: 0.5;
}
}
.cs__blurb {
&,
&:hover,
&:focus {
text-decoration: none;
}
& {
color: $base-text;
display: block;
}
& > strong {
color: $base-head;
font-weight: bold;
}
&:hover,
&:focus {
& > strong {
color: $base-text;
}
& > span {
color: $base-mute;
}
}
}
.cs__pixel {
position: absolute;
left: 0;
top: 0;
pointer-events: none;
}

View File

@ -1,9 +0,0 @@
.body-area {
max-width: $area-width;
margin: 0 auto;
@include gutter(padding);
&.-slim {
max-width: 740px;
}
}

View File

@ -1,10 +0,0 @@
.codefund-sponsor {
& {
min-height: 114px;
}
.cf-wrapper {
margin-left: auto;
margin-right: auto;
}
}

View File

@ -1,25 +0,0 @@
/*
* h2 section
*/
/* Hide the first h2 heading */
.h2-section {
&:first-child:not(.-no-hide) > h2 {
display: none;
}
@media (min-width: 481px) {
& + & {
margin-top: 48px;
}
}
/* Hide anchors until mouseover */
& > .anchor {
opacity: 0;
}
&:hover > .anchor {
opacity: 1;
}
}

View File

@ -1,101 +0,0 @@
/*
* H3 section list:
* The body that is isotoped.
*/
.h3-section-list {
& {
@include section-gutter(margin-left, $multiplier: -1);
@include section-gutter(margin-right, $multiplier: -1);
margin-top: 0;
margin-bottom: 0;
}
// Clearfix
&::after {
content: '';
display: table;
clear: both;
zoom: 1;
}
// Each section
& > .h3-section {
@include section-gutter(padding);
float: left;
width: 100%;
}
@media (min-width: 769px) {
& > .h3-section {
padding-top: 0;
}
}
}
/*
* Two column (default)
*/
.h3-section-list,
.h3-section-list.-two-column {
@media (min-width: 769px) {
& > .h3-section {
width: 50%;
}
}
}
/*
* One column
*/
.h3-section-list.-one-column {
& > .h3-section {
width: 100%;
}
& > .h3-section + .h3-section {
margin-top: 16px;
}
}
/*
* Three column
*/
.h3-section-list.-three-column {
@media (min-width: 769px) {
& > .h3-section {
width: 50%;
}
}
@media (min-width: 961px) {
& > .h3-section {
width: 33.33%;
}
}
}
/*
* Three column, left reference
*/
.h3-section-list.-left-reference {
@media (min-width: 769px) {
& > .h3-section {
width: 50%;
}
}
@media (min-width: 961px) {
& > .h3-section {
width: 66.67%;
}
& > .h3-section:first-child {
width: 33.33%;
}
}
}

View File

@ -1,63 +0,0 @@
/*
* Carbon ads
*
* .headline-ad
* #carbonads
* span
* span.carbon-wrap
* a.carbon-img > img
* a.carbon-text {description}
* a.carbon-poweredby {powered by Carbon}
*/
.HeadlineAd {
@include font-size(-1);
@include carbon-style;
& {
display: inline-block;
}
&,
& > div > span {
min-width: 130px + 16px + 64px;
max-width: 380px;
height: 100px;
}
& > div > span {
display: inline-block;
text-align: right;
}
// Clearfix
& > div > span::after {
content: '';
display: table;
clear: both;
zoom: 1;
}
.carbon-img {
float: right;
margin-left: 16px;
}
.carbon-text:first-line {
@include font-size(1);
color: $base-head;
font-weight: 300;
margin-bottom: -0.02em;
}
@media (min-width: 481px) {
.carbon-poweredby::before {
display: block;
content: '';
width: 32px;
height: 1px;
background: $dark-line-color;
margin: 8px (130px + 16px) 8px auto;
}
}
}

View File

@ -1,3 +0,0 @@
.push-button {
@extend %push-button;
}

View File

@ -1,49 +0,0 @@
.SideAd {
@include font-size(-1);
@include carbon-style;
@media (min-width: 961px) {
position: absolute;
right: 32px;
top: 80px;
width: 130px;
text-align: left;
.carbon-img {
margin-bottom: 16px;
}
}
.carbon-text:first-line {
color: $base-head;
font-weight: bold;
}
.carbon-poweredby::before {
display: block;
content: '';
width: 32px;
height: 1px;
background: $dark-line-color;
margin: 12px 0;
}
@media (max-width: 960px) {
& {
margin: 16px auto;
max-width: 300px;
}
&::after {
content: '';
display: table;
clear: both;
zoom: 1;
}
.carbon-img {
float: left;
margin-right: 16px;
}
}
}

View File

@ -1,44 +0,0 @@
.site-header {
margin: 32px 0;
& > p {
margin: 0;
padding: 0;
text-align: center;
color: $base-mute;
}
& > p > a {
text-decoration: none;
}
& > h1 {
@include font-size(8);
line-height: 1.2;
margin: 0;
padding: 0;
color: $base-head;
font-weight: 200;
text-align: center;
margin-bottom: 16px;
}
& > .search {
margin-top: 32px;
}
& > .action {
margin-top: 32px;
}
& > .adbox {
margin: 16px auto;
}
@media (max-width: 480px) {
& > .adbox {
margin-left: -16px;
margin-right: -16px;
}
}
}

View File

@ -1,29 +0,0 @@
.local-anchor {
& {
margin-left: -.9em;
margin-right: .1em;
padding: 0 .1em;
}
// Decoration
.MarkdownBody &,
.MarkdownBody &:visited {
color: $base-mute;
text-decoration: inherit;
opacity: .5;
}
.MarkdownBody &:target,
.MarkdownBody :target > & {
color: $base-a;
opacity: 1;
}
.MarkdownBody &:hover,
.MarkdownBody &:focus {
color: white;
background: $base-a;
opacity: 1;
text-decoration: inherit;
}
}

View File

@ -1,56 +0,0 @@
@import '../vendor/sanitize.css/sanitize';
@import './variables';
@import '../vendor/modularscale/modularscale';
@import '../vendor/ionicons-inline/ionicons';
@import './utils/carbon-style';
@import './utils/font-size';
@import './utils/gutter';
@import './utils/heading-style';
@import './utils/section-gutter';
@import './utils/section-with-container';
@import './placeholders/push-button';
@import './base/base';
@import './base/fade';
@import './markdown/a-em';
@import './markdown/code';
@import './markdown/headings';
@import './markdown/local-anchor';
@import './markdown/p';
@import './markdown/table';
@import './markdown/ul';
@import './components/attribute-peg';
@import './components/announcements-item';
@import './components/announcements-list';
@import './components/back-button';
@import './components/berry-sponsor';
@import './components/body-area';
@import './components/codefund-sponsor';
@import './components/comments-area';
@import './components/comments-details';
@import './components/comments-section';
@import './components/h2-section';
@import './components/h3-section';
@import './components/h3-section-list';
@import './components/headline-ad';
@import './components/hint-mark';
@import './components/home-button';
@import './components/intro-content';
@import './components/main-heading';
@import './components/missing-message';
@import './components/notice-box';
@import './components/page-actions';
@import './components/pages-list';
@import './components/pre-footer';
@import './components/push-button';
@import './components/related-posts-area';
@import './components/related-posts-callout';
@import './components/related-posts-group';
@import './components/related-posts-section';
@import './components/related-post-list';
@import './components/related-post-item';
@import './components/search-box';
@import './components/search-footer';
@import './components/side-ad';
@import './components/site-header';
@import './components/top-nav';
@import './components/top-sheet';

View File

@ -1,44 +0,0 @@
/*
* Base carbon ads style
*/
@mixin carbon-style {
.carbon-img,
.carbon-text,
.carbon-poweredby {
text-decoration: none;
display: block;
}
.carbon-img {
width: 130px;
height: 100px;
box-shadow: $shadow3;
}
.carbon-img > img {
border-radius: 3px;
background: white;
}
.carbon-img:hover {
transform: translate3d(0, -1px, 0);
box-shadow: $shadow6;
}
.carbon-text,
.carbon-text:visited {
color: $gray-text;
}
.carbon-poweredby,
.carbon-poweredby:visited {
color: lighten($gray-text, 20%);
}
.carbon-text:hover,
.carbon-poweredby:hover {
color: $base-a;
}
}

View File

@ -1,589 +0,0 @@
/*! sanitize.css v5.0.0 | CC0 License | github.com/jonathantneal/sanitize.css */
/* Document (https://html.spec.whatwg.org/multipage/semantics.html#semantics)
========================================================================== */
/**
* 1. Remove repeating backgrounds in all browsers (opinionated).
* 2. Add box sizing inheritence in all browsers (opinionated).
*/
*,
::before,
::after {
background-repeat: no-repeat; /* 1 */
box-sizing: inherit; /* 2 */
}
/**
* 1. Add text decoration inheritance in all browsers (opinionated).
* 2. Add vertical alignment inheritence in all browsers (opinionated).
*/
::before,
::after {
text-decoration: inherit; /* 1 */
vertical-align: inherit; /* 2 */
}
/**
* 1. Add border box sizing in all browsers (opinionated).
* 2. Add the default cursor in all browsers (opinionated).
* 3. Prevent font size adjustments after orientation changes in IE and iOS.
*/
html {
box-sizing: border-box; /* 1 */
cursor: default; /* 2 */
-ms-text-size-adjust: 100%; /* 3 */
-webkit-text-size-adjust: 100%; /* 3 */
}
/* Sections (https://html.spec.whatwg.org/multipage/semantics.html#sections)
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
article,
aside,
footer,
header,
nav,
section {
display: block;
}
/**
* Remove the margin in all browsers (opinionated).
*/
body {
margin: 0;
}
/**
* Correct the font size and margin on `h1` elements within `section` and
* `article` contexts in Chrome, Firefox, and Safari.
*/
h1 {
font-size: 2em;
margin: .67em 0;
}
/* Grouping content (https://html.spec.whatwg.org/multipage/semantics.html#grouping-content)
========================================================================== */
/**
* Add the correct display in IE 9-.
* 1. Add the correct display in IE.
*/
figcaption,
figure,
main { /* 1 */
display: block;
}
/**
* Add the correct margin in IE 8.
*/
figure {
margin: 1em 40px;
}
/**
* 1. Add the correct box sizing in Firefox.
* 2. Show the overflow in Edge and IE.
*/
hr {
box-sizing: content-box; /* 1 */
height: 0; /* 1 */
overflow: visible; /* 2 */
}
/**
* Remove the list style on navigation lists in all browsers (opinionated).
*/
nav ol,
nav ul {
list-style: none;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
pre {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/* Text-level semantics (https://html.spec.whatwg.org/multipage/semantics.html#text-level-semantics)
========================================================================== */
/**
* 1. Remove the gray background on active links in IE 10.
* 2. Remove gaps in links underline in iOS 8+ and Safari 8+.
*/
a {
background-color: transparent; /* 1 */
-webkit-text-decoration-skip: objects; /* 2 */
}
/**
* 1. Remove the bottom border in Firefox 39-.
* 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari.
*/
abbr[title] {
border-bottom: none; /* 1 */
text-decoration: underline; /* 2 */
text-decoration: underline dotted; /* 2 */
}
/**
* Prevent the duplicate application of `bolder` by the next rule in Safari 6.
*/
b,
strong {
font-weight: inherit;
}
/**
* Add the correct font weight in Chrome, Edge, and Safari.
*/
b,
strong {
font-weight: bolder;
}
/**
* 1. Correct the inheritance and scaling of font size in all browsers.
* 2. Correct the odd `em` font sizing in all browsers.
*/
code,
kbd,
samp {
font-family: monospace, monospace; /* 1 */
font-size: 1em; /* 2 */
}
/**
* Add the correct font style in Android 4.3-.
*/
dfn {
font-style: italic;
}
/**
* Add the correct background and color in IE 9-.
*/
mark {
background-color: #ffff00;
color: #000000;
}
/**
* Add the correct font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` elements from affecting the line height in
* all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sub {
bottom: -.25em;
}
sup {
top: -.5em;
}
/*
* Remove the text shadow on text selections (opinionated).
* 1. Restore the coloring undone by defining the text shadow (opinionated).
*/
::-moz-selection {
background-color: #b3d4fc; /* 1 */
color: #000000; /* 1 */
text-shadow: none;
}
::selection {
background-color: #b3d4fc; /* 1 */
color: #000000; /* 1 */
text-shadow: none;
}
/* Embedded content (https://html.spec.whatwg.org/multipage/embedded-content.html#embedded-content)
========================================================================== */
/*
* Change the alignment on media elements in all browers (opinionated).
*/
audio,
canvas,
iframe,
img,
svg,
video {
vertical-align: middle;
}
/**
* Add the correct display in IE 9-.
*/
audio,
video {
display: inline-block;
}
/**
* Add the correct display in iOS 4-7.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Remove the border on images inside links in IE 10-.
*/
img {
border-style: none;
}
/**
* Change the fill color to match the text color in all browsers (opinionated).
*/
svg {
fill: currentColor;
}
/**
* Hide the overflow in IE.
*/
svg:not(:root) {
overflow: hidden;
}
/* Tabular data (https://html.spec.whatwg.org/multipage/tables.html#tables)
========================================================================== */
/**
* Collapse border spacing
*/
table {
border-collapse: collapse;
}
/* Forms (https://html.spec.whatwg.org/multipage/forms.html#forms)
========================================================================== */
/**
* Remove the margin in Firefox and Safari.
*/
button,
input,
optgroup,
select,
textarea {
margin: 0;
}
/**
* Inherit styling in all browsers (opinionated).
*/
button,
input,
select,
textarea {
background-color: transparent;
color: inherit;
font-size: inherit;
line-height: inherit;
}
/**
* Show the overflow in IE.
* 1. Show the overflow in Edge.
*/
button,
input { /* 1 */
overflow: visible;
}
/**
* Remove the inheritance of text transform in Edge, Firefox, and IE.
* 1. Remove the inheritance of text transform in Firefox.
*/
button,
select { /* 1 */
text-transform: none;
}
/**
* 1. Prevent a WebKit bug where (2) destroys native `audio` and `video`
* controls in Android 4.
* 2. Correct the inability to style clickable types in iOS and Safari.
*/
button,
html [type="button"], /* 1 */
[type="reset"],
[type="submit"] {
-webkit-appearance: button; /* 2 */
}
/**
* Remove the inner border and padding in Firefox.
*/
button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
border-style: none;
padding: 0;
}
/**
* Restore the focus styles unset by the previous rule.
*/
button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
outline: 1px dotted ButtonText;
}
/**
* 1. Correct the text wrapping in Edge and IE.
* 2. Correct the color inheritance from `fieldset` elements in IE.
* 3. Remove the padding so developers are not caught out when they zero out
* `fieldset` elements in all browsers.
*/
legend {
box-sizing: border-box; /* 1 */
color: inherit; /* 2 */
display: table; /* 1 */
max-width: 100%; /* 1 */
padding: 0; /* 3 */
white-space: normal; /* 1 */
}
/**
* 1. Add the correct display in IE 9-.
* 2. Add the correct vertical alignment in Chrome, Firefox, and Opera.
*/
progress {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* 1. Remove the default vertical scrollbar in IE.
* 2. Change the resize direction on textareas in all browsers (opinionated).
*/
textarea {
overflow: auto; /* 1 */
resize: vertical; /* 2 */
}
/**
* 1. Add the correct box sizing in IE 10-.
* 2. Remove the padding in IE 10-.
*/
[type="checkbox"],
[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Correct the cursor style of increment and decrement buttons in Chrome.
*/
[type="number"]::-webkit-inner-spin-button,
[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Correct the odd appearance in Chrome and Safari.
* 2. Correct the outline style in Safari.
*/
[type="search"] {
-webkit-appearance: textfield; /* 1 */
outline-offset: -2px; /* 2 */
}
/**
* Remove the inner padding and cancel buttons in Chrome and Safari on macOS.
*/
[type="search"]::-webkit-search-cancel-button,
[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* 1. Correct the inability to style clickable types in iOS and Safari.
* 2. Change font properties to `inherit` in Safari.
*/
::-webkit-file-upload-button {
-webkit-appearance: button; /* 1 */
font: inherit; /* 2 */
}
/* Interactive elements (https://html.spec.whatwg.org/multipage/forms.html#interactive-elements)
========================================================================== */
/*
* Add the correct display in IE 9-.
* 1. Add the correct display in Edge, IE, and Firefox.
*/
details, /* 1 */
menu {
display: block;
}
/*
* Add the correct display in all browsers.
*/
summary {
display: list-item;
}
/* Scripting (https://html.spec.whatwg.org/multipage/scripting.html#scripting-3)
========================================================================== */
/**
* Add the correct display in IE 9-.
*/
canvas {
display: inline-block;
}
/**
* Add the correct display in IE.
*/
template {
display: none;
}
/* User interaction (https://html.spec.whatwg.org/multipage/interaction.html#editing)
========================================================================== */
/*
* Remove the tapping delay on clickable elements (opinionated).
* 1. Remove the tapping delay in IE 10.
*/
a,
area,
button,
input,
label,
select,
summary,
textarea,
[tabindex] {
-ms-touch-action: manipulation; /* 1 */
touch-action: manipulation;
}
/**
* Add the correct display in IE 10-.
*/
[hidden] {
display: none;
}
/* ARIA (https://w3c.github.io/html-aria/)
========================================================================== */
/**
* Change the cursor on busy elements (opinionated).
*/
[aria-busy="true"] {
cursor: progress;
}
/*
* Change the cursor on control elements (opinionated).
*/
[aria-controls] {
cursor: pointer;
}
/*
* Change the display on visually hidden accessible elements (opinionated).
*/
[aria-hidden="false"][hidden]:not(:focus) {
clip: rect(0, 0, 0, 0);
display: inherit;
position: absolute;
}
/*
* Change the cursor on disabled, not-editable, or otherwise
* inoperable elements (opinionated).
*/
[aria-disabled] {
cursor: default;
}

View File

@ -1,16 +0,0 @@
#!/usr/bin/env bash
(
echo https://devhints.io/
(
git ls-files \
| grep -E '\.md$' \
| grep -v -E 'CONTRIBUTING|README|Readme' \
| grep -v -E '^_' \
| sort \
| uniq \
| sed 's/\.md$//g'
) \
| sed 's#^#https://devhints.io/#g'
) \
| xargs curl >/dev/null

View File

@ -1,23 +0,0 @@
#!/usr/bin/env bash
# Helper to copy the latest cheatsheets to the clipboard for CloudFlare
# purging. This ensures visitors will see new versions.
(
git log "master@{3 days ago}..HEAD" --pretty="" --name-only \
| grep -E '\.md$' \
| grep -v -E 'CONTRIBUTING|README|Readme' \
| grep -v -E '^_' \
| sort \
| uniq \
| sed 's/\.md$//g'
) \
| sed 's#^#https://devhints.io/#g' \
| xargs echo https://devhints.io/ \
| pbcopy
echo "Copied to clipboard."
echo "Purge it here:"
echo ""
echo " https://www.cloudflare.com/a/caching/devhints.io"
echo ""
echo "Then click 'Purge Individual Files'"

View File

@ -1,45 +0,0 @@
const critical = require('critical')
console.warn('Generating critical path styles into _includes/2017/critical/...')
const OPTIONS = {
base: '_site',
width: 1400,
height: 900,
minify: true,
extract: true,
ignore: [
'@font-face'
],
include: [
// fade-in magic (base/fade)
/html\.WithJs/
]
}
critical.generate({
...OPTIONS,
src: 'index.html',
dest: '../_includes/2017/critical/home.css',
include: [
...OPTIONS.include,
// searchbox with placeholder
/\.search-box/
]
})
critical.generate({
...OPTIONS,
src: 'react.html',
dest: '../_includes/2017/critical/sheet.css',
include: [
...OPTIONS.include,
// sections (and h3 section list), just to be sure
/\.h3-section/,
// eg, -six-column in devhints.io/layout-thrashing
/-column/
]
})

View File

@ -1,73 +0,0 @@
const join = require('path').resolve
const webpack = require('webpack')
module.exports = {
context: join(__dirname, '..'),
entry: {
app: './_js/app.js',
vendor: [
// Large 3rd-party libs
'prismjs',
// Prism plugins
'prismjs/plugins/line-highlight/prism-line-highlight.min.js',
'prismjs/components/prism-jsx.min.js',
'prismjs/components/prism-bash.min.js',
'prismjs/components/prism-scss.min.js',
'prismjs/components/prism-css.min.js',
'prismjs/components/prism-elixir.min.js',
'prismjs/components/prism-ruby.min.js',
// CSS
'prismjs/plugins/line-highlight/prism-line-highlight.css',
'hint.css/hint.min.css'
]
},
output: {
path: join(__dirname, '..', 'assets', 'packed'),
filename: '[name].js',
devtoolModuleFilenameTemplate: 'webpack:///[absolute-resource-path]'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{ loader: 'babel-loader' }
]
},
{
test: /\.css$/,
use: [
{ loader: 'style-loader' },
{ loader: 'css-loader' }
]
}
]
},
resolve: {
alias: {
// Never bundle jQuery
'jquery': join(__dirname, '..', '_js/helpers/noop.js')
}
},
stats: 'minimal',
plugins: [
// Optimize module ID's for vendor chunks
new webpack.HashedModuleIdsPlugin({
hashFunction: 'sha256',
hashDigest: 'base64',
hashDigestLength: 20
}),
// Optimize vendor
new webpack.optimize.CommonsChunkPlugin('vendor'),
// Don't include debug symbols ever
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
})
],
devtool: 'source-map'
}

View File

@ -1,28 +0,0 @@
const join = require('path').resolve
const webpack = require('webpack')
module.exports = {
context: join(__dirname, '..'),
entry: './_js/critical.js',
output: {
path: join(__dirname, '..', '_includes', '2017', 'critical'),
filename: 'critical.js'
},
module: {
rules: [
{
test: /\.js$/,
exclude: /node_modules/,
use: [
{ loader: 'babel-loader' }
]
}
]
},
stats: 'minimal',
plugins: [
new webpack.EnvironmentPlugin({
NODE_ENV: 'production'
})
]
}

View File

@ -1,7 +1,6 @@
---
title: Absinthe
category: Hidden
layout: 2017/sheet
tags: [WIP]
updated: 2017-10-10
intro: |

View File

@ -1,7 +1,6 @@
---
title: ActiveAdmin
category: Ruby
layout: 2017/sheet
---
### Listing scopes

1
adb.md
View File

@ -1,7 +1,6 @@
---
title: adb (Android Debug Bridge)
category: CLI
layout: 2017/sheet
weight: -1
authors:
- github: ZackNeyland

View File

@ -1,7 +1,6 @@
---
title: Google Analytics's analytics.js
category: Analytics
layout: 2017/sheet
updated: 2017-10-29
intro: |
Google Analytics's analytics.js is deprecated.

View File

@ -1,6 +1,6 @@
---
title: Analytics libraries
layout: 2017/sheet
category: Analytics
---
### Mixpanel

View File

@ -1,7 +1,18 @@
---
title: Angular.js
category: JavaScript libraries
tags: [Archived]
archived: This describes an older version of Angular.
---
### About
{: .-intro}
* <https://github.com/angular/angular-seed>
* <https://angularjs.org/>
### ng-app
```html
   <html ng-app="nameApp">
```
@ -88,7 +99,3 @@ In HTML will use `<name></name>` to render your template `<h1>Hello</h1>`
})
   });
```
References:
* https://github.com/angular/angular-seed
* https://angularjs.org/

View File

@ -1,7 +1,6 @@
---
title: Animated GIFs
category: CLI
layout: 2017/sheet
---
## Animated GIFs

62
ansi.md
View File

@ -1,41 +1,51 @@
---
title: Ansi codes
category: CLI
intro: |
Quick reference to ANSI color codes.
---
Format
### Format
\033[#m
```
\033[#m
```
Where:
### ANSI codes
0 clear
1 bold
4 underline
5 blink
```
0 clear
1 bold
4 underline
5 blink
30-37 fg color
40-47 bg color
30-37 fg color
40-47 bg color
1K clear line (to beginning of line)
2K clear line (entire line)
2J clear screen
0;0H move cursor to 0;0
1K clear line (to beginning of line)
2K clear line (entire line)
2J clear screen
0;0H move cursor to 0;0
1A move up 1 line
1A move up 1 line
```
Colors
### Colors
0 black
1 red
2 green
3 yellow
4 blue
5 magenta
6 cyan
7 white
```
0 black
1 red
2 green
3 yellow
4 blue
5 magenta
6 cyan
7 white
```
Stuff
### Bash utilities
hide_cursor() { printf "\e[?25l"; }
show_cursor() { printf "\e[?25h"; }
```sh
hide_cursor() { printf "\e[?25l"; }
show_cursor() { printf "\e[?25h"; }
```

View File

@ -1,7 +1,6 @@
---
title: Ansible examples
category: Ansible
layout: 2017/sheet
---
### Examples

View File

@ -1,7 +1,6 @@
---
title: "Ansible quickstart"
category: Ansible
layout: 2017/sheet
description: |
A quick guide to getting started with your first Ansible playbook.
---
@ -45,7 +44,7 @@ See: [Getting started](http://docs.ansible.com/ansible/latest/intro_getting_star
This is a list of hosts you want to manage, grouped into groups. (Hint: try
using `localhost ansible_connection=local` to deploy to your local machine.)
See: [Intro to Inventory](http://docs.ansible.com/ansible/latest/playbooks_intro.html)
See: [Intro to Inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html)
### Playbook
@ -68,7 +67,7 @@ See: [Intro to Inventory](http://docs.ansible.com/ansible/latest/playbooks_intro
gem: name=bundler state=latest
```
See: [Intro to Playbooks](http://docs.ansible.com/ansible/latest/intro_inventory.html)
See: [Intro to Playbooks](http://docs.ansible.com/ansible/latest/playbooks_intro.html)
## Running
@ -103,3 +102,5 @@ ok: [127.0.0.1]
* [Getting started](http://docs.ansible.com/ansible/latest/intro_getting_started.html) _(docs.ansible.com)_
* [Intro to Inventory](http://docs.ansible.com/ansible/latest/intro_inventory.html) _(docs.ansible.com)_
* [Intro to Playbooks](http://docs.ansible.com/ansible/latest/playbooks_intro.html) _(docs.ansible.com)_
* [Ansible Tutorial for Beginners: Playbook & Examples](https://spacelift.io/blog/ansible-tutorial) _(spacelift.io)_
* [Working with Ansible Playbooks Tips & Tricks with Examples](https://spacelift.io/blog/ansible-playbooks) _(spacelift.io)_

View File

@ -1,7 +1,6 @@
---
title: Ansible modules
category: Ansible
layout: 2017/sheet
prism_languages: [yaml]
updated: 2017-10-03
---
@ -97,7 +96,7 @@ Define your tasks in any of these formats. One-line format is preferred for shor
bare: yes
```
See: [git module](http://devdocs.io/ansible/git_module)
See: [git module](https://devdocs.io/ansible/git_module)
### git_config
@ -108,7 +107,7 @@ See: [git module](http://devdocs.io/ansible/git_module)
value: hi@example.com
```
See: [git_config module](http://devdocs.io/ansible/git_config_module)
See: [git_config module](https://devdocs.io/ansible/git_config_module)
### user
@ -122,7 +121,7 @@ See: [git_config module](http://devdocs.io/ansible/git_config_module)
comment: "Git Version Control"
```
See: [user module](http://devdocs.io/ansible/user_module)
See: [user module](https://devdocs.io/ansible/user_module)
### service
@ -133,7 +132,7 @@ See: [user module](http://devdocs.io/ansible/user_module)
enabled: yes # optional
```
See: [service module](http://devdocs.io/ansible/service_module)
See: [service module](https://devdocs.io/ansible/service_module)
## Shell
@ -161,7 +160,7 @@ See: [service module](http://devdocs.io/ansible/service_module)
echo "multiple lines"
```
See: [shell module](http://devdocs.io/ansible/shell_module)
See: [shell module](https://devdocs.io/ansible/shell_module)
### script
@ -173,7 +172,7 @@ See: [shell module](http://devdocs.io/ansible/shell_module)
chdir: /path # cd here before running
```
See: [script module](http://devdocs.io/ansible/script_module)
See: [script module](https://devdocs.io/ansible/script_module)
## Files
@ -192,7 +191,7 @@ See: [script module](http://devdocs.io/ansible/script_module)
force: yes # ln -nfs
```
See: [file module](http://devdocs.io/ansible/file_module)
See: [file module](https://devdocs.io/ansible/file_module)
### copy
@ -208,7 +207,7 @@ See: [file module](http://devdocs.io/ansible/file_module)
backup: yes
```
See: [copy module](http://devdocs.io/ansible/copy_module)
See: [copy module](https://devdocs.io/ansible/copy_module)
### template
@ -224,7 +223,7 @@ See: [copy module](http://devdocs.io/ansible/copy_module)
backup: yes
```
See: [template module](http://devdocs.io/ansible/template_module)
See: [template module](https://devdocs.io/ansible/template_module)
## Local actions
@ -242,6 +241,6 @@ See: [template module](http://devdocs.io/ansible/template_module)
msg: "Hello {{ var }}"
```
See: [debug module](http://devdocs.io/ansible/debug_module)
See: [debug module](https://devdocs.io/ansible/debug_module)
{% endraw %}

View File

@ -1,7 +1,6 @@
---
title: Ansible roles
category: Ansible
layout: 2017/sheet
---
### Structure

View File

@ -7,6 +7,11 @@ category: Ansible
## Getting started
### About
{: .-intro}
- <https://www.ansible.com/>
### Hosts
$ sudo mkdir /etc/ansible
@ -20,7 +25,9 @@ category: Ansible
$ ansible-playbook playbook.yml
## Tasks
## Playbook files
### Tasks
- hosts: all
user: root
@ -39,7 +46,7 @@ category: Ansible
handlers:
- include: db.yml user=timmy
## Handlers
### Handlers
handlers:
- name: start apache2
@ -51,7 +58,7 @@ category: Ansible
notify:
- start apache2
## Vars
### Vars
- host: lol
vars_files:
@ -63,7 +70,7 @@ category: Ansible
file: state=directory path=${project_root}/home/.ssh/
only_if: "$vm == 0"
## Roles
### Roles
- host: xxx
roles:
@ -91,9 +98,4 @@ category: Ansible
vars:
local_home: "{{ lookup('env','HOME') }}"
## References
* [Intro](http://www.ansibleworks.com/docs/intro_configuration.html)
* [Modules](http://www.ansibleworks.com/docs/modules.html)
{% endraw %}

View File

@ -1,7 +1,6 @@
---
title: Appcache
category: HTML
layout: 2017/sheet
---
### Format
@ -11,7 +10,7 @@ CACHE MANIFEST
# version
CACHE:
http://www.google.com/jsapi
https://www.google.com/jsapi
/assets/app.js
/assets/bg.png

View File

@ -1,7 +1,6 @@
---
title: AppleScript
updated: 2018-03-17
layout: 2017/sheet
updated: 2018-12-06
category: macOS
prism_languages: [applescript]
---
@ -57,3 +56,20 @@ beep
-- beep 10 times
beep 10
```
### Delay
```applescript
-- delay for 5 seconds
delay 5
```
### Handlers
```applescript
on doubleNumber(n)
return n * 2
end doubleNumber
set doubledValue to my doubleNumber(2)
```

View File

@ -3,6 +3,11 @@ title: Applinks
category: HTML
---
### About
- <http://applinks.org/>
### Applinks
<meta property="al:ios:url" content="applinks://docs" />
<meta property="al:ios:app_store_id" content="12345" />

11
arel.md
View File

@ -3,6 +3,13 @@ title: Arel
category: Rails
---
### About
{: .-intro}
Arel is an SQL abstraction library built into Ruby on Rails.
* <https://github.com/rails/arel>
### Tables
```rb
@ -123,7 +130,3 @@ all_time = photos_with_credits.count
this_month = photos_with_credits.where(photos[:created_at].gteq(Date.today.beginning_of_month))
recent_photos = photos_with_credits.where(photos[:created_at].gteq(Date.today.beginning_of_month)).limit(5)
```
## Reference
* <http://github.com/rails/arel>

View File

@ -1,4 +0,0 @@
---
type: other
---
@import '2017/style.scss';

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,48 +0,0 @@
.site-header, .social-list, .about-the-site,
#see-also, #see-also+ul {
display: none;
}
/*.post-headline.-cheatsheet .prelude span:before {
content: 'cheatsheet for'
}*/
.post-list {
margin: 0;
padding-top: 0;
padding-bottom: 0;
}
.post-item {
max-width: 100%;
}
.post-headline.-cheatsheet .prelude {
max-width: 300px;
}
.post-headline, p.prelude {
margin-top: 0;
}
.post-headline.-cheatsheet .prelude {
font-size: 0.6em;
letter-spacing: 1px;
}
.post-headline {
margin-bottom: 1.5em;
}
.post-headline.-cheatsheet .prelude span {
padding: 0.75em 20px;
border-bottom: solid 1.5px #111;
}
.post-headline.-cheatsheet h1 {
font-size: 1.75em;
text-shadow: none;
}
pre {
border-top: solid 1px #ddd;
border-bottom: solid 1px #ddd;
background: none;
}
h3 {
margin: 1em 0;
}
pre {
margin-top: 1.1em;
margin-bottom: 1.1em;
}

View File

@ -1,43 +0,0 @@
(function () {
var tags = document.querySelectorAll('h1,h2,h3,h4,h5,h6,li,p,span');
for (var i=0, len=tags.length; i<len; i++) {
var tag = tags[i];
if ((~tag.innerHTML.indexOf('>') ||
(!tag.innerHTML.match(/https?:\/\//))))
continue;
tag.innerHTML = tag.innerHTML.replace(/https?:\/\/[^ ]*/g, function (url) {
url = url.replace(/[\.\),!]*$/, '');
var label = url;
label = label.replace(/^https?:\/\//, '')
.replace(/\/$/, '');
return "<a href='"+url+"'>"+label+"</a>";
});
}
})();
/* unorphan */
(function () {
var els = document.querySelectorAll('h1 a, h1, h2, p.brief-intro, .pull-quote');
for (var i = 0, len = els.length; i < len; i++) {
var el = els[i];
var last = el.lastChild;
if (last && last.nodeType === 3) {
console.log('=>', last.nodeValue, last.nodeValue.replace(/\s+([^\s]+\s*)$/g, '\xA0$1'));
last.nodeValue = last.nodeValue.replace(/\s+([^\s]+\s*)$/g, '\xA0$1');
}
}
})();
/* loaded */
document.documentElement.className += ' loaded';
/* hljs */
(function () {
var codes = document.querySelectorAll('pre > code');
for (var i = 0, len = codes.length; i < len; i++) {
var block = codes[i];
hljs.highlightBlock(block);
}
})();

View File

@ -1,292 +0,0 @@
/*
* pages list
*/
.pages-list {
font-size: 0.9em;
max-width: 800px;
margin: 60px auto;
overflow: hidden;
}
.pages-list a {
display: block;
padding: 6px 0;
text-align: left;
float: left;
width: 44%;
margin: 0 3%;
box-shadow: none;
transition: all 100ms linear;
}
.pages-list a .title,
.pages-list a .date {
display: block;
}
.pages-list a .title {
font-weight: bold;
color: #111;
float: left;
}
.pages-list a .date {
color: #aaa;
font-size: 0.9em;
float: right;
}
.pages-list a:hover .title,
.pages-list a:focus .title {
color: dodgerblue;
}
/*
* post headline
*/
.post-headline.-cheatsheet .prelude {
color: #111;
font-size: 0.85em;
text-transform: uppercase;
letter-spacing: 2px;
margin-bottom: 0;
font-weight: bold;
}
.post-headline.-cheatsheet .prelude span {
border-bottom: solid 3px #111;
padding: 1.5em 20px;
}
.post-headline.-cheatsheet .prelude span:before {
content: 'Cheatsheet for';
}
@media (min-width: 769px) {
.post-headline.-cheatsheet .prelude {
max-width: 230px;
margin-left: auto;
margin-right: auto;
}
.post-headline.-cheatsheet .prelude span {
display: inline-block;
}
}
.post-headline.-cheatsheet h1 {
color: #111;
font-size: 3.5em;
text-shadow:
2px 2px 0 white,
3px 3px 0 #ddd;
}
/*
* about the site
*/
.about-the-site {
margin-top: 8em;
}
.about-the-site .back {
margin-right: 0;
}
/*
* markdown
*/
@media (min-width: 768px) {
h2 {
margin-top: 3em;
}
}
/*
* grey code
*/
.greycode td:first-child code,
.greycode th:first-child code {
background: white;
padding: 6px 8px 5px 8px;
border-radius: 3px;
}
.greycode td:first-child code + em,
.greycode th:first-child code + em {
color: #808890;
font-size: 0.9em;
margin: 0 5px;
}
.greycode a {
margin: 0 5px;
}
@media (min-width: 768px) {
table.greycode {
background: #fcfcfc;
border-radius: 4px;
border-top: 0;
border-bottom: solid 1px #c7d7ee;
}
table.greycode:not(.wide) {
width: calc(620px + 100px);
margin-left: -50px;
}
table.greycode thead:first-child > tr:first-child > th,
table.greycode thead:first-child > tr:first-child > td,
table.greycode tbody:first-child > tr:first-child > th,
table.greycode tbody:first-child > tr:first-child > td,
table.greycode.no-head thead:nth-child(2) > tr:first-child > th,
table.greycode.no-head thead:nth-child(2) > tr:first-child > td,
table.greycode.no-head tbody:nth-child(2) > tr:first-child > th,
table.greycode.no-head tbody:nth-child(2) > tr:first-child > td {
border-top: 0;
}
table.greycode thead > tr:first-child > th,
table.greycode thead > tr:first-child > td,
table.greycode tbody > tr:first-child > th,
table.greycode tbody > tr:first-child > td {
border-top: solid 1px #c7d7ee;
}
table.greycode td:first-child,
table.greycode th:first-child {
padding-left: 50px;
}
table.greycode td:last-child,
table.greycode th:last-child {
padding-right: 50px;
}
}
.hljs-comment {
font-style: normal;
}
.key-codes code {
background: #fdfdff;
padding: 3px 8px 3px 8px;
border-radius: 3px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
margin: 0 5px;
}
.key-codes code + code {
margin-left: 0;
}
.key-codes pre code {
background: transparent;
padding: 0;
box-shadow: none;
margin: 0;
}
/*
* Carbon: side
*/
.side-ad {
position: absolute;
top: 80px;
right: 20px;
width: 130px;
display: block;
font-size: .8em;
}
.side-ad a {
text-decoration: none;
box-shadow: none;
background: rgba(255, 255, 255, .01);
}
.side-ad a:hover {
color: #111;
}
.side-ad .carbon-text {
margin-top: 5px;
display: block;
}
.side-ad .carbon-poweredby {
display: block;
color: #aaa;
}
@media (max-width: 768px) {
.side-ad {
display: none;
}
}
/*
* Cardbon: headline
*/
.headline-ad {
width: 300px;
min-height: 100px;
font-size: .8em;
margin: 0 auto 45px auto;
line-height: 1.5;
}
.headline-ad:after {
content: '';
display: table;
clear: both;
zoom: 1;
}
.headline-ad a {
text-decoration: none;
box-shadow: none;
display: block;
background: rgba(255, 255, 255, .01);
}
.headline-ad a:hover {
color: #111;
}
.headline-ad img {
float: left;
margin-right: 15px;
background: #fafafa;
}
.headline-ad .carbon-text {
}
.headline-ad .carbon-poweredby {
display: block;
color: #aaa;
margin-top: 5px;
}
.social-list.-collapse {
margin-top: 0;
position: absolute;
top: 40vh;
left: 30px;
width: 32px;
}
@media (max-width: 480px) {
.social-list.-collapse {
display: none;
}
}

34
astro.config.mjs Normal file
View File

@ -0,0 +1,34 @@
import { defineConfig } from 'astro/config'
import partytown from '@astrojs/partytown'
/*
* https://astro.build/config
*/
import tailwind from '@astrojs/tailwind'
// https://astro.build/config
export default defineConfig({
site: 'https://devhints.io',
build: {
format: 'file' /* generate /my-post.html instead of /my-post/index.html */,
inlineStylesheets: 'always'
},
prefetch: {
prefetchAll: true
},
server: {
host: true
} /* access from https://192.168.x.x/ */,
integrations: [
partytown({
config: {
forward: ['dataLayer.push']
}
}),
tailwind()
],
markdown: {
// Syntax highlighting is handled by render()
syntaxHighlight: false
}
})

102
atom.md
View File

@ -1,53 +1,55 @@
---
title: Atom
category: Apps
layout: 2017/sheet
updated: 2017-09-20
updated: 2021-09-10
---
Shortcuts
---------
## Shortcuts
{: .-three-column}
### Tree
| Shortcut | Description |
| --- | --- |
| `⌘\` | Toggle tree |
| `⌘⇧\` | Reveal current file |
| Shortcut | Description |
| -------- | ------------------- |
| `⌘\` | Toggle tree |
| `⌘⇧\` | Reveal current file |
{: .-shortcuts}
### Comments
| Shortcut | Description |
| --- | --- |
| `⌘/` | Toggle comments |
| Shortcut | Description |
| -------- | --------------- |
| `⌘/` | Toggle comments |
{: .-shortcuts}
### View
| Shortcut | Description |
| --- | --- |
| `⌘k` `←` | Split pane to the left |
| --- | --- |
| `⌘⌥=` | Grow pane |
| `⌘⌥-` | Shrink pane |
| --- | --- |
| `^⇧←` | Move tab to left |
| Shortcut | Description |
| -------- | ---------------------- |
| `⌘k` `←,→,↑,↓` | Split pane to the left, right, up, or down |
| --- | --- |
| `⌘⌥=` | Grow pane |
| `⌘⌥-` | Shrink pane |
| --- | --- |
| `^⇧←`/`^⇧→` | Move tab to left/right |
{: .-shortcuts}
### Bracket matcher
| `^m` | Go to matching bracket |
| `^]` | Remove brackets from selection |
| `^⌘m` | Select inside brackets |
| `⌥⌘.` | Close tag |
| Shortcut | Description |
| -------- | ------------------------------ |
| `^m` | Go to matching bracket |
| `^⌫` | Remove brackets from selection |
| `^⌘m` | Select inside brackets |
| `⌥⌘.` | Close tag |
{: .-shortcuts}
### Symbols view
| `^⌥↓` | Jump to declaration under cursor |
| `^⇧r` | Show tags |
| Shortcut | Description |
| -------- | -------------------------------- |
| `⌥⌘↓` | Jump to declaration under cursor |
| `^⇧r` | Show tags |
{: .-shortcuts}
Symbols view enables Ctags support for Atom.
@ -56,40 +58,42 @@ See: [Symbols view](https://atom.io/packages/symbols-view)
### Git
| Shortcut | Description |
| -------- | ------------------------------ |
| `^⇧9` | Show Git pane |
| `^⇧8` | Show GitHub pane |
{: .-shortcuts}
### Editing
| Shortcut | Description
| --- | ---
| `⌘d` | Select word
| `⌘l` | Select line
| --- | ---
| `⌘↓` | Move line down
| `⌘↑` | Move line up
| --- | ---
| `⌘⏎` | New line below
| `⌘⇧⏎` | New line above
| --- | ---
| `⌘⇧k` | Delete line
| `⌘⇧d` | Duplicate line
| Shortcut | Description |
| -------- | -------------- |
| `⌘d` | Select word |
| `⌘l` | Select line |
| --- | --- |
| `^⌘↑` | Move line up |
| `^⌘↓` | Move line down |
| --- | --- |
| `⌘⏎` | New line below |
| `⌘⇧⏎` | New line above |
| --- | --- |
| `^⇧k` | Delete line |
| `⌘⇧d` | Duplicate line |
{: .-shortcuts}
### Project
| Shortcut | Description
| --- | ---
| `⌘⇧p` | Command palette
| `⌘⇧a` | Add project folder
| --- | ---
| `⌘n` | New file
| `⌘⇧n` | New window
| --- | ---
| `⌘f` | Find in file
| `⌘⇧f` | Find in project
| `⌘t` | Search files in project
| Shortcut | Description |
| -------- | ----------------------- |
| `⌘⇧p` | Command palette |
| `⌘⇧o` | Add project folder |
| --- | --- |
| `⌘n` | New file |
| `⌘⇧n` | New window |
| --- | --- |
| `⌘f` | Find in file |
| `⌘⇧f` | Find in project |
| `⌘t` | Search files in project |
{: .-shortcuts}
## Notes

View File

@ -1,8 +1,7 @@
---
title: Awesome Redux
category: React
layout: 2017/sheet
updated: 2017-08-30
updated: 2017-11-19
---
### redux-actions

View File

@ -1,7 +1,6 @@
---
title: AWS CLI
category: Devops
layout: 2017/sheet
---
### EC2
@ -9,6 +8,7 @@ layout: 2017/sheet
```
aws ec2 describe-instances
aws ec2 start-instances --instance-ids i-12345678c
aws ec2 terminate-instances --instance-ids i-12345678c
```
### S3
@ -37,6 +37,13 @@ brew install awscli
aws configure
```
### Configuration profiles
```
aws configure --profile project1
aws configure --profile project2
```
## Elastic Beanstalk
### Configuration
@ -48,15 +55,15 @@ aws configure
eb config
```
See: <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html>
See: <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/command-options.html>
## ebextensions
* <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html>
* <http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html>
* <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers.html>
* <https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/customize-containers-ec2.html>
## Also see
* [AWS CLI](https://aws.amazon.com/cli/)
* [Documentation](http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
* [All commands](http://docs.aws.amazon.com/cli/latest/reference/#available-services)
* [Documentation](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-welcome.html)
* [All commands](https://docs.aws.amazon.com/cli/latest/reference/#available-services)

View File

@ -1,7 +1,7 @@
---
title: Backbone.js
layout: 2017/sheet
updated: 2017-09-04
updated: 2018-12-06
category: JavaScript libraries
---
### Binding events

102
badges.md
View File

@ -1,102 +0,0 @@
---
title: Code badges
---
Here are some badges for open source projects.
### Badge markdown
Travis
[![Status](https://travis-ci.org/rstacruz/REPO.svg?branch=master)](https://travis-ci.org/rstacruz/REPO)
CodeClimate (shields.io)
[![CodeClimate](http://img.shields.io/codeclimate/github/rstacruz/REPO.svg?style=flat)](https://codeclimate.com/github/rstacruz/REPO
"CodeClimate")
Coveralls (shields.io)
[![Coveralls](http://img.shields.io/coveralls/rstacruz/REPO.svg?style=flat)](https://coveralls.io/r/rstacruz/REPO)
Travis (shields.io)
[![Status](http://img.shields.io/travis/rstacruz/REPO/master.svg?style=flat)](https://travis-ci.org/rstacruz/REPO "See test builds")
NPM (shields.io)
[![npm version](http://img.shields.io/npm/v/REPO.svg?style=flat)](https://npmjs.org/package/REPO "View this project on npm")
Ruby gem (shields.io)
[![Gem](https://img.shields.io/gem/v/GEMNAME.svg?style=flat)](http://rubygems.org/gems/GEMNAME "View this project in Rubygems")
### Etc
Gitter chat
[![Gitter chat](https://badges.gitter.im/USER/REPO.png)](https://gitter.im/USER/REPO "Gitter chat")
Gitter chat (shields.io)
[![Chat](http://img.shields.io/badge/gitter-USER / REPO-blue.svg)]( https://gitter.im/USER/REPO )
david-dm
[![Dependencies](http://img.shields.io/david/rstacruz/REPO.svg?style=flat)](https://david-dm.org/rstacruz/REPO)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)
### Support stuff
Support
-------
__Bugs and requests__: submit them through the project's issues tracker.<br>
[![Issues](http://img.shields.io/github/issues/USER/REPO.svg)]( https://github.com/USER/REPO/issues )
__Questions__: ask them at StackOverflow with the tag *REPO*.<br>
[![StackOverflow](http://img.shields.io/badge/stackoverflow-REPO-blue.svg)]( http://stackoverflow.com/questions/tagged/REPO )
__Chat__: join us at gitter.im.<br>
[![Chat](http://img.shields.io/badge/gitter.im-USER/REPO-blue.svg)]( https://gitter.im/USER/REPO )
### Frontend js installation
Installation
------------
Add [nprogress.js] and [nprogress.css] to your project.
```html
<script src='nprogress.js'></script>
<link rel='stylesheet' href='nprogress.css'/>
```
NProgress is available via [bower] and [npm].
$ bower install --save nprogress
$ npm install --save nprogress
[bower]: http://bower.io/search/?q=nprogress
[npm]: https://www.npmjs.org/package/nprogress
### Acknowledgements
**PROJECTNAME** © 2014+, Rico Sta. Cruz. Released under the [MIT] License.<br>
Authored and maintained by Rico Sta. Cruz with help from contributors ([list][contributors]).
> [ricostacruz.com](http://ricostacruz.com) &nbsp;&middot;&nbsp;
> GitHub [@rstacruz](https://github.com/rstacruz) &nbsp;&middot;&nbsp;
> Twitter [@rstacruz](https://twitter.com/rstacruz)
[MIT]: http://mit-license.org/
[contributors]: http://github.com/rstacruz/nprogress/contributors
### Links
* Everything: http://shields.io/
* Version badge (gems, npm): http://badge.fury.io/
* Dependencies (ruby): http://gemnasium.com/
* CI: http://travis-ci.org/
* Code quality (ruby): http://codeclimate.com/
* Test coverage: https://coveralls.io/

577
bash.md
View File

@ -1,9 +1,8 @@
---
title: Bash scripting
category: CLI
layout: 2017/sheet
tags: [Featured]
updated: 2018-11-19
updated: 2020-07-05
keywords:
- Variables
- Functions
@ -14,45 +13,61 @@ keywords:
- Command substitution
---
Getting started
---------------
## Getting started
{: .-three-column}
### Introduction
{: .-intro}
This is a quick reference to getting started with Bash scripting.
- [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
- [Bash Hackers Wiki](https://web.archive.org/web/20230406205817/https://wiki.bash-hackers.org/) _(wiki.bash-hackers.org)_
### Example
```bash
#!/usr/bin/env bash
NAME="John"
echo "Hello $NAME!"
name="John"
echo "Hello $name!"
```
### Variables
```bash
NAME="John"
echo $NAME
echo "$NAME"
echo "${NAME}!"
name="John"
echo $name # see below
echo "$name"
echo "${name}!"
```
Generally quote your variables unless they contain wildcards to expand or command fragments.
```bash
wildcard="*.txt"
options="iv"
cp -$options $wildcard /tmp
```
### String quotes
```bash
NAME="John"
echo "Hi $NAME" #=> Hi John
echo 'Hi $NAME' #=> Hi $NAME
name="John"
echo "Hi $name" #=> Hi John
echo 'Hi $name' #=> Hi $name
```
### Shell execution
```bash
echo "I'm in $(pwd)"
echo "I'm in `pwd`"
echo "I'm in `pwd`" # obsolescent
# Same
```
See [Command substitution](http://wiki.bash-hackers.org/syntax/expansion/cmdsubst)
See [Command substitution](https://web.archive.org/web/20230326081741/https://wiki.bash-hackers.org/syntax/expansion/cmdsubst)
### Conditional execution
@ -78,9 +93,9 @@ See: [Functions](#functions)
{: id='conditionals-example'}
```bash
if [ -z "$string" ]; then
if [[ -z "$string" ]]; then
echo "String is empty"
elif [ -n "$string" ]; then
elif [[ -n "$string" ]]; then
echo "String is not empty"
fi
```
@ -102,77 +117,102 @@ See: [Unofficial bash strict mode](http://redsymbol.net/articles/unofficial-bash
echo {A,B}.js
```
| `{A,B}` | Same as `A B` |
| `{A,B}.js` | Same as `A.js B.js` |
| `{1..5}` | Same as `1 2 3 4 5` |
| Expression | Description |
| ---------------------- | --------------------- |
| `{A,B}` | Same as `A B` |
| `{A,B}.js` | Same as `A.js B.js` |
| `{1..5}` | Same as `1 2 3 4 5` |
| <code>&lcub;{1..3},{7..9}}</code> | Same as `1 2 3 7 8 9` |
See: [Brace expansion](http://wiki.bash-hackers.org/syntax/expansion/brace)
See: [Brace expansion](https://web.archive.org/web/20230207192110/https://wiki.bash-hackers.org/syntax/expansion/brace)
Parameter expansions
--------------------
## Parameter expansions
{: .-three-column}
### Basics
```bash
name="John"
echo ${name}
echo ${name/J/j} #=> "john" (substitution)
echo ${name:0:2} #=> "Jo" (slicing)
echo ${name::2} #=> "Jo" (slicing)
echo ${name::-1} #=> "Joh" (slicing)
echo ${food:-Cake} #=> $food or "Cake"
echo "${name}"
echo "${name/J/j}" #=> "john" (substitution)
echo "${name:0:2}" #=> "Jo" (slicing)
echo "${name::2}" #=> "Jo" (slicing)
echo "${name::-1}" #=> "Joh" (slicing)
echo "${name:(-1)}" #=> "n" (slicing from right)
echo "${name:(-2):1}" #=> "h" (slicing from right)
echo "${food:-Cake}" #=> $food or "Cake"
```
```bash
length=2
echo ${name:0:length} #=> "Jo"
echo "${name:0:length}" #=> "Jo"
```
See: [Parameter expansion](http://wiki.bash-hackers.org/syntax/pe)
See: [Parameter expansion](https://web.archive.org/web/20230408142504/https://wiki.bash-hackers.org/syntax/pe)
```bash
STR="/path/to/foo.cpp"
echo ${STR%.cpp} # /path/to/foo
echo ${STR%.cpp}.o # /path/to/foo.o
str="/path/to/foo.cpp"
echo "${str%.cpp}" # /path/to/foo
echo "${str%.cpp}.o" # /path/to/foo.o
echo "${str%/*}" # /path/to
echo ${STR##*.} # cpp (extension)
echo ${STR##*/} # foo.cpp (basepath)
echo "${str##*.}" # cpp (extension)
echo "${str##*/}" # foo.cpp (basepath)
echo ${STR#*/} # path/to/foo.cpp
echo ${STR##*/} # foo.cpp
echo "${str#*/}" # path/to/foo.cpp
echo "${str##*/}" # foo.cpp
echo ${STR/foo/bar} # /path/to/bar.cpp
echo "${str/foo/bar}" # /path/to/bar.cpp
```
```bash
STR="Hello world"
echo ${STR:6:5} # "world"
echo ${STR:-5:5} # "world"
str="Hello world"
echo "${str:6:5}" # "world"
echo "${str: -5:5}" # "world"
```
```bash
SRC="/path/to/foo.cpp"
BASE=${SRC##*/} #=> "foo.cpp" (basepath)
DIR=${SRC%$BASE} #=> "/path/to/" (dirpath)
src="/path/to/foo.cpp"
base=${src##*/} #=> "foo.cpp" (basepath)
dir=${src%$base} #=> "/path/to/" (dirpath)
dir=${src%/*} #=> "/path/to" (dirpath)
```
### Prefix name expansion
```bash
prefix_a=one
prefix_b=two
echo ${!prefix_*} # all variables names starting with `prefix_`
prefix_a prefix_b
```
### Indirection
```bash
name=joe
pointer=name
echo ${!pointer}
joe
```
### Substitution
| Code | Description |
| --- | --- |
| `${FOO%suffix}` | Remove suffix |
| `${FOO#prefix}` | Remove prefix |
| --- | --- |
| `${FOO%%suffix}` | Remove long suffix |
| `${FOO##prefix}` | Remove long prefix |
| --- | --- |
| `${FOO/from/to}` | Replace first match |
| `${FOO//from/to}` | Replace all |
| --- | --- |
| `${FOO/%from/to}` | Replace suffix |
| `${FOO/#from/to}` | Replace prefix |
| Code | Description |
| ----------------- | ------------------- |
| `${foo%suffix}` | Remove suffix |
| `${foo#prefix}` | Remove prefix |
| --- | --- |
| `${foo%%suffix}` | Remove long suffix |
| `${foo/%suffix}` | Remove long suffix |
| `${foo##prefix}` | Remove long prefix |
| `${foo/#prefix}` | Remove long prefix |
| --- | --- |
| `${foo/from/to}` | Replace first match |
| `${foo//from/to}` | Replace all |
| --- | --- |
| `${foo/%from/to}` | Replace suffix |
| `${foo/#from/to}` | Replace prefix |
### Comments
@ -190,31 +230,56 @@ comment
### Substrings
| `${FOO:0:3}` | Substring _(position, length)_ |
| `${FOO:-3:3}` | Substring from the right |
| Expression | Description |
| --------------- | ------------------------------ |
| `${foo:0:3}` | Substring _(position, length)_ |
| `${foo:(-3):3}` | Substring from the right |
### Length
| `${#FOO}` | Length of `$FOO` |
| Expression | Description |
| ---------- | ---------------- |
| `${#foo}` | Length of `$foo` |
### Manipulation
```bash
str="HELLO WORLD!"
echo "${str,}" #=> "hELLO WORLD!" (lowercase 1st letter)
echo "${str,,}" #=> "hello world!" (all lowercase)
str="hello world!"
echo "${str^}" #=> "Hello world!" (uppercase 1st letter)
echo "${str^^}" #=> "HELLO WORLD!" (all uppercase)
```
### Default values
| `${FOO:-val}` | `$FOO`, or `val` if not set |
| `${FOO:=val}` | Set `$FOO` to `val` if not set |
| `${FOO:+val}` | `val` if `$FOO` is set |
| `${FOO:?message}` | Show error message and exit if `$FOO` is not set |
| Expression | Description |
| ----------------- | -------------------------------------------------------- |
| `${foo:-val}` | `$foo`, or `val` if unset (or null) |
| `${foo:=val}` | Set `$foo` to `val` if unset (or null) |
| `${foo:+val}` | `val` if `$foo` is set (and not null) |
| `${foo:?message}` | Show error message and exit if `$foo` is unset (or null) |
The `:` is optional (eg, `${FOO=word}` works)
Omitting the `:` removes the (non)nullity checks, e.g. `${foo-val}` expands to `val` if unset otherwise `$foo`.
Loops
-----
## Loops
{: .-three-column}
### Basic for loop
```bash
for i in /etc/rc.*; do
echo $i
echo "$i"
done
```
### C-like for loop
```bash
for ((i = 0 ; i < 100 ; i++)); do
echo "$i"
done
```
@ -237,9 +302,9 @@ done
### Reading lines
```bash
cat file.txt | while read line; do
echo $line
done
while read -r line; do
echo "$line"
done <file.txt
```
### Forever
@ -250,8 +315,7 @@ while true; do
done
```
Functions
---------
## Functions
{: .-three-column}
### Defining functions
@ -264,7 +328,7 @@ myfunc() {
```bash
# Same as above (alternate syntax)
function myfunc() {
function myfunc {
echo "hello $1"
}
```
@ -278,7 +342,7 @@ myfunc "John"
```bash
myfunc() {
local myresult='some value'
echo $myresult
echo "$myresult"
}
```
@ -304,78 +368,87 @@ fi
### Arguments
| Expression | Description |
| --- | --- |
| `$#` | Number of arguments |
| `$*` | All arguments |
| `$@` | All arguments, starting from first |
| `$1` | First argument |
| Expression | Description |
| ---------- | ---------------------------------------------- |
| `$#` | Number of arguments |
| `$*` | All positional arguments (as a single word) |
| `$@` | All positional arguments (as separate strings) |
| `$1` | First argument |
| `$_` | Last argument of the previous command |
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
**Note**: `$@` and `$*` must be quoted in order to perform as described.
Otherwise, they do exactly the same thing (arguments as separate strings).
Conditionals
------------
See [Special parameters](https://web.archive.org/web/20230318164746/https://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
## Conditionals
{: .-three-column}
### Conditions
Note that `[[` is actually a command/program that returns either `0` (true) or `1` (false). Any program that obeys the same logic (like all base utils, such as `grep(1)` or `ping(1)`) can be used as condition, see examples.
| Condition | Description |
| ------------------------ | --------------------- |
| `[[ -z STRING ]]` | Empty string |
| `[[ -n STRING ]]` | Not empty string |
| `[[ STRING == STRING ]]` | Equal |
| `[[ STRING != STRING ]]` | Not Equal |
| --- | --- |
| `[ STRING = STRING ]` | Equal |
| `[ STRING != STRING ]` | Not Equal |
| `[ -z STRING ]` | Empty string |
| `[ -n STRING ]` | Not empty string |
| --- | --- |
| `[ NUM -eq NUM ]` | Equal |
| `[ NUM -ne NUM ]` | Not equal |
| `[ NUM -lt NUM ]` | Less than |
| `[ NUM -le NUM ]` | Less than or equal |
| `[ NUM -gt NUM ]` | Greater than |
| `[ NUM -ge NUM ]` | Greater than or equal |
| `[[ NUM -eq NUM ]]` | Equal |
| `[[ NUM -ne NUM ]]` | Not equal |
| `[[ NUM -lt NUM ]]` | Less than |
| `[[ NUM -le NUM ]]` | Less than or equal |
| `[[ NUM -gt NUM ]]` | Greater than |
| `[[ NUM -ge NUM ]]` | Greater than or equal |
| --- | --- |
| `[[ STRING =~ STRING ]]` | Regexp |
| --- | --- |
| `(( NUM < NUM ))` | Numeric conditions |
| Condition | Description |
| --- | --- |
| `[ -o noclobber ]` | If OPTIONNAME is enabled |
| --- | --- |
| `[ ! EXPR ]` | Not |
| `[ X ] && [ Y ]` | And |
| `[ X ] || [ Y ]` | Or |
#### More conditions
| Condition | Description |
| -------------------- | ------------------------ |
| `[[ -o noclobber ]]` | If OPTIONNAME is enabled |
| --- | --- |
| `[[ ! EXPR ]]` | Not |
| `[[ X && Y ]]` | And |
| `[[ X || Y ]]` | Or |
### File conditions
| Condition | Description |
| --- | --- |
| `[ -e FILE ]` | Exists |
| `[ -r FILE ]` | Readable |
| `[ -h FILE ]` | Symlink |
| `[ -d FILE ]` | Directory |
| `[ -w FILE ]` | Writable |
| `[ -s FILE ]` | Size is > 0 bytes |
| `[ -f FILE ]` | File |
| `[ -x FILE ]` | Executable |
| --- | --- |
| `[ FILE1 -nt FILE2 ]` | 1 is more recent than 2 |
| `[ FILE1 -ot FILE2 ]` | 2 is more recent than 1 |
| `[ FILE1 -ef FILE2 ]` | Same files |
| Condition | Description |
| ----------------------- | ----------------------- |
| `[[ -e FILE ]]` | Exists |
| `[[ -r FILE ]]` | Readable |
| `[[ -h FILE ]]` | Symlink |
| `[[ -d FILE ]]` | Directory |
| `[[ -w FILE ]]` | Writable |
| `[[ -s FILE ]]` | Size is > 0 bytes |
| `[[ -f FILE ]]` | File |
| `[[ -x FILE ]]` | Executable |
| --- | --- |
| `[[ FILE1 -nt FILE2 ]]` | 1 is more recent than 2 |
| `[[ FILE1 -ot FILE2 ]]` | 2 is more recent than 1 |
| `[[ FILE1 -ef FILE2 ]]` | Same files |
### Example
```bash
# String
if [ -z "$string" ]; then
if [[ -z "$string" ]]; then
echo "String is empty"
elif [ -n "$string" ]; then
elif [[ -n "$string" ]]; then
echo "String is not empty"
else
echo "This never happens"
fi
```
```bash
# Combinations
if [ X ] && [ Y ]; then
if [[ X && Y ]]; then
...
fi
```
@ -387,21 +460,22 @@ if [[ "$A" == "$B" ]]
```bash
# Regex
if [[ "A" =~ "." ]]
if [[ "A" =~ . ]]
```
```bash
if (( $a < $b ))
if (( $a < $b )); then
echo "$a is smaller than $b"
fi
```
```bash
if [ -e "file.txt" ]; then
if [[ -e "file.txt" ]]; then
echo "file exists"
fi
```
Arrays
------
## Arrays
### Defining arrays
@ -418,12 +492,14 @@ Fruits[2]="Orange"
### Working with arrays
```bash
echo ${Fruits[0]} # Element #0
echo ${Fruits[@]} # All elements, space-separated
echo ${#Fruits[@]} # Number of elements
echo ${#Fruits} # String length of the 1st element
echo ${#Fruits[3]} # String length of the Nth element
echo ${Fruits[@]:3:2} # Range (from position 3, length 2)
echo "${Fruits[0]}" # Element #0
echo "${Fruits[-1]}" # Last element
echo "${Fruits[@]}" # All elements, space-separated
echo "${#Fruits[@]}" # Number of elements
echo "${#Fruits}" # String length of the 1st element
echo "${#Fruits[3]}" # String length of the Nth element
echo "${Fruits[@]:3:2}" # Range (from position 3, length 2)
echo "${!Fruits[@]}" # Keys of all elements, space-separated
```
### Operations
@ -431,23 +507,68 @@ echo ${Fruits[@]:3:2} # Range (from position 3, length 2)
```bash
Fruits=("${Fruits[@]}" "Watermelon") # Push
Fruits+=('Watermelon') # Also Push
Fruits=( ${Fruits[@]/Ap*/} ) # Remove by regex match
Fruits=( "${Fruits[@]/Ap*/}" ) # Remove by regex match
unset Fruits[2] # Remove one item
Fruits=("${Fruits[@]}") # Duplicate
Fruits=("${Fruits[@]}" "${Veggies[@]}") # Concatenate
lines=(`cat "logfile"`) # Read from file
words=($(< datafile)) # From file (split by IFS)
```
### Iteration
```bash
for i in "${arrayName[@]}"; do
echo $i
echo "$i"
done
```
Options
-------
## Dictionaries
{: .-three-column}
### Defining
```bash
declare -A sounds
```
```bash
sounds[dog]="bark"
sounds[cow]="moo"
sounds[bird]="tweet"
sounds[wolf]="howl"
```
Declares `sound` as a Dictionary object (aka associative array).
### Working with dictionaries
```bash
echo "${sounds[dog]}" # Dog's sound
echo "${sounds[@]}" # All values
echo "${!sounds[@]}" # All keys
echo "${#sounds[@]}" # Number of elements
unset sounds[dog] # Delete dog
```
### Iteration
#### Iterate over values
```bash
for val in "${sounds[@]}"; do
echo "$val"
done
```
#### Iterate over keys
```bash
for key in "${!sounds[@]}"; do
echo "$key"
done
```
## Options
### Options
@ -461,55 +582,60 @@ set -o nounset # Exposes unset variables
### Glob options
```bash
set -o nullglob # Non-matching globs are removed ('*.foo' => '')
set -o failglob # Non-matching globs throw errors
set -o nocaseglob # Case insensitive globs
set -o globdots # Wildcards match dotfiles ("*.sh" => ".foo.sh")
set -o globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
shopt -s nullglob # Non-matching globs are removed ('*.foo' => '')
shopt -s failglob # Non-matching globs throw errors
shopt -s nocaseglob # Case insensitive globs
shopt -s dotglob # Wildcards match dotfiles ("*.sh" => ".foo.sh")
shopt -s globstar # Allow ** for recursive matches ('lib/**/*.rb' => 'lib/a/b/c.rb')
```
Set `GLOBIGNORE` as a colon-separated list of patterns to be removed from glob
matches.
History
-------
## History
### Commands
| `history` | Show history |
| Command | Description |
| --------------------- | ----------------------------------------- |
| `history` | Show history |
| `shopt -s histverify` | Don't execute expanded result immediately |
### Expansions
| `!$` | Expand last parameter of most recent command |
| `!*` | Expand all parameters of most recent command |
| `!-n` | Expand `n`th most recent command |
| `!n` | Expand `n`th command in history |
| Expression | Description |
| ------------ | ---------------------------------------------------- |
| `!$` | Expand last parameter of most recent command |
| `!*` | Expand all parameters of most recent command |
| `!-n` | Expand `n`th most recent command |
| `!n` | Expand `n`th command in history |
| `!<command>` | Expand most recent invocation of command `<command>` |
### Operations
| `!!` | Execute last command again |
| `!!:s/<FROM>/<TO>/` | Replace first occurrence of `<FROM>` to `<TO>` in most recent command |
| `!!:gs/<FROM>/<TO>/` | Replace all occurrences of `<FROM>` to `<TO>` in most recent command |
| `!$:t` | Expand only basename from last parameter of most recent command |
| `!$:h` | Expand only directory from last parameter of most recent command |
| Code | Description |
| -------------------- | --------------------------------------------------------------------- |
| `!!` | Execute last command again |
| `!!:s/<FROM>/<TO>/` | Replace first occurrence of `<FROM>` to `<TO>` in most recent command |
| `!!:gs/<FROM>/<TO>/` | Replace all occurrences of `<FROM>` to `<TO>` in most recent command |
| `!$:t` | Expand only basename from last parameter of most recent command |
| `!$:h` | Expand only directory from last parameter of most recent command |
`!!` and `!$` can be replaced with any valid expansion.
### Slices
| `!!:n` | Expand only `n`th token from most recent command (command is `0`; first argument is `1`) |
| `!^` | Expand first argument from most recent command |
| `!$` | Expand last token from most recent command |
| `!!:n-m` | Expand range of tokens from most recent command |
| `!!:n-$` | Expand `n`th token to last from most recent command |
| Code | Description |
| -------- | ---------------------------------------------------------------------------------------- |
| `!!:n` | Expand only `n`th token from most recent command (command is `0`; first argument is `1`) |
| `!^` | Expand first argument from most recent command |
| `!$` | Expand last token from most recent command |
| `!!:n-m` | Expand range of tokens from most recent command |
| `!!:n-$` | Expand `n`th token to last from most recent command |
`!!` can be replaced with any valid expansion i.e. `!cat`, `!-2`, `!42`, etc.
Miscellaneous
-------------
## Miscellaneous
### Numeric calculations
@ -518,7 +644,12 @@ $((a + 200)) # Add 200 to $a
```
```bash
$((RANDOM%=200)) # Random number 0..200
$(($RANDOM%200)) # Random number 0..199
```
```bash
declare -i count # Declare as type integer
count+=1 # Increment
```
### Subshells
@ -531,16 +662,19 @@ pwd # still in first directory
### Redirection
```bash
python hello.py > output.txt # stdout to (file)
python hello.py >> output.txt # stdout to (file), append
python hello.py 2> error.log # stderr to (file)
python hello.py 2>&1 # stderr to stdout
python hello.py 2>/dev/null # stderr to (null)
python hello.py &>/dev/null # stdout and stderr to (null)
python hello.py > output.txt # stdout to (file)
python hello.py >> output.txt # stdout to (file), append
python hello.py 2> error.log # stderr to (file)
python hello.py 2>&1 # stderr to stdout
python hello.py 2>/dev/null # stderr to (null)
python hello.py >output.txt 2>&1 # stdout and stderr to (file), equivalent to &>
python hello.py &>/dev/null # stdout and stderr to (null)
echo "$0: warning: too many users" >&2 # print diagnostic message to stderr
```
```bash
python hello.py < foo.txt
python hello.py < foo.txt # feed foo.txt to stdin for python
diff <(ls -r) <(ls) # Compare two stdout without files
```
### Inspecting commands
@ -592,12 +726,44 @@ source "${0%/*}/../share/foo.sh"
```bash
printf "Hello %s, I'm %s" Sven Olga
#=> "Hello Sven, I'm Olga
printf "1 + 1 = %d" 2
#=> "1 + 1 = 2"
printf "This is how you print a float: %f" 2
#=> "This is how you print a float: 2.000000"
printf '%s\n' '#!/bin/bash' 'echo hello' >file
# format string is applied to each group of arguments
printf '%i+%i=%i\n' 1 2 3 4 5 9
```
### Transform strings
| Command option | Description |
| -------------- | --------------------------------------------------- |
| `-c` | Operations apply to characters not in the given set |
| `-d` | Delete characters |
| `-s` | Replaces repeated characters with single occurrence |
| `-t` | Truncates |
| `[:upper:]` | All upper case letters |
| `[:lower:]` | All lower case letters |
| `[:digit:]` | All digits |
| `[:space:]` | All whitespace |
| `[:alpha:]` | All letters |
| `[:alnum:]` | All letters and digits |
#### Example
```bash
echo "Welcome To Devhints" | tr '[:lower:]' '[:upper:]'
WELCOME TO DEVHINTS
```
### Directory of script
```bash
DIR="${0%/*}"
dir=${0%/*}
```
### Getting options
@ -605,7 +771,7 @@ DIR="${0%/*}"
```bash
while [[ "$1" =~ ^- && ! "$1" == "--" ]]; do case $1 in
-V | --version )
echo $version
echo "$version"
exit
;;
-s | --string )
@ -626,25 +792,56 @@ hello world
END
```
Heredoc allows a section of your source code to be treated as a file. See [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Redirections.html#Here-Documents).
### Herestring
```sh
tr '[:lower:]' '[:upper:]' <<< "Will be uppercased, even $variable"
```
Herestring allows a string to be treated as a standard input (stdin). See [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Redirections.html#Here-Strings).
### Process substitution
```sh
# loop on myfunc output lines
while read -r line; do
echo "$line"
done < <(myfunc)
# compare content of two folders
diff <(ls "$dir1") <(ls "$dir2")
```
Process substitution allows the input (or output) of a command to be treated as a file. See [Bash Reference Manual](https://www.gnu.org/software/bash/manual/html_node/Process-Substitution.html).
### Reading input
```bash
echo -n "Proceed? [y/n]: "
read ans
echo $ans
read -r ans
echo "$ans"
```
The `-r` option disables a peculiar legacy behavior with backslashes.
```bash
read -n 1 ans # Just one character
```
### Special variables
| `$?` | Exit status of last task |
| `$!` | PID of last background task |
| `$$` | PID of shell |
| Expression | Description |
| ------------------ | -------------------------------------- |
| `$?` | Exit status of last task |
| `$!` | PID of last background task |
| `$$` | PID of shell |
| `$0` | Filename of the shell script |
| `$_` | Last argument of the previous command |
| `${PIPESTATUS[n]}` | return value of piped commands (array) |
See [Special parameters](http://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
See [Special parameters](https://web.archive.org/web/20230318164746/https://wiki.bash-hackers.org/syntax/shellvars#special_parameters_and_shell_variables).
### Go to previous directory
@ -656,9 +853,27 @@ cd -
pwd # /home/user/foo
```
### Check for command's result
```bash
if ping -c 1 google.com; then
echo "It appears you have a working internet connection"
fi
```
### Grep check
```bash
if grep -q 'foo' ~/.bash_history; then
echo "You appear to have typed 'foo' in the past"
fi
```
## Also see
{: .-one-column}
* [Bash-hackers wiki](http://wiki.bash-hackers.org/) _(bash-hackers.org)_
* [Shell vars](http://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_
* [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
- [Bash-hackers wiki](https://web.archive.org/web/20230406205817/https://wiki.bash-hackers.org/) _(bash-hackers.org)_
- [Shell vars](https://web.archive.org/web/20230318164746/https://wiki.bash-hackers.org/syntax/shellvars) _(bash-hackers.org)_
- [Learn bash in y minutes](https://learnxinyminutes.com/docs/bash/) _(learnxinyminutes.com)_
- [Bash Guide](http://mywiki.wooledge.org/BashGuide) _(mywiki.wooledge.org)_
- [ShellCheck](https://www.shellcheck.net/) _(shellcheck.net)_

View File

@ -1,7 +1,6 @@
---
title: Blessed
category: JavaScript libraries
layout: 2017/sheet
---
### Screen

View File

@ -1,9 +1,8 @@
---
title: bluebird.js
category: JavaScript libraries
layout: 2017/sheet
weight: -1
updated: 2017-09-04
updated: 2017-09-08
---
### Also see
@ -18,7 +17,7 @@ promise
.spread(okFn, errFn) // *
.catch(errFn)
.catch(TypeError, errFn) // *
.finally(fn) // *
.finally(fn)
.map(function (e) { ··· }) // *
.each(function (e) { ··· }) // *
```

41
bolt.md Normal file
View File

@ -0,0 +1,41 @@
---
title: Bolt Quickstart
category: Bolt
updated: 2018-12-25
authors:
- github: lucywyman
keywords:
- Puppet
- tasks
- modules
description: |
A quick guide to getting started writing Bolt tasks
---
### Install Bolt
```bash
# On MacOS
brew cask install puppetlabs/puppet/puppet-bolt
# On Windows
choco install puppet-bolt
```
Bolt is available as a package for most platforms. See [installing bolt](https://puppet.com/docs/bolt/latest/bolt_installing.html)
### Create a module with a task
```bash
mkdir -p ~/.puppetlabs/bolt/modules/mymodule/tasks
cp myscript.sh ~/.puppetlabs/bolt/modules/mymodule/tasks/
```
Tasks can be written in any language your targets can run. See [writing tasks](https://puppet.com/docs/bolt/latest/writing_tasks.html) for more details.
### Run Bolt
```bash
bolt task run mymodule::myscript -n node1.example.com,node2.example.com --private-key ~/.ssh/id_rsa-private
```
See `bolt task run --help` for more information and command line options.

View File

@ -1,21 +0,0 @@
# bookshelf-contrib.Scopes
#
class Books
scopes:
published: (q) -> q.where(published: true)
Books.published().fetchAll()
# bookshelf-contrib.QueryProxy
#
Books.query().where(published: true)
Books.where(published: true)
# bookshelf-contrib.Migration
class Migration
up: ->
down: ->

View File

@ -6,6 +6,7 @@ category: JavaScript libraries
Model
-----
### Model
```js
Summary = bookshelf.Model.extend({
tableName: 'summaries',

View File

@ -1,8 +1,8 @@
---
title: Bootstrap
layout: 2017/sheet
prism_languages: [scss, haml, html]
weight: -1
category: CSS
description: |
.container .row .col-md-6, @screen-sm-min, .form-control, grids, .modal-content, tooltips, and other Bootstrap CSS examples.
---

View File

@ -1,5 +0,0 @@
---
title: Homebrew
category: Hidden
redirect_to: /homebrew
---

View File

@ -3,10 +3,12 @@ title: Browsersync
category: JavaScript libraries
---
```
npm i -g browser-sync
```
{:.terminal}
### About
{: .-intro}
`npm i -g browser-sync`
* [browsersync.io](https://browsersync.io)
### Start a server
@ -20,7 +22,3 @@ browser-sync start --server <path> --files='**/*.html, **/*.css'
--port=N
--proxy="http://127.0.0.1:3000"
```
### Reference
* [browsersync.io](http://browsersync.io)

View File

@ -1,8 +1,19 @@
---
title: Browserify
category: JavaScript libraries
tags: [Archived]
archived: Browserify has not been in active development.
---
### About
{: .-intro}
Browserify is a bundler for JavaScript.
- <https://browserify.org/>
### Usage
browserify input.js
-o output.js
-t coffeeify

View File

@ -1,97 +0,0 @@
---
title: Brunch
category: JavaScript libraries
---
## Paths
/
app/
assets/
vendor/
public/
config.coffee
## Config
```js
module.exports = {
files: {
javascripts: { # or 'stylesheets' or 'templates'
order: {
before: [ 'normalize.css' ],
after: [ 'helpers.css' ],
joinTo: 'app.js',
joinTo: {
'js/app.js': /^app/,
'js/vendor.js': /^vendor/
},
pluginHelpers: 'js/vendor.js'
}
}
paths: {
public: 'public', # where to compile
watched: ['app','test','vendor'], # what to monitor
}
modules: {
wrapper: 'amd',
definition: 'amd',
nameCleaner: (path) => path.replace(/^app\//, '')
}
npm: { styles, globals }
plugins: {
sass: { ... }
}
// brunch w --apply testing
// BRUNCH_ENV=testing brunch build
overrides: {
production: {
optimize: true,
sourceMaps: false,
plugins: { autoReload: { enabled: false } }
}
}
onCompile: (files, assets) => { ... }
```
## Plugins
plugins:
uglify:
mangle: true
compress:
global_defs:
DEBUG: false
## Extensions
Compile to CSS
* stylus-brunch
* less-brunch
* sass-brunch
Compile to HTML
* static-jade-brunch
Embedded templates
* emblem-brunch
Etc
* uglify-js-brunch
* jshint-brunch
* imageoptimizer-brunch
## References
* <https://github.com/brunch/brunch/blob/master/docs/config.md>

View File

@ -1,7 +1,6 @@
---
title: Bulma
category: CSS
layout: 2017/sheet
prism_languages: [css, html]
weight: -1
updated: 2018-11-19

View File

@ -1,49 +1,78 @@
---
title: C Preprocessor
category: C-like
intro: |
Quick reference for the [C macro preprocessor](https://en.m.wikipedia.org/wiki/C_preprocessor), which can be used independent of C/C++.
---
## Reference
{: .-three-column}
### Compiling
$ cpp -P file > outfile
```
$ cpp -P file > outfile
```
### Includes
#include "file"
```
#include "file"
```
### Defines
#define FOO
#define FOO "hello"
```
#define FOO
#define FOO "hello"
#undef FOO
#undef FOO
```
### If
#ifdef DEBUG
console.log('hi');
#elif defined VERBOSE
...
#else
...
#endif
```
#ifdef DEBUG
console.log('hi');
#elif defined VERBOSE
...
#else
...
#endif
```
### Error
#if VERSION == 2.0
#error Unsupported
#warning Not really supported
#endif
```
#if VERSION == 2.0
#error Unsupported
#warning Not really supported
#endif
```
### Macro
#define DEG(x) ((x) * 57.29)
```
#define DEG(x) ((x) * 57.29)
```
### Token concat
#define DST(name) name##_s name##_t
DST(object); #=> "object_s object_t;"
```
#define DST(name) name##_s name##_t
DST(object); #=> object_s object_t;
```
### Stringification
```
#define STR(name) #name
char * a = STR(object); #=> char * a = "object";
```
### file and line
#define LOG(msg) console.log(__FILE__, __LINE__, msg)
#=> console.log("file.txt", 3, "hey")
```
#define LOG(msg) console.log(__FILE__, __LINE__, msg)
#=> console.log("file.txt", 3, "hey")
```

View File

@ -1,6 +1,5 @@
---
title: Camp
layout: 2017/sheet
category: JavaScript libraries
updated: 2017-09-21
weight: -1

View File

@ -1,7 +1,6 @@
---
title: Canvas
category: JavaScript
layout: 2017/sheet
---
### Getting the context

View File

@ -1,9 +1,8 @@
---
title: Capybara
category: Ruby libraries
layout: 2017/sheet
weight: -5
updated: 2017-08-30
updated: 2020-06-13
tags: [Featurable]
---
@ -13,9 +12,11 @@ tags: [Featurable]
### Clicking links and buttons
click 'Link Text'
click_button
click_link
```ruby
click_on 'Link Text'
click_button
click_link
```
### Interacting with forms
@ -117,14 +118,14 @@ In RSpec, you can use `page.should` assertions.
### About negatives
```ruby
expect(page).to have_no_button('Save') # OK
```
```ruby
expect(page).not_to have_button('Save') # Bad
expect(page).to have_no_button('Save')
```
Use `should have_no_*` versions with RSpec matchers because
`should_not have_*` doesn't wait for a timeout from the driver.
```ruby
expect(page).not_to have_button('Save')
```
The two above statements are functionally equivalent.
## RSpec
@ -136,6 +137,7 @@ expect(page).to \
{: .-setup}
```ruby
have_current_path(expected_path)
have_selector '.blank-state'
have_selector 'h1#hola', text: 'Welcome'
have_button 'Save'
@ -217,7 +219,7 @@ find('#x').fill_in('Street', with: 'Hello')
### Scripting
```ruby
execute_script('$("input").trigger('change')')
execute_script('$("input").trigger("change")')
evaluate_script('window.ga')
```
@ -264,7 +266,7 @@ page.status_code == 200
page.response_headers
```
See: <http://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Session>
See: <https://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Session>
### Poltergeist
@ -331,5 +333,5 @@ page.set_rack_session(foo: 'bar')
## See also
{: .-one-column}
- <http://rubydoc.info/github/jnicklas/capybara/Capybara/RSpecMatchers>
- <http://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers>
- <https://rubydoc.info/github/jnicklas/capybara/Capybara/RSpecMatchers>
- <https://www.rubydoc.info/github/jnicklas/capybara/master/Capybara/Node/Matchers>

View File

@ -1,10 +1,10 @@
---
title: Caskroom index
tags: [Archived]
archived: This sheet may have outdated information.
---
# Caskroom
#### A

View File

@ -1,9 +1,8 @@
---
title: Chai.js
category: JavaScript libraries
layout: 2017/sheet
weight: -3
updated: 2017-08-30
updated: 2018-06-25
version: chai v4.x
description: |
expect(x).to.be.equal(y) 〉 assert.equal(x, y) 〉 .to.be.true 〉 jQuery, assertions, TDD and BDD, and other Chai examples.

View File

@ -1,8 +1,7 @@
---
title: Cheatsheet styles
layout: 2017/sheet
tags: [WIP]
updated: 2017-09-22
updated: 2017-10-26
intro: |
This is a reference of styles that you can use on Devhints cheatsheets. How
meta!
@ -22,7 +21,6 @@ Variants
| `-two-column` | _(default)_|
| `-three-column` | |
| `-left-reference` | 3 columns<br>_(short first column)_ |
| `-no-hide` | Don't hide H2 |
See: [H2 sections](#two-columns)

11
chef.md
View File

@ -1,7 +1,6 @@
---
title: Chef
category: Devops
layout: 2017/sheet
---
### Install
@ -14,26 +13,26 @@ $ sudo apt-get install curl
```
```bash
$ curl -L https://www.opscode.com/chef/install.sh | bash
$ curl -L https://omnitruck.chef.io/install.sh | sudo bash
Thank you for installing Chef!
```
```bash
$ chef-solo -v
...
Chef: 11.4.0
Chef: 14.5.33
```
### Start the cookbook
```bash
wget http://github.com/opscode/chef-repo/tarball/master -O - | tar xzf - --strip-components=1
wget http://github.com/chef-cookbooks/chef-repo/tarball/master -O - | tar xzf - --strip-components=1
```
### Knife
```bash
$ knife cookbook site download mysql
$ knife supermarket download mysql
```
### Invoking chef-solo
@ -105,5 +104,5 @@ end
## Also see
* [Getting started with Chef](http://gettingstartedwithchef.com/) _(gettingstartedwithchef.com)_
* [Learn Chef Rally](https://learn.chef.io) _(learn.chef.io)_
* [install_from_source.rb recipe](https://github.com/mdxp/nodejs-cookbook/blob/master/recipes/install_from_source.rb) _(github.com)_

View File

@ -1,7 +1,6 @@
---
title: Chunky PNG
category: Ruby libraries
layout: 2017/sheet
---
### Loading

View File

@ -1,7 +1,6 @@
---
title: CIDR
category: Misc
layout: 2017/sheet
updated: 2018-05-14
---

View File

@ -1,8 +1,14 @@
---
title: CircleCI
category: Devops
---
## circle.yml
### About
{: .-intro}
- <https://circleci.com/docs/config-sample>
### circle.yml
* __machine__: adjusting the VM to your preferences and requirements
* __checkout__: checking out and cloning your git repo
@ -13,7 +19,7 @@ title: CircleCI
See: <https://circleci.com/docs/configuration>
## Sample
### Sample
```yml
## Customize the test machine
@ -90,5 +96,3 @@ notify:
# A list of hashes representing hooks. Only the url field is supported.
- url: https://someurl.com/hooks/circle
```
See: <https://circleci.com/docs/config-sample>

383
claude-code.md Normal file
View File

@ -0,0 +1,383 @@
---
title: Claude Code
category: AI
tags: [Featured]
updated: 2025-01-08
keywords:
- AI assistant
- CLI
- Code generation
- File operations
- Interactive mode
- Memory management
---
## Getting started
{: .-three-column}
### Introduction
{: .-intro}
[Claude Code](https://claude.ai/code) is an AI-powered CLI assistant for software engineering tasks. This reference covers the most commonly used commands and features.
- [Claude Code docs](https://docs.anthropic.com/en/docs/claude-code) _(docs.anthropic.com)_
- [GitHub repository](https://github.com/anthropics/claude-code) _(github.com)_
### Installation & Setup
```bash
# Install Claude Code
npm install -g @anthropics/claude-code
# Login with API key
claude auth login
# Check authentication status
claude auth status
```
### Quick Start
```bash
# Start interactive session
claude
# Run a single command
claude "help me write a Python function"
# Resume previous session
claude --resume
```
## Core Commands
{: .-three-column}
### Interactive Mode
{: .-prime}
| Command | Description |
| -------------------------- | ---------------------------------- |
| `claude` | Start interactive session |
| `claude --resume` | Resume last session |
| `claude --memory` | Start with memory enabled |
| `/help` | Show help and available commands |
| `/clear` | Clear current conversation |
| `/exit` | Exit interactive mode |
{: .-shortcuts}
### File Operations
| Command | Description |
| -------------------------- | ---------------------------------- |
| `claude "read file.py"` | Read and analyze a file |
| `claude "edit file.py"` | Edit an existing file |
| `claude "create file.py"` | Create a new file |
| `claude "fix tests"` | Fix failing tests |
| `claude "refactor code"` | Refactor existing code |
{: .-shortcuts}
### Git Integration
| Command | Description |
| ------------------------------- | ---------------------------------- |
| `claude "create commit"` | Create git commit with message |
| `claude "create PR"` | Create pull request |
| `claude "review changes"` | Review git changes |
| `claude "fix merge conflicts"` | Help resolve merge conflicts |
{: .-shortcuts}
## Advanced Features
{: .-three-column}
### Memory Management
```bash
# Enable memory for current session
claude --memory
# View memory contents
claude "show memory"
# Clear memory
claude "clear memory"
```
### Extended Thinking
```bash
# Enable deeper analysis
claude --think
# Complex problem solving
claude "analyze this codebase and suggest improvements"
```
### Image Analysis
```bash
# Analyze screenshot or diagram
claude "analyze this screenshot" --image path/to/image.png
# Paste image from clipboard
claude "explain this diagram" # then paste image
```
## Slash Commands
{: .-three-column}
### Session Management
| Command | Description |
| ------------ | ------------------------------------ |
| `/help` | Show available commands |
| `/clear` | Clear conversation history |
| `/reset` | Reset conversation state |
| `/exit` | Exit interactive mode |
| `/version` | Show Claude Code version |
{: .-shortcuts}
### Settings
| Command | Description |
| -------------- | ---------------------------------- |
| `/settings` | Show current settings |
| `/model` | Change AI model |
| `/memory on` | Enable memory |
| `/memory off` | Disable memory |
{: .-shortcuts}
### Productivity
| Command | Description |
| -------------- | ---------------------------------- |
| `/save` | Save conversation |
| `/load` | Load previous conversation |
| `/export` | Export conversation to file |
{: .-shortcuts}
## Common Workflows
{: .-three-column}
### Code Review
```bash
# Review specific file
claude "review this code for bugs" file.py
# Review all changes
claude "review my git changes"
# Check code quality
claude "suggest improvements" src/
```
### Testing
```bash
# Generate tests
claude "write tests for this function"
# Fix failing tests
claude "fix these test failures"
# Test coverage analysis
claude "analyze test coverage"
```
### Documentation
```bash
# Generate README
claude "create README for this project"
# Add code comments
claude "add documentation to this function"
# API documentation
claude "generate API docs"
```
### Debugging
```bash
# Debug error
claude "help debug this error: [error message]"
# Performance analysis
claude "why is this code slow?"
# Code explanation
claude "explain how this works" complex_function.py
```
## IDE Integrations
{: .-three-column}
### VS Code
```bash
# Install VS Code extension
code --install-extension anthropic.claude-code
# Open in VS Code
claude --vscode
# VS Code commands
Ctrl+Shift+P -> "Claude: Ask"
Ctrl+Shift+P -> "Claude: Review"
```
### Configuration
```bash
# Set default editor
claude config set editor code
# Set working directory
claude config set workdir /path/to/project
# View all settings
claude config list
```
## Best Practices
{: .-three-column}
### Effective Prompting
```bash
# Be specific about requirements
claude "write a Python function that validates email addresses with regex"
# Provide context
claude "in this Django project, add user authentication"
# Ask for explanations
claude "explain this code and suggest improvements"
```
### Project Structure
```bash
# Analyze entire project
claude "analyze project structure and suggest improvements"
# Focus on specific areas
claude "review the database models in models.py"
# Architecture decisions
claude "should I use async here?"
```
### Security
```bash
# Security review
claude "check this code for security vulnerabilities"
# Best practices
claude "make this code more secure"
# Audit dependencies
claude "review package.json for security issues"
```
## CLI Options
{: .-three-column}
### Global Options
| Option | Description |
| ------------------- | ---------------------------------- |
| `--help` | Show help information |
| `--version` | Show version number |
| `--resume` | Resume previous session |
| `--memory` | Enable memory |
| `--think` | Enable extended thinking |
| `--no-color` | Disable colored output |
| `--verbose` | Verbose logging |
{: .-shortcuts}
### Authentication
| Command | Description |
| -------------------- | ---------------------------------- |
| `claude auth login` | Login with API key |
| `claude auth logout` | Logout current session |
| `claude auth status` | Check authentication status |
| `claude auth whoami` | Show current user info |
{: .-shortcuts}
### Configuration
| Command | Description |
| ---------------------- | -------------------------------- |
| `claude config set` | Set configuration value |
| `claude config get` | Get configuration value |
| `claude config list` | List all configuration |
| `claude config reset` | Reset to default configuration |
{: .-shortcuts}
## Troubleshooting
{: .-three-column}
### Common Issues
```bash
# Clear authentication
claude auth logout && claude auth login
# Reset configuration
claude config reset
# Clear cache
claude --clear-cache
# Debug mode
claude --verbose --debug
```
### Network Issues
```bash
# Check connectivity
claude "test connection"
# Use proxy
claude --proxy http://proxy:8080
# Timeout settings
claude config set timeout 30
```
### Memory Issues
```bash
# Clear memory
claude "clear memory"
# Disable memory
claude --no-memory
# Memory usage
claude "show memory usage"
```
## Environment Variables
| Variable | Description |
| --------------------- | ---------------------------------- |
| `CLAUDE_API_KEY` | API key for authentication |
| `CLAUDE_MODEL` | Default model to use |
| `CLAUDE_MEMORY` | Enable memory by default |
| `CLAUDE_EDITOR` | Default text editor |
| `CLAUDE_WORKDIR` | Default working directory |
| `NO_COLOR` | Disable colored output |
## Also see
{: .-one-column}
- [Claude Code documentation](https://docs.anthropic.com/en/docs/claude-code) _(docs.anthropic.com)_
- [GitHub repository](https://github.com/anthropics/claude-code) _(github.com)_
- [Claude API docs](https://docs.anthropic.com/en/api) _(docs.anthropic.com)_
- [Community discussions](https://github.com/anthropics/claude-code/discussions) _(github.com)_

43
clip.md Normal file
View File

@ -0,0 +1,43 @@
---
title: Command Line Interface Pages
category: CLI
updated: 2023-02-23
keywords:
- CLI
---
### Page layout
```md
# command
> Some command description
> More information: https://some/link/to/url
- Some code description:
`command argument1 argument2`
```
### [Primitive placeholders](https://github.com/command-line-interface-pages/syntax/blob/main/type-specific/cli.md#primitive-placeholders)
```md
- Delay in [s]econds:
`sleep {int seconds: 2}s`
```
### [Primitive repeated placeholders](https://github.com/command-line-interface-pages/syntax/blob/main/type-specific/cli.md#repeated-primitive-placeholders)
```md
- [c]reate an archive and write it to a [f]ile:
`tar {option mode: --create, -c} {option: --file, -f} {/?file archive: target.tar} {/?path+ input}`
```
### Also see
{: .-one-column}
* [Render](https://github.com/command-line-interface-pages/v2-tooling/tree/main/clip-view)
* [Page's repository](https://github.com/command-line-interface-pages/cli-pages)
* [Syntax](https://github.com/command-line-interface-pages/syntax/blob/main/base.md)

1
co.md
View File

@ -1,7 +1,6 @@
---
title: co
category: JavaScript libraries
layout: 2017/sheet
updated: 2017-10-27
weight: -1
intro: |

View File

@ -3,6 +3,9 @@ title: Command line stuff
---
## List (ls)
{: .-three-column}
### Usage
ls [options] [paths]
@ -18,14 +21,12 @@ title: Command line stuff
|---
| `-F` | Add / after directories |
| `-G` | Color |
{:.shortcuts}
### Options
| `-R` | Recurse |
| `-a` | Include hidden (dotfiles) |
| `-A` | Include hidden (but not . and ..) |
{:.shortcuts}
### Sorting
@ -39,11 +40,11 @@ title: Command line stuff
| `-c` | sort by time status was changed |
|---
| `-h` | Human-readable size (3k) |
{:.shortcuts}
<br>
## Tail
{: .-three-column}
### Usage
tail [-F | -f | -r] [-bN | -cN | -nN] [file ...]
@ -52,7 +53,6 @@ title: Command line stuff
| `-f` | follow |
| `-F` | follow by filename (accounts for log rotation) |
| `-r` | Reverse order |
{:.shortcuts}
### Options
@ -60,11 +60,13 @@ title: Command line stuff
| `-cN` | N bytes |
| `-nN` | N lines |
| `+N` | Start from line N |
{:.shortcuts}
<br>
## Sudo
{: .-three-column}
### Usage
```
sudo [options] <command>
@ -73,7 +75,6 @@ sudo [options] <command>
### Listing
| `-l` | List allowed commands |
{:.shortcuts}
### Options
@ -84,17 +85,14 @@ sudo [options] <command>
| `-n` | Don't prompt for password |
| `-P` | Preserve group vector |
| `-S` | Read password from stdin |
{:.shortcuts}
### File descriptors
| `-C fd` | Close all open file descriptors |
{:.shortcuts}
### Prompt
| `-p prompt` | Custom prompt (-p "%p password:") |
{:.shortcuts}
### Interactive
@ -105,38 +103,33 @@ sudo [options] <command>
|----
| `-u user` | run as this user |
| `-g group` | run as this group |
{:.shortcuts}
### Timestamp
| `-v` | revalidate timestamp for 5 mins |
| `-k` | invalidate timestamp |
| `-K` | just like -k |
{:.shortcuts}
<br>
## wc (Word count)
{: .-three-column}
### wc
```
... | wc [options]
```
### Options
| `-c` | Bytes |
| `-l` | Lines |
| `-m` | Characters (incl multi-byte) |
| `-w` | Words |
{:.shortcuts}
<br>
## Search-and-replace in all files
perl -p -i -e 's/hello/HELLO/g' **/*
<br>
## Grep
{: .-three-column}
### Usage
```
grep [options] [pattern] [file ...]
@ -164,9 +157,15 @@ grep [options] [pattern] [file ...]
| `-r, -R` | --recursive |
| `-v` | --invert-match |
| `-i` | --ignore-case |
{:.shortcuts}
### Synonyms
egrep => grep -E
fgrep => grep -F
## Other recipes
{: .-three-column}
### Search-and-replace in all files
perl -p -i -e 's/hello/HELLO/g' **/*

View File

@ -1,5 +0,0 @@
---
title: Commander.js
category: Hidden
redirect_to: /commander.js
---

View File

@ -3,6 +3,11 @@ title: Commander.js
category: JavaScript libraries
---
### About
{: .-intro}
- <https://github.com/tj/commander.js/>
### Initialize
var cli = require('commander');

View File

@ -1,49 +1,84 @@
---
title: composer
category: CLI
layout: 2017/sheet
weight: -1
authors:
- github: benolot
updated: 2018-03-06
updated: 2020-02-23
description: |
Basic guide on how to use Composer, the PHP Package manager.
---
All composer commands, depending on your install, may need to use `php composer.phar` in the install folder for composer, instead of plain `composer`.
### Package management
All composer commands, depending on your install, may need to use `php composer.phar` in the install folder for composer, instead of global/plain `composer`.
### Installing dependencies
| Command | Description |
| --- | --- |
| `composer install` | Install everything in composer.json |
| `composer install` | Downloads and installs all the libraries and dependencies outlined in the `composer.lock` file. If the file does not exist it will look for composer.json and do the same, creating a `composer.lock` file. |
| --- | --- |
| `composer install laravel` | Install a package |
| `composer install laravel --dry-run` | Simulates the install without installing anything |
| `composer install laravel --no-scripts`| Skips post-download scripts |
| `composer install --dry-run` | Simulates the install without installing anything |
### Updating
This command doesn't change any file. If `composer.lock` is not present, it will create it.
| Command | Description |
| --- | --- |
| `composer update` | Update all packages |
| --- | --- |
| `composer update laravel` | Update a certain package |
| `composer update vendor/*`| Update all packages in a folder |
| `composer update --lock` | Update lock file hash without updating any packages |
`composer.lock` **should always** be committed to the repository. It has all the information needed to bring the
local dependencies to the last committed state. If that file is modified on the repository, you will need to run
`composer install` again after fetching the changes to update your local dependencies to those on that file.
### Updating packages
| Command | Description |
| --- | --- |
| `composer update` | Updates all packages |
| `composer update --with-dependencies` | Updates all packages and its dependencies |
| --- | --- |
| `composer update vendor/package` | Updates a certain `package` from `vendor` |
| `composer update vendor/*` | Updates all packages from `vendor` |
| `composer update --lock` | Updates `composer.lock` hash without updating any packages |
### Requiring
This command changes only the `composer.lock` file.
### Updating autoloader
| Command | Description |
| --- | --- |
| `composer dumpautoload -o` | Generates optimized autoload files |
### Adding packages
| Command | Description |
| --- | --- |
| `composer require laravel`. | Add new package to composer.json and install it |
| `composer require vendor/package` | Adds `package` from `vendor` to composer.json's `require` section and installs it |
| --- | --- |
| `composer require laravel --dev` | Add new package to `require-dev` and install it. |
| `composer require vendor/package --dev` | Adds `package` from `vendor` to composer.json's `require-dev` section and installs it. |
### Removing
This command changes both the `composer.json` and `composer.lock` files.
### Passing versions
| Command | Description |
| ----------------------------------------------- | ---------------------------------------- |
| `composer require vendor/pkg "1.3.2"` | Installs `1.3.2` |
| `composer require vendor/pkg ">=1.3.2"` | Above or equal `1.3.2` |
| `composer require vendor/pkg "<1.3.2"` | Below `1.3.2` |
| `composer require vendor/pkg "1.3.*"` | Latest of `>=1.3.0 <1.4.0` |
| `composer require vendor/pkg "~1.3.2"` | Latest of `>=1.3.2 <1.4.0` |
| `composer require vendor/pkg "~1.3"` | Latest of `>=1.3.0 <2.0.0` |
| `composer require vendor/pkg "^1.3.2"` | Latest of `>=1.3.2 <2.0.0` |
| `composer require vendor/pkg "^1.3"` | Latest of `>=1.3.0 <2.0.0` |
| `composer require vendor/pkg "^0.3.2"` | Latest of `>=0.3.0 <0.4.0` (for pre-1.0) |
| `composer require vendor/pkg "dev-BRANCH_NAME"` | From the branch `BRANCH_NAME` |
### Removing packages
| Command | Description |
| --- | --- |
| `composer remove laravel` | Remove new package from composer.json and uninstall it |
| `composer remove vendor/package` | Removes `vendor/package` from composer.json and uninstalls it |
This command changes both the `composer.json` and `composer.lock` files.
### Verifying
| Command | Description |
| ---------------------------- | -------------------------------------------------------------------------- |
| `composer outdated --direct` | Show only packages that are outdated directly required by the root package |

View File

@ -1,25 +1,33 @@
---
title: Cordova
title: Apache Cordova
intro: |
A quick reference to common [Apache Cordova](https://cordova.apache.org/) commands.
---
cordova plugin ls
cordova plugin search facebook
cordova plugin add com.phonegap.plugins.facebookconnect
### Common commands
cordova platform add ios
cordova platform ls
cordova platform update ios
cordova platform check
```
cordova plugin ls
cordova plugin search facebook
cordova plugin add com.phonegap.plugins.facebookconnect
```
### Some plugins
```
cordova platform add ios
cordova platform ls
cordova platform update ios
cordova platform check
```
You'll likely need these:
### Common plugins
* [org.apache.cordova.console](https://github.com/apache/cordova-plugin-console)
* [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser)
* [org.apache.cordova.statusbar](https://github.com/apache/cordova-plugin-statusbar)
* org.apache.cordova.splashscreen
Some commonly-used plugins:
- [org.apache.cordova.console](https://github.com/apache/cordova-plugin-console)
- [org.apache.cordova.inappbrowser](https://github.com/apache/cordova-plugin-inappbrowser)
- [org.apache.cordova.statusbar](https://github.com/apache/cordova-plugin-statusbar)
- org.apache.cordova.splashscreen
Also:
* com.phonegap.plugins.facebookconnect
- com.phonegap.plugins.facebookconnect

53
cron.md
View File

@ -1,8 +1,7 @@
---
title: Cron
category: CLI
layout: 2017/sheet
updated: 2017-08-26
updated: 2024-03-17
weight: -3
---
@ -30,30 +29,50 @@ Min Hour Day Mon Weekday
```
{: .-setup.-box-chars}
### Operators
| Operator | Description |
| --- | --- |
| `*` | all values |
| `,` | separate individual values |
| `-` | a range of values |
| `/` | divide a value into steps |
### Special strings
| String | Description |
| --- | --- |
| `@reboot` | every rebot |
| `@hourly` | once every hour - same as `0 * * * *` |
| `@daily` | once every day - same as `0 0 * * *` |
| `@midnight` | once every midnight - same as `@daily` |
| `@weekly` | once every week - same as `0 0 * * 0` |
| `@monthly` | once every month - same as `0 0 1 * *` |
| `@yearly` | once every year - same as `0 0 1 1 *` |
### Examples
| Example | Description |
| --- | --- |
| `0 * * * *` | every hour |
| `*/15 * * * *` | every 15 mins |
| `0 */2 * * *` | every 2 hours |
| `0 0 * * 0` | every Sunday midnight |
| --- | --- |
| `@reboot` | every reboot |
| Example | Description |
| --- | --- |
| `0 * * * *` | every hour |
| `*/15 * * * *` | every 15 mins |
| `0 */2 * * *` | every 2 hours |
| `0 18 * * 0-6` | every week Mon-Sat at 6pm |
| `10 2 * * 6,7` | every Sat and Sun on 2:10am |
| `0 0 * * 0` | every Sunday midnight |
### Crontab
```bash
# Adding tasks easily
echo "@reboot echo hi" | crontab
```
```bash
# Open in editor
crontab -e
```
# Open in editor - optional for another user
crontab -e [-u user]
```bash
# List tasks
# List tasks - optional for another user
crontab -l [-u user]
# Delete crontab file - optional for another user
crontab -r [-u user]
```

View File

@ -1,9 +0,0 @@
---
title: Cryptography
---
* [PBKDF2](http://en.wikipedia.org/wiki/PBKDF2) - password-based key derivation
function
* [HMAC](http://en.wikipedia.org/wiki/HMAC) - Hash-based message authentication
code

194
csharp7.md Normal file
View File

@ -0,0 +1,194 @@
---
title: C# 7
category: C-like
updated: 2018-12-06
prism_languages: [csharp]
description: |
A quick overview of C# 7
---
### Out Variables
```csharp
public void PrintCoordinates(Point p)
{
p.GetCoordinates(out int x, out int y);
WriteLine($"({x}, {y})");
}
```
`out` is used to declare a variable at the point where it is passed as an argument.
### Pattern Matching
#### Is-expressions with patterns
```csharp
public void PrintStars(object o)
{
if (o is null) return; // constant pattern "null"
if (!(o is int i)) return; // type pattern "int i"
WriteLine(new string('*', i));
}
```
#### Switch statements with patterns
```csharp
switch(shape)
{
case Circle c:
WriteLine($"circle with radius {c.Radius}");
break;
case Rectangle s when (s.Length == s.Height):
WriteLine($"{s.Length} x {s.Height} square");
break;
case Rectangle r:
WriteLine($"{r.Length} x {r.Height} rectangle");
break;
default:
WriteLine("<unknown shape>");
break;
case null:
throw new ArgumentNullException(nameof(shape));
}
```
### Tuples
#### Tuple type
```csharp
(string, string, string) LookupName(long id) // tuple return type
{
... // retrieve first, middle and last from data storage
return (first, middle, last); // tuple literal
}
```
```csharp
var names = LookupName(id);
WriteLine($"found {names.Item1} {names.Item3}.");
```
#### Tuple elements with name
```csharp
(string first, string middle, string last) LookupName(long id) // tuple elements have names
```
```csharp
var names = LookupName(id);
WriteLine($"found {names.first} {names.last}.");
```
#### Tuple Literals
```csharp
return (first: first, middle: middle, last: last); // named tuple elements in a literal
```
#### Tuple Deconstruction
```csharp
(var first, var middle, var last) = LookupName(id1);
WriteLine($"found {first} {last}.");
```
or
```csharp
var (first, middle, last) = LookupName(id1); // var outside
```
or
```csharp
(first, middle, last) = LookupName(id2); // assign onto existing variables
```
### Local Functions
```csharp
public int Fibonacci(int x)
{
if (x < 0) throw new ArgumentException("Less negativity please!", nameof(x));
return Fib(x).current;
(int current, int previous) Fib(int i)
{
if (i == 0) return (1, 0);
var (p, pp) = Fib(i - 1);
return (p + pp, p);
}
}
```
### Literal Improvements
#### Digit Separator inside numbers literals
```csharp
var d = 123_456;
var x = 0xAB_CD_EF;
```
#### Binary Literals
```csharp
var b = 0b1010_1011_1100_1101_1110_1111;
```
### Ref Returns and Locals
```csharp
public ref int Find(int number, int[] numbers)
{
for (int i = 0; i < numbers.Length; i++)
{
if (numbers[i] == number)
{
return ref numbers[i]; // return the storage location, not the value
}
}
throw new IndexOutOfRangeException($"{nameof(number)} not found");
}
int[] array = { 1, 15, -39, 0, 7, 14, -12 };
ref int place = ref Find(7, array); // aliases 7's place in the array
place = 9; // replaces 7 with 9 in the array
WriteLine(array[4]); // prints 9
```
### More Expression Bodied Members
C# 7.0 adds accessors, constructors and finalizers to the list of things that can have expression bodies:
```csharp
class Person
{
private static ConcurrentDictionary<int, string> names = new ConcurrentDictionary<int, string>();
private int id = GetId();
public Person(string name) => names.TryAdd(id, name); // constructors
~Person() => names.TryRemove(id, out *); // destructors
public string Name
{
get => names[id]; // getters
set => names[id] = value; // setters
}
}
```
### Throw Expressions
```csharp
class Person
{
public string Name { get; }
public Person(string name) => Name = name ?? throw new ArgumentNullException(name);
public string GetFirstName()
{
var parts = Name.Split(" ");
return (parts.Length > 0) ? parts[0] : throw new InvalidOperationException("No name!");
}
public string GetLastName() => throw new NotImplementedException();
}
```

View File

@ -1,5 +0,0 @@
---
title: CSS animations
category: Hidden
redirect_to: /css#animation
---

View File

@ -1,8 +1,7 @@
---
title: CSS antialiasing
category: CSS
layout: 2017/sheet
updated: 2017-08-26
updated: 2017-10-13
intro: |
Here's a 4-line snippet on how to get beautiful, antialiased text with CSS.
---

View File

@ -1,6 +0,0 @@
---
title: CSS background
category: Hidden
redirect_to: /css#background
---

View File

@ -1,8 +1,7 @@
---
title: CSS flexbox
category: CSS
layout: 2017/sheet
updated: 2017-08-29
updated: 2020-06-13
prism_languages: [css]
weight: -3
---
@ -53,9 +52,12 @@ weight: -3
```
```css
justify-content: flex-start; /* horizontal alignment - default */
justify-content: flex-end;
justify-content: center;
justify-content: flex-start; /* [xxx ] */
justify-content: center; /* [ xxx ] */
justify-content: flex-end; /* [ xxx] */
justify-content: space-between; /* [x x x] */
justify-content: space-around; /* [ x x x ] */
justify-content: space-evenly; /* [ x x x ] */
```
```css
@ -191,4 +193,4 @@ Vertically-center all items.
{: .-one-column}
* [MDN: Using CSS flexbox](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes)
* [Ultimate flexbox cheatsheet](http://www.sketchingwithcss.com/samplechapter/cheatsheet.html)
* [Ultimate flexbox cheatsheet](https://www.sketchingwithcss.com/samplechapter/cheatsheet.html)

View File

@ -1,5 +0,0 @@
---
title: CSS font
category: Hidden
redirect_to: /css#fonts
---

255
css-grid.md Normal file
View File

@ -0,0 +1,255 @@
---
title: CSS Grid
category: CSS
updated: 2019-08-23
prism_languages: [css]
---
### Container
```css
.grid-container {
```
{: .-setup}
```css
/* Display properties */
display: grid;
display: inline-grid;
```
```css
/* Columns and rows */
grid-template-columns: 1rem 2rem 1rem; /* Measurement units */
grid-template-columns: 25% 50% 25%; /* Percentage units */
grid-template-columns: 1rem auto 1rem 2fr; /* Fill remaining widths with auto or fr units */
grid-template-columns: repeat(12, 1fr); /* Repeat columns without needing to write them */
grid-template-columns: subgrid; /* Use column tracks defined on parent grid */
grid-template-rows: 1rem 10% auto repeat(5, 10px); /* Mix any group, same rules work for rows */
grid-template-rows: subgrid; /* Use row tracks defined on parent grid */
```
```css
/* Automatic columns and rows */
grid-auto-columns: 10px; /* No matter how many columns of content end up in the grid, each column will be this same width */
grid-auto-rows: 1rem; /* No matter how many rows of content end up in the grid, each row will be this same height */
```
```css
/* Areas */
grid-template-areas:
"header header"
"main aside"
"footer footer"; /* Grid-style */
grid-template-areas: "header header" "main aside" "footer footer"; /* Inline-style */
```
```css
/* Template shorthand */
grid-template:
"header header" auto
"main aside" 100vh
"footer footer" 10rem
/ 80% 20%;
/* The above is the same as below long-hand */
grid-template-columns: 80% 20%;
grid-template-rows: auto 100vh 10rem;
grid-template-areas:
"header header"
"main aside"
"footer footer";
```
```css
/* Gaps */
grid-row-gap: 1rem;
grid-column-gap: 0.5rem; /* Define values separately */
grid-gap: 1rem 0.5rem; /* Short-hand for row / column */
grid-gap: 1rem; /* Gap in both dimensions */
```
```css
/* Item justification (horizontal or column alignment) */
justify-items: start; /* Align items to the left */
justify-items: center; /* Align items centered within its column */
justify-items: end; /* Align items to the right */
justify-items: stretch; /* (default) Fills available area (horizontally) */
```
```css
/* Item alignment (vertical or row alignment) */
align-items: start; /* Align items to the top */
align-items: center; /* Align items centered within its row */
align-items: end; /* Align items to the bottom */
align-items: stretch; /* (default) Fills available area (vertically) */
```
```css
/* Place item shorthand */
place-items: start stretch;
/* The above is the same as below long-hand */
align-items: start;
justify-items: stretch;
```
```css
/* Content justification (horizontal or column alignment) */
justify-content: start; /* Align content to the left */
justify-content: center; /* Align content centered horizontally within the grid */
justify-content: end; /* Align content to the right */
justify-content: stretch; /* (default) Fills available area (horizontally) */
justify-content: space-around; /* Chooses a space for both sides of the columns like a left and right margin */
justify-content: space-between; /* Chooses a space to go between columns, no margins on outside of content */
justify-content: space-evenly; /* Chooses a space that goes between all columns and edges consistently */
```
```css
/* Content alignment (horizontal or column alignment) */
align-content: start; /* Align content to the top */
align-content: center; /* Align content centered vertically within the grid */
align-content: end; /* Align content to the bottom */
align-content: stretch; /* (default) Fills available area (vertically) */
align-content: space-around; /* Chooses a space for the top and bottom of the rows like a top and bottom margin */
align-content: space-between; /* Chooses a space to go between rows, no margins on outside of content */
align-content: space-evenly; /* Chooses a space that goes between all rows and edges consistently */
```
```css
/* Place item shorthand */
place-content: center start;
/* The above is the same as below long-hand */
align-content: center;
justify-content: start;
```
```css
/* Automatic grid positioning */
grid-auto-flow: row; /* Left-to-right rows, then top-to-bottom*/
grid-auto-flow: column; /* Top-to-bottom columns, then left-to-right */
grid-auto-flow: dense; /* Responds with best-guess on left-to-right, top-to-bottom order with advanced layouts */
```
```css
/* There is one final shorthand for all container properties in one */
/* Explicit grid columns, rows, and areas */
grid:
"header header" auto
"main aside" 100vh
"footer footer" 10rem
/ 80% 20%; /* You can include a template as the only value, which is equivalent to below */
grid-template:
"header header" auto
"main aside" 100vh
"footer footer" 10rem
/ 80% 20%; /* Which is again equivalent to below */
grid-template-columns: 80% 20%;
grid-template-rows: auto 100vh 10rem;
grid-template-areas:
"header header"
"main aside"
"footer footer";
/* Automatic grid flows */
grid: 1rem / auto-flow dense 1fr; /* You can include rows, a flow, and automatic columns, which is equivalent to below */
grid-template-rows: 1rem;
grid-auto-flow: dense;
grid-auto-columns: 1fr;
grid: auto-flow dense 1rem / repeat(10, 10%); /* Conversely, you can do the same thing with automatic rows, and defined columns */
grid-auto-flow: dense;
grid-auto-rows: 1rem;
grid-template-columns: repeat(10, 10%);
```
```css
}
```
{: .-setup}
### Child
```css
.grid-child {
```
{: .-setup}
```css
/* Column position */
grid-column-start: 1;
grid-column-end: 2;
grid-column: 1 / 2; /* Short hand */
grid-column: 1 / span 2; /* Span 2 columns without explicitly defining an endpoint */
grid-column: 1; /* Start in and occupy a single column */
```
```css
/* Row position */
grid-row-start: 2;
grid-row-end: 4;
grid-row: 2 / 4; /* Short hand */
grid-row: 2 / span 3;/* Span 3 rows without explicitly defining an endpoint */
grid-row: 1; /* Start in and occupy a single row */
```
```css
/* Area positioning */
grid-area: header; /* You can use a named grid area from the container */
grid-area: 2 / 1 / 4 / 2; /* Or you can use positioning. This is equivalent to... */
grid-row-start: 2;
grid-column-start: 1;
grid-row-end: 4;
grid-column-end: 2;
```
```css
/* Self justification (horizontal or column alignment) */
justify-self: start; /* Align item to the left */
justify-self: center; /* Align item centered within its column */
justify-self: end; /* Align item to the right */
justify-self: stretch; /* (default) Fills available area (horizontally) */
```
```css
/* Self alignment (vertical or row alignment) */
align-self: start; /* Align item to the top */
align-self: center; /* Align item centered within its row */
align-self: end; /* Align item to the bottom */
align-self: stretch; /* (default) Fills available area (vertically) */
```
```css
/* Placement shorthand */
place-self: start stretch;
/* The above is the same as below long-hand */
align-self: start;
justify-self: stretch;
```
```css
}
```
{: .-setup}
## References
{: .-one-column}
* [GRID: A simple visual cheatsheet](http://grid.malven.co/)
* [CSS Tricks: A Complete Guide to Grid](https://css-tricks.com/snippets/css/complete-guide-grid/)
* [Browser support](https://caniuse.com/#feat=css-grid)

View File

@ -1,5 +0,0 @@
---
title: CSS selectors
category: Hidden
redirect_to: /css#selectors
---

View File

@ -1,7 +1,6 @@
---
title: "CSS system fonts"
category: CSS
layout: 2017/sheet
weight: -3
tags: [Featurable]
---

View File

@ -1,7 +1,6 @@
---
title: CSS tricks
category: CSS
layout: 2017/sheet
---
### Heading kerning pairs and ligature

66
css.md
View File

@ -1,7 +1,6 @@
---
title: CSS
category: CSS
layout: 2017/sheet
weight: -1
keywords:
- "margin, padding, border"
@ -24,13 +23,14 @@ keywords:
```
{: .-setup}
| Selector | Description |
| ----------------- | ----------- |
| `div` | Element |
| `.class` | Class |
| `#id` | ID |
| `[disabled]` | Attribute |
| `[role="dialog"]` | Attribute |
| Selector | Description |
| ----------------- | ------------ |
| `*` | All elements |
| `div` | Element |
| `.class` | Class |
| `#id` | ID |
| `[disabled]` | Attribute |
| `[role="dialog"]` | Attribute |
### Combinators
@ -40,34 +40,40 @@ keywords:
| `.parent > .child` | Direct descendant |
| `.child + .sibling` | Adjacent sibling |
| `.child ~ .sibling` | Far sibling |
| `.class1.class2` | Have both classes |
### Attribute selectors
| Selector | Description |
| ----------------- | ----------------------------------- |
| `[role="dialog"]` | `=` Exact |
| `[class~="box"]` | `~=` Has word |
| `[class|="box"]` | `|=` Exact or prefix (eg, `value-`) |
| `[href$=".doc"]` | `$=` Ends in |
| `[class*="-is-"]` | `*=` Contains |
| Selector | Description |
| ------------------ | ----------------------------------- |
| `[role="dialog"]` | `=` Exact |
| `[class~="box"]` | `~=` Has word |
| `[class|="box"]` | `|=` Exact or prefix (eg, `value-`) |
| `[href$=".doc"]` | `$=` Ends in |
| `[href^="/index"]` | `^=` Begins with |
| `[class*="-is-"]` | `*=` Contains |
### Pseudo-classes
| Selector | Description |
| -------------------- | ------------------------ |
| `:target` | eg, `h2#foo:target` |
| --- | --- |
| `:disabled` | |
| `:focus` | |
| `:active` | |
| --- | --- |
| `:nth-child(3)` | 3rd child |
| `:nth-child(3n+2)` | 2nd child in groups of 3 |
| `:nth-child(-n+4)` | |
| --- | --- |
| `:nth-last-child(2)` | |
| `:nth-of-type(2)` | |
| --- | --- |
| Selector | Description |
| -------------------- | ------------------------------------------ |
| `:target` | eg, `h2#foo:target` |
| --- | --- |
| `:focus` | |
| `:active` | |
| --- | --- |
| `:nth-child(3)` | 3rd child |
| `:nth-child(3n+2)` | 2nd child in groups of 3 |
| `:nth-child(-n+4)` | |
| --- | --- |
| `:nth-last-child(2)` | |
| `:nth-of-type(2)` | |
| --- | --- |
| `:checked` | Checked inputs |
| `:disabled` | Disabled elements |
| `:default` | Default element in a group |
| --- | --- |
| `:empty` | Elements without children |
### Pseudo-class variations

View File

@ -1,8 +1,7 @@
---
title: cssnext
category: CSS
layout: 2017/sheet
updated: 2017-08-30
updated: 2017-10-30
tags: [Featurable]
weight: -3
---

Some files were not shown because too many files have changed in this diff Show More