Skip to content

Commit

Permalink
Content formatting update (part 5) (rstacruz#1969)
Browse files Browse the repository at this point in the history
  • Loading branch information
rstacruz authored Mar 14, 2023
1 parent 05890aa commit 39a6c1a
Show file tree
Hide file tree
Showing 38 changed files with 311 additions and 174 deletions.
1 change: 1 addition & 0 deletions angularjs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ title: Angular.js
category: JavaScript libraries
tags: [Archived]
archived: This describes an older version of Angular.
layout: 2017/sheet
---

### About
Expand Down
21 changes: 12 additions & 9 deletions ansible.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
---
title: Ansible
category: Ansible
layout: 2017/sheet
---

{% raw %}

## Getting started

### About
{: .-intro}

- <https://www.ansible.com/>

### Hosts

$ sudo mkdir /etc/ansible
Expand All @@ -20,7 +26,9 @@ category: Ansible

$ ansible-playbook playbook.yml

## Tasks
## Playbook files

### Tasks

- hosts: all
user: root
Expand All @@ -39,7 +47,7 @@ category: Ansible
handlers:
- include: db.yml user=timmy

## Handlers
### Handlers

handlers:
- name: start apache2
Expand All @@ -51,7 +59,7 @@ category: Ansible
notify:
- start apache2

## Vars
### Vars

- host: lol
vars_files:
Expand All @@ -63,7 +71,7 @@ category: Ansible
file: state=directory path=${project_root}/home/.ssh/
only_if: "$vm == 0"

## Roles
### Roles

- host: xxx
roles:
Expand Down Expand Up @@ -91,9 +99,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 %}
12 changes: 8 additions & 4 deletions arel.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
---
title: Arel
category: Rails
layout: 2017/sheet
---

### About
{: .-intro}

Arel is an SQL abstraction library built into Ruby on Rails.

* <https://github.com/rails/arel>

### Tables

```rb
Expand Down Expand Up @@ -123,7 +131,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>
5 changes: 3 additions & 2 deletions cask-index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
---
title: Caskroom index
layout: 2017/sheet
tags: [Archived]
archived: This sheet may have outdated information.
---


# Caskroom


#### A

Expand Down
12 changes: 8 additions & 4 deletions circle.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
---
title: CircleCI
category: Devops
layout: 2017/sheet
---

## 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
Expand All @@ -14,7 +20,7 @@ category: Devops

See: <https://circleci.com/docs/configuration>

## Sample
### Sample

```yml
## Customize the test machine
Expand Down Expand Up @@ -91,5 +97,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>
50 changes: 25 additions & 25 deletions command_line.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
---
title: Command line stuff
layout: 2017/sheet
---

## List (ls)
{: .-three-column}

### Usage

ls [options] [paths]

Expand All @@ -18,14 +22,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

Expand All @@ -39,11 +41,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 ...]

Expand All @@ -52,19 +54,20 @@ title: Command line stuff
| `-f` | follow |
| `-F` | follow by filename (accounts for log rotation) |
| `-r` | Reverse order |
{:.shortcuts}

### Options

| `-bN` | N*512 bytes |
| `-cN` | N bytes |
| `-nN` | N lines |
| `+N` | Start from line N |
{:.shortcuts}

<br>

## Sudo
{: .-three-column}

### Usage

```
sudo [options] <command>
Expand All @@ -73,7 +76,6 @@ sudo [options] <command>
### Listing

| `-l` | List allowed commands |
{:.shortcuts}

### Options

Expand All @@ -84,17 +86,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

Expand All @@ -105,38 +104,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 ...]
Expand Down Expand Up @@ -164,9 +158,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' **/*
6 changes: 6 additions & 0 deletions commander.js.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
---
title: Commander.js
category: JavaScript libraries
layout: 2017/sheet
---

### About
{: .-intro}

- <https://github.com/tj/commander.js/>

### Initialize

var cli = require('commander');
Expand Down
20 changes: 13 additions & 7 deletions devise.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
---
title: Devise
layout: 2017/sheet
---

### About
{: .-intro}

[Devise](https://github.com/plataformatec/devise) is a flexible authentication
gem.

Installation
------------
- <https://github.com/plataformatec/devise>

### Installation

Rails 3: Add the following to your Gemfile

Expand All @@ -27,8 +32,7 @@ Generate devise for your model

$ rails generate devise:views

Helpers
-------
### Helpers

user_signed_in?
current_user
Expand All @@ -38,8 +42,7 @@ Helpers
edit_user_registration_path (Edit registration)
new_user_registration_path (Register new user)

Controller stuff
----------------
### Controller stuff

before_filter :authenticate_user!

Expand Down Expand Up @@ -123,8 +126,11 @@ Routing
Test helpers
------------

### Test helpers

include Devise::TestHelpers
https://github.com/plataformatec/devise/blob/1094ba65aac1d37713f2cba71f9edad76b5ca274/lib/devise/test_helpers.rb

sign_in @user
sign_out @user

See: <https://github.com/plataformatec/devise/blob/1094ba65aac1d37713f2cba71f9edad76b5ca274/lib/devise/test_helpers.rb>
3 changes: 2 additions & 1 deletion elixir-metaprogramming.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
---
title: Elixir metaprogramming
category: Elixir
layout: 2017/sheet
---

## Kernel
### Kernel

Most of these magic is defined in [Kernel.SpecialForms](http://devdocs.io/elixir/elixir/kernel.specialforms).

Expand Down
3 changes: 3 additions & 0 deletions firefox.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
---
title: Firefox
layout: 2017/sheet
tags: [Archived]
archived: This sheet has not been updated with newer Firefox releases.
---

### [Firefox 31](https://www.mozilla.org/en-US/firefox/31.0/releasenotes/) (July 2014)
Expand Down
Loading

0 comments on commit 39a6c1a

Please sign in to comment.