Update more sheets

This commit is contained in:
Rico Sta. Cruz 2017-08-29 23:57:21 +08:00
parent 26384b35ad
commit e116ff32bf
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
9 changed files with 202 additions and 91 deletions

View File

@ -37,8 +37,11 @@ Each sheet supports these metadata:
title: React.js title: React.js
category: React category: React
layout: 2017/sheet # 'default' | '2017/sheet' layout: 2017/sheet # 'default' | '2017/sheet'
ads: false # Add this to disable ads
# Optional:
updated: 201708 # To show in the updated list (update _config.yml) updated: 201708 # To show in the updated list (update _config.yml)
ads: false # Add this to disable ads
weight: -5 # lower number = higher in related posts list
--- ---
``` ```

View File

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

View File

@ -0,0 +1,18 @@
---
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

@ -50,7 +50,9 @@
} }
} }
.MarkdownBody pre.-setup { .MarkdownBody pre.-setup,
.MarkdownBody p.-setup,
.MarkdownBody ul.-setup {
background: $gray-bg; background: $gray-bg;
} }

View File

@ -1,61 +1,104 @@
--- ---
title: CSS flexbox title: CSS flexbox
category: CSS category: CSS
layout: 2017/sheet
updated: 201708.29
weight: -3
--- ---
### Simple example
```css
.container { .container {
display: flex; display: flex;
} }
```
.container.vertical { ```css
flex-direction: column;
}
.container > div { .container > div {
flex: /* grow, shrink, basis */; flex: 1 1 auto;
flex: 0 0 40px; /* fixed width */
flex: 0 1 auto; /* dynamic width */
order: 1;
} }
```
### Full reference ### Container
```css
.container { .container {
```
{: .-setup}
```css
display: flex; display: flex;
display: inline-flex; display: inline-flex;
```
```css
flex-direction: row; /* ltr - default */ flex-direction: row; /* ltr - default */
flex-direction: row-reverse; /* rtl */ flex-direction: row-reverse; /* rtl */
flex-direction: column; /* top-bottom */ flex-direction: column; /* top-bottom */
flex-direction: column-reverse; /* bottom-top */ flex-direction: column-reverse; /* bottom-top */
```
```css
flex-wrap: nowrap; /* one-line */ flex-wrap: nowrap; /* one-line */
flex-wrap: wrap; /* multi-line */ flex-wrap: wrap; /* multi-line */
```
```css
align-items: flex-start; /* vertical-align to top */ align-items: flex-start; /* vertical-align to top */
align-items: flex-end; /* vertical-align to bottom */ align-items: flex-end; /* vertical-align to bottom */
align-items: center; /* vertical-align to center */ align-items: center; /* vertical-align to center */
align-items: stretch; /* same height on all (default) */ align-items: stretch; /* same height on all (default) */
```
```css
justify-content: flex-start; /* horizontal alignment - default */ justify-content: flex-start; /* horizontal alignment - default */
justify-content: flex-end; justify-content: flex-end;
justify-content: center; justify-content: center;
```
```css
} }
```
{: .-setup}
### Child
```css
.container > div { .container > div {
flex: 1 0 0; ```
order: 1; {: .-setup}
flex-grow: 0;
```css
/* This: */
flex: 1 0 auto;
/* Is equivalent to this: */
flex-grow: 1;
flex-shrink: 0;
flex-basis: auto;
```
```css
order: 1;
```
```css
align-self: flex-start; /* left */ align-self: flex-start; /* left */
margin-left: auto; /* right */ margin-left: auto; /* right */
```
```css
} }
```
{: .-setup}
## Tricks ## Tricks
### Vertical center ### Vertical center
```css
.container { .container {
display: flex; display: flex;
} }
@ -65,17 +108,21 @@ category: CSS
height: 100px; height: 100px;
margin: auto; margin: auto;
} }
```
### Vertical center (2) ### Vertical center (2)
```css
.container { .container {
display: flex; display: flex;
align-items: center; /* vertical */ align-items: center; /* vertical */
justify-content: center; /* horizontal */ justify-content: center; /* horizontal */
} }
```
### Reordering ### Reordering
```css
.container > .top { .container > .top {
order: 1; order: 1;
} }
@ -83,11 +130,12 @@ category: CSS
.container > .bottom { .container > .bottom {
order: 2; order: 2;
} }
```
### Mobile layout ### Mobile layout
A fixed-heighttop bar and a dynamic-height content area.
```css
.container { .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
@ -101,12 +149,13 @@ A fixed-heighttop bar and a dynamic-height content area.
height: 100px; height: 100px;
flex: 1 0 auto; flex: 1 0 auto;
} }
```
A fixed-height top bar and a dynamic-height content area.
### Table-like ### Table-like
This creates columns that have different widths, but size accordingly according ```css
to the circumstances.
.container { .container {
display: flex; display: flex;
} }
@ -115,21 +164,31 @@ to the circumstances.
.container > .checkbox { flex: 1 0 20px; } .container > .checkbox { flex: 1 0 20px; }
.container > .subject { flex: 1 0 400px; } .container > .subject { flex: 1 0 400px; }
.container > .date { flex: 1 0 120px; } .container > .date { flex: 1 0 120px; }
```
This creates columns that have different widths, but size accordingly according
to the circumstances.
### Vertical ### Vertical
Vertically-center all items.
```css
.container { .container {
align-items: center; align-items: center;
} }
```
Vertically-center all items.
### Left and right ### Left and right
```css
.menu > .left { align-self: flex-start; } .menu > .left { align-self: flex-start; }
.menu > .right { align-self: flex-end; } .menu > .right { align-self: flex-end; }
```
### References ## References
{: .-one-column}
* [MDN: Using CSS flexbox](https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Flexible_boxes) * [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](http://www.sketchingwithcss.com/samplechapter/cheatsheet.html)

View File

@ -1,8 +1,11 @@
--- ---
title: "CSS: System font stack" title: "CSS system font stack"
category: CSS category: CSS
layout: 2017/sheet
--- ---
### System fonts
```css ```css
font-family: -apple-system, BlinkMacSystemFont, font-family: -apple-system, BlinkMacSystemFont,
"Segoe UI", "Roboto", "Oxygen", "Segoe UI", "Roboto", "Oxygen",
@ -10,6 +13,10 @@ font-family: -apple-system, BlinkMacSystemFont,
"Droid Sans", "Helvetica Neue", sans-serif; "Droid Sans", "Helvetica Neue", sans-serif;
``` ```
This uses whatever system font is available. See: [System shock - Designing Medium](https://medium.design/system-shock-6b1dc6d6596f?gi=90078e194544) _(medium.com)_
### Explanation
| Font | OS | | Font | OS |
| ---- | -- | | ---- | -- |
| `-apple-system` | OS X (10.11+), iOS (9+) | | `-apple-system` | OS X (10.11+), iOS (9+) |
@ -23,4 +30,7 @@ font-family: -apple-system, BlinkMacSystemFont,
| `Droid Sans` | Android (until 3.2) | | `Droid Sans` | Android (until 3.2) |
| `Helvetica Neue` | OS X (10.9) | | `Helvetica Neue` | OS X (10.9) |
Reference: <https://medium.com/design/system-shock-6b1dc6d6596f> ## Reference
{: .-one-column}
- <https://medium.com/design/system-shock-6b1dc6d6596f>

4
flowtype.md Normal file
View File

@ -0,0 +1,4 @@
---
title: Flow
redirect_to: /flow
---

View File

@ -4,9 +4,9 @@ category: Jekyll
layout: 2017/sheet layout: 2017/sheet
--- ---
## Setting up a domain ## Custom domains
### Update your repo ### Custom domains
```sh ```sh
$ echo "foobar.com" > CNAME $ echo "foobar.com" > CNAME
@ -15,6 +15,8 @@ $ git commit && git push
Create a `CNAME` file with your domain on it. Create a `CNAME` file with your domain on it.
See: [Setting up a custom domain](https://help.github.com/articles/quick-start-setting-up-a-custom-domain/) _(github.com)_
### Set up your domain ### Set up your domain
Subdomain (like www): Subdomain (like www):
@ -30,7 +32,8 @@ Apex domains:
Apex domains (alternative): Apex domains (alternative):
{: .-setup} {: .-setup}
A => 192.30.252.153, 192.30.252.154 A => 192.30.252.153
A => 192.30.252.154
## References ## References
{: .-one-column} {: .-one-column}

5
sh.md Normal file
View File

@ -0,0 +1,5 @@
---
title: Shell scripting
category: CLI
redirect_to: /bash
---