Update more sheets

This commit is contained in:
Rico Sta. Cruz 2017-08-30 05:52:27 +08:00
parent 3721e05a61
commit b5d973e0de
No known key found for this signature in database
GPG Key ID: CAAD38AE2962619A
5 changed files with 151 additions and 96 deletions

View File

@ -9,6 +9,6 @@
<abbr class='attribute-peg -new-layout hint--bottom' data-hint='New layout!'><span></span></abbr>
{% endif %}
<span class='title'>{{ include.page.title }}</span>
<span class='title'>{{ include.page.title }} {{ include.page.redirect_to }}</span>
</span>
</a>

View File

@ -1,8 +1,14 @@
---
type: website
---
{% assign featured_pages = site.pages
| where_exp: "page", "page.tags contains 'Featured'"
%}
{% assign recent_pages = site.pages
| where_exp: "page", "page.updated"
| where_exp: "page", "page.updated >= site.last_updated"
%}
{% include 2017/head.html %}
{% include 2017/top-nav.html page=page %}
<div class='SideAd'>
@ -26,24 +32,18 @@ type: website
</div>
<div class='pages-list'>
{% for page in site.pages %}
{% if page.tags contains 'Featured' %}
{% for page in featured_pages %}
{% include 2017/pages-list-item.html page=page class='item top-sheet' %}
{% endif %}
{% endfor %}
<h2 class='category item' data-js-searchable-header>
<span>Recently updated</span>
</h2>
{% for page in site.pages %}
{% if page.updated %}
{% if page.updated >= site.last_updated %}
{% for page in recent_pages %}
{% unless page.tags contains 'Featured' %}
{% include 2017/pages-list-item.html page=page class='article item' %}
{% endunless %}
{% endif %}
{% endif %}
{% endfor %}
{% for category in site.category_names %}

View File

@ -1,54 +1,69 @@
---
title: CSS tricks
category: CSS
layout: 2017/sheet
---
### Heading kerning pairs and ligature
```css
h1, h2, h3 { text-rendering: optimizeLegibility; }
```
### Native-like iOS scrolling
```css
-webkit-overflow-scrolling: touch;
overflow-y: auto;
```
### Gradient text
```css
background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(#333));
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
```
### Text stroke
/* http://www.webkit.org/blog/85/introducing-text-stroke/ */
```css
-webkit-text-stroke: 3px black;
```
See: [Introducing text stroke](http://www.webkit.org/blog/85/introducing-text-stroke/)
### iOS Scrolling prevention
```css
document.ontouchstart = (e) ->
$pane = $(e.target).closest('.scrollable>div')
if $pane.length is 0 or $pane[0].scrollHeight <= $pane.innerHeight()
e.preventDefault()
```
%ios-scrollable
&, >div
-webkit-overflow-scrolling: touch
overflow: auto
```scss
%ios-scrollable {
&, >div {
-webkit-overflow-scrolling: touch;
overflow: auto;
}
>div
position: absolute
top: 0
left: 0
right: 0
bottom: 0
>div {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
}
```
Relevant in iOS6, but maybe not anymore.
### UIWebView optimizations
/* http://www.bitsandpix.com/entry/ios-webkit-uiwebview-remove-tapclick-highlightborder-with-css/ */
/*
http://www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/
*/
```css
* {
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none; /* disable text select */
@ -59,20 +74,32 @@ category: CSS
a:focus {
outline: 0; // Firefox (remove border on link click)
}
```
See: <http://www.bitsandpix.com/entry/ios-webkit-uiwebview-remove-tapclick-highlightborder-with-css/>
See: <http://www.yuiblog.com/blog/2010/10/01/quick-tip-customizing-the-mobile-safari-tap-highlight-color/>
Browser hacks
-------------
{: .-three-column}
### Disclaimer
Not recommended, but here they are if you ever need them. Note that vendor
prefixes may go away eventually.
### Mozilla-only
```css
@-moz-document url-prefix() {
.box { color: blue; }
}
```
### Webkit-only
```css
@media all and (-webkit-min-device-pixel-ratio: 1) {
}
```

View File

@ -1,8 +1,12 @@
---
title: Dockerfile
category: Devops
layout: 2017/sheet
---
## Reference
{: .-three-column}
### Inheritance
```
@ -28,8 +32,9 @@ WORKDIR /myapp
### Onbuild
```docker
ONBUILD RUN bundle install # when used with another file
```bash
ONBUILD RUN bundle install
# when used with another file
```
### Commands
@ -39,6 +44,7 @@ EXPOSE 5900
CMD ["bundle", "exec", "rails", "server"]
```
### Reference
## See also
{: .-one-column}
- <https://docs.docker.com/engine/reference/builder/>

View File

@ -1,55 +1,75 @@
---
title: Rsync
category: CLI
layout: 2017/sheet
---
### Basic example
{: .-prime}
```bash
rsync -avz ./src /dest
```
### OSX
```bash
--exclude '.Trashes'
--exclude '.Spotlight-V100'
--exclude '.fseventsd'
```
### Options
Transfer:
### Transfer options
```bash
-z, --compress
-n, --dry-run
```
Display:
### Display options
```bash
-q, --quiet
-v, --verbose
-h, --human-readable
--progress
```
Skipping:
### Skipping options
```bash
-u, --update # skip files newer on dest
-c, --checksum # skip based on checksum, not mod-time & size
```
Backups:
### Backup options
```bash
-b, --backup # backup with suffix
--suffix=SUFFIX # default ~ without --backup-dir
--backup-dir=DIR
```
### Include
### Include options
```bash
--exclude=PATTERN
--include=PATTERN
```
```bash
--exclude-from=FILE
--include-from=FILE
--files-from=FILE # read list of filenames from FILe
```
### Archive
### Archive options
```bash
-a, --archive # archive (-rlptgoD)
```
```bash
-r, --recursive
-l, --links # copy symlinks as links
-p, --perms # preserve permissions
@ -57,6 +77,8 @@ Backups:
-g, --group # preserve group
-o, --owner # preserve owner
-D # --devices --specials
```
```bash
--delete # Delete extra files
```