Merge branch 'master' into feature/linux-disk-size

This commit is contained in:
Mustafa İlhan 2019-10-14 19:13:52 +02:00 committed by GitHub
commit e21dcf1028
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
62 changed files with 2007 additions and 190 deletions

2
.github/workflows/rebase.yml vendored Normal file
View File

@ -0,0 +1,2 @@
- name: Automatic rebase
uses: cirrus-actions/rebase@1.2

1
.gitignore vendored
View File

@ -3,3 +3,4 @@ _site
.jekyll-metadata
/node_modules
/vendor
.idea/

5
.prettierrc Normal file
View File

@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"jsxSingleQuote": true
}

View File

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

View File

@ -1,9 +1,11 @@
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
FROM ruby:2.5.1
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -qq && apt-get install -qq --no-install-recommends \
nodejs \
yarn \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir -p /app
WORKDIR /app
# COPY Gemfile Gemfile.lock ./
# RUN bundle install -j 4
# COPY package.json yarn.lock ./
# RUN yarn

View File

@ -2,6 +2,12 @@ npmbin := ./node_modules/.bin
PORT ?= 3000
HOST ?= 127.0.0.1
help:
@echo
@echo Makefile targets
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' Makefile | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@echo
# Builds intermediate files. Needs a _site built first though
update: _site critical
@ -9,27 +15,39 @@ update: _site critical
_site:
bundle exec jekyll build --incremental
# Builds critical path CSS/JS
critical: _site
critical: _site ## Builds critical path CSS/JS
node _support/critical.js
# Starts development server
dev:
# Ensure that bins are available.
ensure-bin:
@if [ ! -d $(npmbin) ]; then \
echo "---"; \
echo "Error: $(npmbin) not found, you may need to run '[docker-compose run --rm web] yarn install'."; \
echo "---"; \
exit 1; \
fi
@if ! which jekyll &>/dev/null; then \
echo "---"; \
echo "Warning: Jekyll not found, you may need to run '[docker-compose run --rm web] bundle install'."; \
echo "---"; \
fi
dev: ensure-bin ## Starts development server
$(npmbin)/concurrently -k -p command -c "blue,green" \
"make dev-webpack" \
"make dev-jekyll"
dev-webpack:
dev-webpack: ensure-bin
$(npmbin)/webpack --watch --colors -p
dev-jekyll:
dev-jekyll: ensure-bin
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: _site ## Runs rudimentary tests
@test -f _site/vim.html
@test -f _site/react.html
@test -f _site/index.html

View File

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

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 +1,7 @@
<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>
<div id="codefund"><!-- fallback content --></div>
<script src="https://codefund.app/properties/51/funder.js" async="async"></script>
<script type="text/javascript">var abp;</script>
<script type="text/javascript" src="https://cdn2.codefund.app/assets/px.js?ch=1"></script>
<script type="text/javascript" src="https://cdn2.codefund.app/assets/px.js?ch=2"></script>
</aside>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
{% 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 rel="stylesheet" href="{{base}}/assets/2015/style.css?t={{ timestamp }}">
<link href="{{base}}/assets/style.css?t={{ timestamp }}" rel="stylesheet" />
<link href="{{base}}/assets/print.css?t={{ timestamp }}" rel="stylesheet" media="print" />
</head>

View File

@ -31,12 +31,6 @@
{% 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 %}

View File

@ -13,12 +13,6 @@
<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 %}

427
_sass/2015/base/normalize.scss vendored Normal file
View File

@ -0,0 +1,427 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */
/**
* 1. Set default font family to sans-serif.
* 2. Prevent iOS text size adjust after orientation change, without disabling
* user zoom.
*/
html {
font-family: sans-serif; /* 1 */
-ms-text-size-adjust: 100%; /* 2 */
-webkit-text-size-adjust: 100%; /* 2 */
}
/**
* Remove default margin.
*/
body {
margin: 0;
}
/* HTML5 display definitions
========================================================================== */
/**
* Correct `block` display not defined for any HTML5 element in IE 8/9.
* Correct `block` display not defined for `details` or `summary` in IE 10/11
* and Firefox.
* Correct `block` display not defined for `main` in IE 11.
*/
article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary {
display: block;
}
/**
* 1. Correct `inline-block` display not defined in IE 8/9.
* 2. Normalize vertical alignment of `progress` in Chrome, Firefox, and Opera.
*/
audio,
canvas,
progress,
video {
display: inline-block; /* 1 */
vertical-align: baseline; /* 2 */
}
/**
* Prevent modern browsers from displaying `audio` without controls.
* Remove excess height in iOS 5 devices.
*/
audio:not([controls]) {
display: none;
height: 0;
}
/**
* Address `[hidden]` styling not present in IE 8/9/10.
* Hide the `template` element in IE 8/9/11, Safari, and Firefox < 22.
*/
[hidden],
template {
display: none;
}
/* Links
========================================================================== */
/**
* Remove the gray background color from active links in IE 10.
*/
a {
background-color: transparent;
}
/**
* Improve readability when focused and also mouse hovered in all browsers.
*/
a:active,
a:hover {
outline: 0;
}
/* Text-level semantics
========================================================================== */
/**
* Address styling not present in IE 8/9/10/11, Safari, and Chrome.
*/
abbr[title] {
border-bottom: 1px dotted;
}
/**
* Address style set to `bolder` in Firefox 4+, Safari, and Chrome.
*/
b,
strong {
font-weight: bold;
}
/**
* Address styling not present in Safari and Chrome.
*/
dfn {
font-style: italic;
}
/**
* Address variable `h1` font-size and margin within `section` and `article`
* contexts in Firefox 4+, Safari, and Chrome.
*/
h1 {
font-size: 2em;
margin: 0.67em 0;
}
/**
* Address styling not present in IE 8/9.
*/
mark {
background: #ff0;
color: #000;
}
/**
* Address inconsistent and variable font size in all browsers.
*/
small {
font-size: 80%;
}
/**
* Prevent `sub` and `sup` affecting `line-height` in all browsers.
*/
sub,
sup {
font-size: 75%;
line-height: 0;
position: relative;
vertical-align: baseline;
}
sup {
top: -0.5em;
}
sub {
bottom: -0.25em;
}
/* Embedded content
========================================================================== */
/**
* Remove border when inside `a` element in IE 8/9/10.
*/
img {
border: 0;
}
/**
* Correct overflow not hidden in IE 9/10/11.
*/
svg:not(:root) {
overflow: hidden;
}
/* Grouping content
========================================================================== */
/**
* Address margin not present in IE 8/9 and Safari.
*/
figure {
margin: 1em 40px;
}
/**
* Address differences between Firefox and other browsers.
*/
hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
/**
* Contain overflow in all browsers.
*/
pre {
overflow: auto;
}
/**
* Address odd `em`-unit font size rendering in all browsers.
*/
code,
kbd,
pre,
samp {
font-family: monospace, monospace;
font-size: 1em;
}
/* Forms
========================================================================== */
/**
* Known limitation: by default, Chrome and Safari on OS X allow very limited
* styling of `select`, unless a `border` property is set.
*/
/**
* 1. Correct color not being inherited.
* Known issue: affects color of disabled elements.
* 2. Correct font properties not being inherited.
* 3. Address margins set differently in Firefox 4+, Safari, and Chrome.
*/
button,
input,
optgroup,
select,
textarea {
color: inherit; /* 1 */
font: inherit; /* 2 */
margin: 0; /* 3 */
}
/**
* Address `overflow` set to `hidden` in IE 8/9/10/11.
*/
button {
overflow: visible;
}
/**
* Address inconsistent `text-transform` inheritance for `button` and `select`.
* All other form control elements do not inherit `text-transform` values.
* Correct `button` style inheritance in Firefox, IE 8/9/10/11, and Opera.
* Correct `select` style inheritance in Firefox.
*/
button,
select {
text-transform: none;
}
/**
* 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
* and `video` controls.
* 2. Correct inability to style clickable `input` types in iOS.
* 3. Improve usability and consistency of cursor style between image-type
* `input` and others.
*/
button,
html input[type="button"], /* 1 */
input[type="reset"],
input[type="submit"] {
-webkit-appearance: button; /* 2 */
cursor: pointer; /* 3 */
}
/**
* Re-set default cursor for disabled elements.
*/
button[disabled],
html input[disabled] {
cursor: default;
}
/**
* Remove inner padding and border in Firefox 4+.
*/
button::-moz-focus-inner,
input::-moz-focus-inner {
border: 0;
padding: 0;
}
/**
* Address Firefox 4+ setting `line-height` on `input` using `!important` in
* the UA stylesheet.
*/
input {
line-height: normal;
}
/**
* It's recommended that you don't attempt to style these elements.
* Firefox's implementation doesn't respect box-sizing, padding, or width.
*
* 1. Address box sizing set to `content-box` in IE 8/9/10.
* 2. Remove excess padding in IE 8/9/10.
*/
input[type="checkbox"],
input[type="radio"] {
box-sizing: border-box; /* 1 */
padding: 0; /* 2 */
}
/**
* Fix the cursor style for Chrome's increment/decrement buttons. For certain
* `font-size` values of the `input`, it causes the cursor style of the
* decrement button to change from `default` to `text`.
*/
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
height: auto;
}
/**
* 1. Address `appearance` set to `searchfield` in Safari and Chrome.
* 2. Address `box-sizing` set to `border-box` in Safari and Chrome
* (include `-moz` to future-proof).
*/
input[type="search"] {
-webkit-appearance: textfield; /* 1 */
-moz-box-sizing: content-box;
-webkit-box-sizing: content-box; /* 2 */
box-sizing: content-box;
}
/**
* Remove inner padding and search cancel button in Safari and Chrome on OS X.
* Safari (but not Chrome) clips the cancel button when the search input has
* padding (and `textfield` appearance).
*/
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none;
}
/**
* Define consistent border, margin, and padding.
*/
fieldset {
border: 1px solid #c0c0c0;
margin: 0 2px;
padding: 0.35em 0.625em 0.75em;
}
/**
* 1. Correct `color` not being inherited in IE 8/9/10/11.
* 2. Remove padding so people aren't caught out if they zero out fieldsets.
*/
legend {
border: 0; /* 1 */
padding: 0; /* 2 */
}
/**
* Remove default vertical scrollbar in IE 8/9/10/11.
*/
textarea {
overflow: auto;
}
/**
* Don't inherit the `font-weight` (applied by a rule above).
* NOTE: the default cannot safely be changed in Chrome and Safari on OS X.
*/
optgroup {
font-weight: bold;
}
/* Tables
========================================================================== */
/**
* Remove most spacing between table cells.
*/
table {
border-collapse: collapse;
border-spacing: 0;
}
td,
th {
padding: 0;
}

View File

@ -0,0 +1,58 @@
@import url('//brick.a.ssl.fastly.net/Roboto:400,400i,700')
@import url('//fonts.googleapis.com/css?family=Raleway:800')
@import url('//fonts.googleapis.com/css?family=Fira+Mono:400,400i')
@import url('//brick.a.ssl.fastly.net/EB+Garamond:400i')
$body-font-size: 17px
$body-line-height: 1.7
@mixin font-size($multiplier, $lhmultiplier, $size, $line-height)
font-size: $size * $multiplier
@if $line-height != none
line-height: $line-height * $lhmultiplier
@mixin body-font
font-family: 'Roboto', sans-serif
font-weight: 400
@mixin italic-font
font-family: 'eb garamond', serif
font-weight: 400
font-style: italic
+kernliga
@mixin headline-font
font-family: 'eb garamond', serif
font-weight: 400
font-style: italic
+kernliga
@mixin caps-font
text-transform: uppercase
letter-spacing: 2px
@mixin mono-font
font-family: 'fira mono', monospace
font-weight: 400
letter-spacing: -0.5px
+no-antialias
@mixin bold-font
font-family: 'raleway', sans-serif
font-weight: 800
/*
* sizes
*/
@mixin italic-font-size($size, $line-height: none)
+font-size(1.0, 1.0, $size, $line-height)
@mixin headline-font-size($size, $line-height: none)
+font-size(1.0, 1.0, $size, $line-height)
@mixin bold-font-size($size, $line-height: none)
+font-size(1.0, 1.0, $size, $line-height)
@mixin mono-font-size($size, $line-height: none)
+font-size(1.0, 1.0, $size, $line-height)

View File

@ -0,0 +1,41 @@
@mixin kernliga
font-size-adjust: none
// don't display digraphs in languages that don't support it
-webkit-font-language-override: normal
font-language-override: normal
// use font-defined kerning info
-webkit-font-kerning: auto
font-kerning: auto
// opentype options: kerning, ligatures, horiz ligatures, discretionary ligatures, contextual swash
// http://en.wikipedia.org/wiki/List_of_typographic_features
-webkit-font-feature-settings: "kern", "liga", "dlig", "hlig", "cswh"
font-feature-settings: "kern", "liga", "dlig", "hlig", "cswh"
// allow browser to auto-infer missing glyphs
font-synthesis: weight style
// swashes on first letters
// &:first-letter
// font-feature-settings: "kern", "swsh"
// -webkit-font-feature-settings: "kern", "swsh"
@mixin antialias
text-rendering: optimizeLegibility
-webkit-font-smoothing: antialiased
-moz-osx-font-smoothing: grayscale
@mixin no-antialias
text-rendering: auto
-webkit-font-smoothing: subpixel-antialiased
-moz-osx-font-smoothing: auto
@mixin clearfix
&:after
display: table
content: ''
clear: both
height: 0
zoom: 1

View File

@ -0,0 +1,105 @@
/*
* .about-the-site
*/
.about-the-site
&
position: relative
.container
text-align: center
padding: 3em 80px
margin: 0 auto
+clearfix
@media (max-width: 768px)
padding-left: 40px
padding-right: 40px
&:before
content: ''
position: absolute
display: block
left: 20px
right: 20px
top: 0
border-top: solid 1px $hairline
&
+body-font
font-size: 0.85em
color: lighten($gray, 20%)
a, a:visited
color: lighten($gray, 10%)
box-shadow: inset 0 -1px rgba(black, 0.05)
padding-bottom: 2px
a:hover, a:focus
color: $black
box-shadow: inset 0 -2px $accent
strong
+bold-font
strong a, strong a:visited
color: $black
box-shadow: none
strong a:hover, strong a:focus
color: $black
box-shadow: inset 0 -2px $accent
.identity
margin: 0
margin-top: 0.2em
float: right
+italic-font
+italic-font-size(2.5em)
.identity a,
.identity a:visited
color: $black
box-shadow: none
.identity a:hover,
.identity a:focus
color: $accent
.blurb
margin: 0
max-width: 500px
text-align: left
float: left
line-height: 1.55
.back
float: right
margin-top: 0.4em
margin-right: 2em
.fleuron:before
content: '\f492'
font-family: Ionicons
font-size: 16px
font-weight: normal
font-style: normal
display: inline-block
vertical-align: middle
color: $black
margin: 0 7px
@media (max-width: 768px)
display: none
@media (max-width: 768px)
.identity
float: left
clear: both
.blurb
float: none
margin-bottom: 1em
width: auto
.back
float: right
margin-right: 0

View File

@ -0,0 +1,66 @@
.big-button,
a.big-button
display: inline-block
width: 180px
height: 50px
line-height: 50px - 2px
padding: 0
border-radius: 30px
font-size: 0.85em
box-shadow: none
background: transparent
@media (max-width: 768px)
width: 140px
height: 40px
line-height: 40px - 2px
&, &:visited
border: solid 2px $accent
color: $accent
&.-back,
&.-back:visited
border: solid 1px rgba($gray, 0.2)
color: $gray
&.-back:before,
&.-next:after
font-family: Ionicons
font-size: 20px
display: inline-block
vertical-align: middle
position: relative
top: -1px
&.-back:before
content: '\f38f'
&.-next:after
content: '\f3d1'
margin-left: 16px
top: 0
&.-slim
width: 60px
border-width: 2px
height: 60px
line-height: 60px
border-radius: 50%
@media (max-width: 768px)
width: 40px
height: 40px
line-height: 40px
&:hover, &:focus
background: $accent
border-color: transparent
color: white
box-shadow: none
&.-back:hover,
&.-back:focus
background: $accent
color: white

View File

@ -0,0 +1,8 @@
/*
* .brief-intro -- Brief introduction
*/
.brief-intro
font-size: 1.1em
color: $gray

View File

@ -0,0 +1,38 @@
/*
* .full-image -- full width image containers
*/
.full-image
&
overflow: hidden
text-align: center
position: relative
img
background: #fcfcfc
&.cropped img,
&.cropped img:first-child:last-child
margin-bottom: -50px
display: block
background: transparent
&.cropped:after
content: ''
display: block
position: absolute
bottom: 0
left: 20px
right: 20px
border-bottom: solid 1px $lightgray
&.stretched img
width: 100%
@media (max-width: 768px)
margin-left: -20px
margin-right: -20px
@media (min-width: 769px)
width: 100vw
margin-left: calc(-50vw + #{$page-width} / 2)

View File

@ -0,0 +1,14 @@
.hint--top, .hint--bottom
&:before
margin-top: -14px
margin-left: -8px
border-radius: 2px
&:before, &:after
transition-duration: 10ms
&:after
box-shadow: none
border-radius: 2px
text-shadow: none
margin-left: -55px

View File

@ -0,0 +1,78 @@
.hljs-literal,
.hljs-number,
.hljs-string,
.hljs-symbol,
.hljs-value
color: $accent
.hljs-key,
.hljs-attribute
color: darken($accent, 20%)
.hljs-keyword,
.hljs-constant
color: $black
.hljs-comment
color: $gray
font-style: italic
//
// Prism
//
.token.comment,
.token.prolog,
.token.doctype,
.token.cdata
color: $gray
font-style: italic
.token.punctuation
color: #999
.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted
color: #905
.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted
color: $accent
.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string
color: #a67f59
.token.atrule,
.token.attr-value,
.token.keyword
color: #07a
.token.function
color: #DD4A68
.token.regex,
.token.important,
.token.variable
color: #e90
.token.important,
.token.bold
font-weight: bold
.token.italic
font-style: italic
.token.entity
cursor: help

View File

@ -0,0 +1,142 @@
/*
* .next-article -- lead into the next article
*/
.next-article
$bg: darken(#8e44ad, 15%)
$textcolor: saturate(mix(white, $bg, 85%), 90%)
&
display: block
padding: 0
margin-left: 40px
margin-right: 40px
position: relative
&, &:hover, &:focus
box-shadow: none
&:after
content: ''
display: block
position: absolute
left: -20px
right: -20px
bottom: 0
border-bottom: solid 1px $hairline
// suppress its hairline
& + .about-the-site:before
display: none
@media (max-width: 768px)
margin-left: 0
margin-right: 0
// remove horizontal line
& + .about-the-site:before
display: none
.container
display: block
text-align: center
padding: 10em 20px
@media (min-width: 769px)
margin-top: 8em
padding: 8em 20px
.h3
display: block
margin: 0 auto auto
padding: 0
font-size: 2.2em
line-height: 1.3em
+bold-font
color: white
transition: all 250ms linear
// &:hover > span
// box-shadow: inset 0 -2px $accent
// text-shadow: 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg, 0 0 4px $bg
@media (max-width: 768px)
font-size: 1.5em
.h3, .excerpt
max-width: $page-width * 0.9
.h3 + .excerpt
margin-top: 0.5em
.excerpt
display: block
margin-left: auto
margin-right: auto
font-size: 1em
line-height: 1.6em
.big-button
margin-top: 2em
h3 a:hover,
h3 a:focus
color: $accent
.heading
display: block
+caps-font
font-size: 0.7em
margin-bottom: 1em
.heading:before
font-family: Ionicons
content: '\f4a8'
margin-right: 15px
font-size: 16px
display: inline-block
vertical-align: middle
color: $accent
.big-button,
a.big-button
background: transparent
&, &:visited
border-color: $accent
color: white
&:hover, &:focus
background: $accent
border-color: transparent
@mixin recolor-article($bg, $bg2, $url: '', $a: 0.9, $angle: 177deg)
$w: 1500
$h: 10
$textcolor: mix(white, $bg, 75%)
$notch: "data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='#{$w}' height='#{$h}' version='1.1'><polyline fill='white' points='#{$w},0 0,0 0,#{$h}'/></svg>"
&
background: url($notch) -50px top / 110% auto no-repeat, linear-gradient(to right, rgba(adjust-color($bg, $lightness: 0%), $a), rgba(adjust-color($bg2, $lightness: 0%), $a)), linear-gradient($angle, rgba($bg, 0.0), rgba($bg, 0.9)), url($url) center center / cover, $bg
&:hover, &:focus
background: url($notch) -50px top / 110% auto no-repeat, linear-gradient(to right, rgba(adjust-color($bg, $lightness: 1%), $a), rgba(adjust-color($bg2, $lightness: 1%), $a)), linear-gradient($angle, rgba($bg, 0.0), rgba($bg, 0.9)), url($url) center center / cover, $bg
.excerpt, .heading
color: $textcolor
.next-article
&
+recolor-article(#612e76, #5867cc)
&.-v2
text-shadow: 0 1px 1px rgba(black, 0.5)
+recolor-article(#027d65, #00536b, "bg/pebbles.jpg", 0.7, $angle: 35deg)
&.-v3
text-shadow: 0 1px 1px rgba(black, 0.5)
+recolor-article(#1d2434, #202a3e, "bg/roughwall.jpg", 0.9, $angle: 1deg)
&.-v4
text-shadow: 0 1px 1px rgba(black, 0.5)
+recolor-article(#902014, #c77e0a, "bg/woodfloor.jpg", 0.45, $angle: 1deg)
&.-v5
text-shadow: 0 1px 1px rgba(black, 0.5)
+recolor-article(#17283a, #25295e, "bg/stairs.jpg", 0.85, $angle: 1deg)
// &.next-article

View File

@ -0,0 +1,56 @@
/*
* .post-headline -- H1's of posts
*/
.post-headline
&
margin: 1.5em auto 3em auto
text-align: center
.post-icon
margin-bottom: 2px
h1
text-align: center
margin-bottom: 0
+headline-font
+headline-font-size(2.8em, 1.2)
width: 80%
margin-left: auto
margin-right: auto
@media (max-width: 768px)
+headline-font-size(2em)
.meta
display: block
text-align: center
margin: 0
margin-top: 1em
font-weight: normal
+caps-font
font-size: 0.8em
.meta .author,
.meta .date
margin: 0 5px
padding-bottom: 2px
.meta a,
.meta a:visited
color: $gray
.meta a:hover,
.meta a:focus
&, span
color: $gray
time
color: $black
box-shadow: inset 0 -2px $accent
a, a:visited, a:focus, a:hover
color: $black
text-decoration: none
box-shadow: none

View File

@ -0,0 +1,58 @@
/*
* .post-icon -- category icons
*/
$icon-size: 56px
@mixin iconify($color, $text)
&
background: $color
color: lighten($color, 50%)
box-shadow: -2px 2px #e67e22, 2px -2px #f1c40f, 1px -2px rgba($color, 0.2), 1px 3px rgba($color, 0.3)
span:after
content: $text
.post-icon,
abbr.post-icon
border: 0
margin: 0
display: inline-block
width: $icon-size
height: $icon-size
line-height: $icon-size + 2px
text-align: center
border-radius: 50%
color: #aaa
background: #eee
+body-font
font-size: 16px
letter-spacing: 1px
span:after
content: attr(data-label)
font-size: 0.9em
position: relative
top: -1px
@media (max-width: 480px)
transform: scale(0.75)
&.-icon-css
+iconify(#3498db, 'CSS')
font-size: 14px
line-height: $icon-size + 2px
&.-icon-development
+iconify(#34495e, 'DEV')
font-size: 14px
line-height: $icon-size + 2px
&.-icon-ruby
+iconify(#e74c3c, 'RB')
text-indent: 2px
&.-icon-javascript
+iconify(#2ecc71, 'JS')
text-indent: 1px
&.-icon-productivity
+iconify(#2ecc71, 'PROD')
text-indent: 1px

View File

@ -0,0 +1,73 @@
/*
* .post-index (et al) -- utility classes
*/
.post-index
&
margin: 0 auto 4em auto
position: relative
padding-top: 4em
font-size: 0.9em
.container
overflow: hidden
max-width: $page-width
margin: 0 auto
h3
+caps-font
color: $gray
font-size: 1em
.post-index-item
display: block
overflow: hidden
padding: 6px 20px
border-top: solid 1px $hairline
&, &:hover, &:focus
box-shadow: none
&:hover, &:focus
.article
transition: none
.date
display: block
.date
width: 100px
font-size: 0.8em
color: $gray
@media (min-width: 768px)
padding-left: 0
padding-right: 0
.date, .tag
margin-top: 0.2em
.date, article
float: left
.tag
float: right
.article
color: $text
margin-right: 3px
transition: all 100ms linear
&:hover .article
color: $accent
&:nth-of-type(1) .article,
&:nth-of-type(2) .article,
&:nth-of-type(3) .article,
&:nth-of-type(4) .article
+bold-font
.tag
color: $gray
font-weight: normal
font-size: 0.8em

View File

@ -0,0 +1,23 @@
.post-item
max-width: $page-width
margin: 0 auto
.post-list
margin: 40px auto
padding: 20px
@media (max-width: 768px)
margin: 0 auto
.post-list > .post-item:not(:first-child)
&:before
content: ''
display: block
width: 150px
height: 1px
background: $hairline
margin: 7em auto
@media (max-width: 768px)
margin: 4em auto

View File

@ -0,0 +1,17 @@
.site-header
text-align: center
padding: 0 20px
.container
padding: 15px 20px
font-size: 0.9em
color: rgba($gray, 0.6)
border-bottom: solid 1px $hairline
em
+italic-font
+italic-font-size(1.1em)
font-size: 1.1em
color: $text

View File

@ -0,0 +1,73 @@
/*
* .social-list -- social share icons
*/
.social-list
&, li
margin: 0
padding: 0
&
display: block
text-align: center
width: 100%
margin-top: 2em
@media (min-width: 768px)
margin-top: 4em
&.-top
margin-top: -2em
@media (min-width: 768px)
margin-top: -1em
li
display: inline-block
a
display: inline-block
padding: 6px
text-align: center
box-shadow: none
a:before, a:after
transition: all 100ms linear
.text
display: none
a:before
font-family: 'Ionicons'
font-weight: normal
font-style: normal
font-size: 18px
width: 40px
height: 40px
line-height: 40px
display: inline-block
text-align: center
border: solid 2px transparent
border-radius: 50%
@mixin socialiconify($color, $content, $filled)
&
color: darken($lightgray, 10%)
&:hover,
&:focus
color: $color
&:before
content: $filled
&:hover:before,
&:focus:before
border-color: $color
content: $filled
.facebook a
+socialiconify(#4c66a4, '\f230', '\f231')
.twitter a
+socialiconify(dodgerblue, '\f242', '\f243')
.googleplus a
+socialiconify(#f53, '\f234', '\f235')

View File

@ -0,0 +1,157 @@
/*
* html base (html, body)
*/
*
+antialias
html
font-size: $body-font-size
line-height: $body-line-height
background: $bg
color: $text
@media (max-width: 768px)
font-size: floor($body-font-size * 14/17)
html
transition: opacity 200ms linear
opacity: 1
html, input, textarea, td, th
+body-font
html, body
overflow-x: hidden
/*
* fouc prevention
*/
body
transition: opacity 100ms linear
html.no-js *
opacity: 0
/*
* basic styles (a, p, img...)
*/
a, a:visited
color: $text
text-decoration: none
box-shadow: inset 0 -1px rgba(#888, 0.3)
transition: all 100ms linear
a:focus, a:hover
box-shadow: inset 0 -2px $accent
color: $black
strong, b
&, a, a:visited
color: $black
h3, p, ul, ol
margin: 1.5em 0
/*
* iframes
*/
p > iframe
margin: 0 auto
display: block
/*
* lists
*/
ul, ol
padding-left: 1.5em
ul
&
list-style: none
> li
position: relative
> li:before
content: ''
display: block
position: absolute
left: -1.4em
top: 0
margin-top: 0.7em
width: 4px
height: 4px
border-radius: 50%
border: solid 2px $lightgray
@media (max-width: 768px)
width: 3px
height: 3px
/*
* headings
*/
h2
&, a, a:visited
color: $black
h2
text-align: center
+headline-font
+headline-font-size(2em, 1.4)
margin: 2em auto 0 auto
@media (max-width: 768px)
+headline-font-size(1.6em)
@media (min-width: 769px)
h2:before,
h2:after
content: ''
display: inline-block
vertical-align: middle
width: 46px
height: 1px
background: $lightgray
margin: 0 30px
h3
+bold-font
+bold-font-size(1.1em)
margin-top: 2em
&, a, a:visited
color: $black
@media (max-width: 768px)
margin-top: 1.5em
h3 + p
margin-top: -1.7em
/*
* images
*/
p > img:first-child:last-child
display: block
margin: 0 auto
max-width: 100%
code
+mono-font
+mono-font-size(0.9em)
hr
width: 200px
height: 1px
border: 0
background: $lightgray
margin: 3em auto
display: block

View File

@ -0,0 +1,119 @@
$term-border: mix($accent, white, 50%)
/*
* pre > code -- code blocks
*/
pre > code
+mono-font
+mono-font-size(0.82em)
color: $text
padding-right: 20px
// box-shadow: inset 1px 1px rgba(black, 0.06)
pre
padding: 20px 50px
border-radius: 4px
background: $wash
margin: 2.2em -50px
line-height: 1.2em
@media (min-width: 768px)
border-top: solid 1px #eef3fa
border-bottom: solid 1px #c7d7ee
border-radius: 4px
@media (max-width: 768px)
padding: 20px
margin: 2em -20px
background: darken($wash, 3%)
@media (max-width: 660px)
border-radius: 0
pre + pre
margin-top: -1.5em
pre.medium
> code
font-size: 1em
@media (min-width: 768px)
padding-top: 30px
padding-bottom: 30px
pre.large
> code
font-size: 1.1em
line-height: 1.4em
@media (min-width: 768px)
padding-top: 30px
padding-bottom: 30px
pre.terminal,
pre.light
&
background: white
border: solid 1px $term-border
position: relative
pre.light
background: #fdfdff
pre.terminal
&
padding-top: 56px
&.large
padding-top: 65px
&:before
content: ''
display: block
height: 34px
line-height: 34px
background: white
border-bottom: solid 1px $term-border
border-top-left-radius: 3px
border-top-right-radius: 3px
position: absolute
top: 0
left: 0
right: 0
+bold-font
&:after
content: ''
position: absolute
display: block
width: 4px
height: 4px
border-radius: 50%
left: 15px
top: 15px
font-size: 20px
background-color: $term-border
box-shadow: 20px 0 $term-border, 40px 0 $term-border
@media (max-width: 768px)
margin-left: 0
margin-right: 0
pre + pre
margin-top: -1.7em
@media (min-width: 769px)
pre.cursor > code > :last-child:after
content: ''
display: inline-block
width: 3px
height: 1em
transform: scaleY(1.5) translateY(0.1em)
margin-left: 0.4em
background-color: $accent
-webkit-animation: blink 700ms steps(2,end) infinite
-moz-animation: blink 700ms steps(2,end) infinite
animation: blink 700ms steps(2,end) infinite
h3 + pre,
h3 + table
margin-top: -1em

View File

@ -0,0 +1,73 @@
/*
* table
*/
table
min-width: 100%
margin-top: 2em
margin-bottom: 2em
font-size: 0.9em
border-bottom: solid 1px $gray
thead > tr:first-child > th,
thead > tr:first-child > td,
tbody > tr:first-child > th,
tbody > tr:first-child > td
border-top: solid 1px $gray
td, th
text-align: left
border-top: solid 1px $hairline
padding: 8px 10px
th
+bold-font
color: $black
td:first-child,
th:first-child
text-align: left
padding-left: 0
td:last-child,
th:last-child
padding-right: 0
table.no-head
thead
display: none
table.shortcuts
&
table-layout: fixed
thead
display: none
th:nth-child(1), td:nth-child(1)
width: 25%
th:nth-child(2), td:nth-child(2)
width: 75%
td:first-child > code
background: #fcfcfc
padding: 5px 10px
border-radius: 2px
table.lite-headings
&
border-bottom: solid 1px mix($gray, $lightgray, 50%)
th
color: mix($gray, $lightgray, 50%)
font-size: 0.9em
thead > tr:first-child > td,
thead > tr:first-child > th
border-top: solid 1px mix($gray, $lightgray, 50%)
tbody > tr:first-child > td,
tbody > tr:first-child > th
border-top: solid 1px $hairline

View File

@ -0,0 +1,11 @@
@keyframes blink
0%
opacity: 0
100%
opacity: 1
@-webkit-keyframes blink
0%
opacity: 0
100%
opacity: 1

View File

@ -0,0 +1,27 @@
/*
* .center (et al) -- utility classes
*/
.center
text-align: center
.spaced
@media (min-width: 769px)
margin-top: 4em
margin-bottom: 4em
.spaced-more
@media (min-width: 769px)
margin-top: 6em
margin-bottom: 6em
.spaced-less
@media (min-width: 769px)
margin-top: 2em
margin-bottom: 2em
.wide
@media (min-width: 920px)
width: 140%
margin-left: -25%

View File

@ -0,0 +1,43 @@
/*
* .top/.bottom -- margin helpers
*/
.top-collapse-0
margin-top: 0
.top-collapse-1
margin-top: -1em
.top-collapse-2
margin-top: -2em
.top-collapse-4
margin-top: -4em
.top-space-0
margin-top: 0
.top-space-1
margin-top: 1em
.top-space-2
margin-top: 2em
.top-space-4
margin-top: 2em
@media (min-width: 769px)
margin-top: 4em
.bottom-collapse-0
margin-bottom: 0
.bottom-collapse-1
margin-bottom: -1em
.bottom-collapse-2
margin-bottom: -2em
.bottom-collapse-4
margin-bottom: -4em
.bottom-space-0
margin-bottom: 0
.bottom-space-1
margin-bottom: 1em
.bottom-space-2
margin-bottom: 2em
.bottom-space-4
margin-bottom: 2em
@media (min-width: 769px)
margin-bottom: 4em

46
_sass/2015/style.sass Normal file
View File

@ -0,0 +1,46 @@
// base colors
$text: #555
$black: #151515
$bg: #fff
$wash: #f4f6f8
// grays
$gray: #939aa1
$lightgray: #c0d3da
$hairline: #eef3fa
// accents
$accent: #1ea3ff
$accent2: #f53
// metrics
$page-width: 620px
@import url('//code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css')
@import url('//cdn.jsdelivr.net/hint.css/1.3.2/hint.min.css')
@import 'base/utils'
@import 'base/typography'
@import 'base/normalize'
@import 'elements/body'
@import 'elements/table'
@import 'elements/code'
@import 'components/about-the-site'
@import 'components/big-button'
@import 'components/brief-intro'
@import 'components/full-image'
@import 'components/hint'
@import 'components/hljs'
@import 'components/next-article'
@import 'components/post-headline'
@import 'components/post-icon'
@import 'components/post-index'
@import 'components/post-list'
@import 'components/site-header'
@import 'components/social-list'
@import 'helpers/general'
@import 'helpers/margins'
@import 'helpers/blink'

View File

@ -1,7 +1,7 @@
$bounce: cubic-bezier(.75,-0.5,0,1.75);
$bounce: cubic-bezier(0.75, -0.5, 0, 1.75);
/*
* "Preloader":
/* "Preloader":
* This makes the content semi-transparent before the page ad loads.
*/
@ -11,23 +11,6 @@ $bounce: cubic-bezier(.75,-0.5,0,1.75);
}
}
/*
* 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)

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

@ -22,7 +22,6 @@
@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';

4
assets/2015/style.sass Normal file
View File

@ -0,0 +1,4 @@
---
type: other
---
@import '2015/style.sass'

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

76
bash.md
View File

@ -3,7 +3,7 @@ title: Bash scripting
category: CLI
layout: 2017/sheet
tags: [Featured]
updated: 2018-12-25
updated: 2019-03-23
keywords:
- Variables
- Functions
@ -199,6 +199,19 @@ comment
| `${#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 |
@ -220,6 +233,14 @@ for i in /etc/rc.*; do
done
```
### C-like for loop
```bash
for ((i = 0 ; i < 100 ; i++)); do
echo $i
done
```
### Ranges
```bash
@ -464,6 +485,53 @@ for i in "${arrayName[@]}"; do
done
```
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
-------
@ -610,6 +678,12 @@ 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"
```
### Directory of script

View File

@ -39,7 +39,7 @@ prism_languages: [css]
```css
/* Areas */
grid-tamplate-areas:
grid-template-areas:
"header header"
"main aside"
"footer footer"; /* Grid-style */
@ -58,7 +58,7 @@ prism_languages: [css]
/* The above is the same as below long-hand */
grid-template-columns: 80% 20%;
grid-template-rows: auto 100vh 10rem;
grid-tamplate-areas:
grid-template-areas:
"header header"
"main aside"
"footer footer";
@ -155,7 +155,7 @@ prism_languages: [css]
/ 80% 20%; /* Which is again equivalent to below */
grid-template-columns: 80% 20%;
grid-template-rows: auto 100vh 10rem;
grid-tamplate-areas:
grid-template-areas:
"header header"
"main aside"
"footer footer";
@ -252,4 +252,4 @@ prism_languages: [css]
* [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)

15
css.md
View File

@ -43,13 +43,14 @@ keywords:
### 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

View File

@ -5,6 +5,7 @@ services:
volumes:
- .:/app
- rubygems:/usr/local/bundle
- node_modules:/app/node_modules
ports:
- '4001:4001'
- '35729:35729'
@ -12,3 +13,4 @@ services:
volumes:
rubygems:
node_modules:

View File

@ -72,4 +72,4 @@ indent_size = 2
### References
- <http://EditorConfig.org>
- <https://EditorConfig.org>

2
es6.md
View File

@ -248,7 +248,7 @@ function greet({ name, greeting }) {
greet({ name: 'Larry', greeting: 'Ahoy' })
```
Destructuring of objects and arrays can be also be done in function arguments.
Destructuring of objects and arrays can also be done in function arguments.
### Default values

View File

@ -34,6 +34,14 @@ git remote prune origin
Deletes `origin/*` branches in your local copy. Doesn't affect the remote.
### List existing branches
```bash
git branch --list
```
Existing branches are listed. Current branch will be highlighted with an asterisk.
### List merged branches
```bash
@ -42,6 +50,14 @@ git branch -a --merged
List outdated branches that have been merged into the current one.
### Delete branch forcefully
```bash
git branch -D $branchname
```
Delete a branch irrespective of its merged status.
### Delete remote branch
```bash

View File

@ -2,7 +2,7 @@
title: GraphQL
layout: 2017/sheet
updated: 2017-09-23
category: Databases
category: API
---
## Intro

View File

@ -36,6 +36,15 @@ category: CLI
| `brew list` | List installed |
| `brew outdated` | What's due for upgrades? |
### Brew Cask commands
| Command | Description |
| --- | --- |
| `brew cask install firefox` | Install the Firefox browser |
| `brew cask list` | List installed applications |
Cask commands are used for interacting with graphical applications.
## Also see
{: .-one-column}

View File

@ -1,6 +1,6 @@
---
title: HTTP Status
category: HTTP
category: API
layout: 2017/sheet
description: |
List of HTTP Status codes and links to description.
@ -111,4 +111,4 @@ WebDAV is an extension of HTTP that allows clients to perform remote Web content
* <https://en.wikipedia.org/wiki/List_of_HTTP_status_codes>
* <https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html>
* <https://httpstatuses.com/>
* <https://httpstatuses.com/>

View File

@ -2,7 +2,7 @@
title: Jsdoc
category: JavaScript
layout: 2017/sheet
updated: 2017-10-29
updated: 2019-01-10
weight: -1
---
@ -31,11 +31,12 @@ See: <http://usejsdoc.org/index.html>
| --- | --- |
| `@param {string=} n` | Optional |
| `@param {string} [n]` | Optional |
| `@param {(string|number)} n` | Multiple types |
| `@param {(string\|number)} n`| Multiple types |
| `@param {*} n` | Any type |
| `@param {...string} n` | Repeatable arguments |
| `@param {string} [n="hi"]` | Optional with default |
| `@param {string[]} n` | Array of strings |
| `@return {Promise<string[]>} n` | Promise fulfilled by array of strings |
See: <http://usejsdoc.org/tags-type.html>
@ -79,6 +80,22 @@ function play (song) {
See: <http://usejsdoc.org/tags-typedef.html>
### Importing types
```js
/**
* @typedef {import('./Foo').default} Bar
*/
/**
* @param {Bar} x
*/
function test(x) { }
```
This syntax is [TypeScript-specific](https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript#import-types).
### Other keywords
```js

View File

@ -29,3 +29,9 @@ Human Readable Format:
Largest 10 folder/file in the current directory:
$ du -hsx * | sort -rh | head -10
### Answer yes in a bash script
```bash
yes | /your/command
```

3
lua.md
View File

@ -183,8 +183,9 @@ title: Lua
-
-- Logic (and/or)
nil and 10 --> 10
nil and false --> nil
false and nil --> false
0 and 20 --> 20
10 and 20 --> 20

View File

@ -8,11 +8,13 @@ category: CLI
## Var assignment
```makefile
uglify = $(uglify) # assignment
compressor := $(uglify) # lazy assignment
uglify = $(uglify) # lazy assignment
compressor := $(uglify) # immediate assignment
prefix ?= /usr/local # safe assignment
```
`=` expressions are only evaluated when they're being used.
## Magic variables
```makefile

View File

@ -11,7 +11,7 @@ category: Python
list[:-1] # returns all but the last element
list[i] = val
list[i:j] = otherlist # replace ith to jth element with otherlist
list[i:j] = otherlist # replace ith to jth-1 elements with otherlist
del list[i:j]
list.append(item)

View File

@ -5,55 +5,61 @@ layout: 2017/sheet
weight: -1
authors:
- github: rizqyhi
updated: 2018-10-26
updated: 2019-03-24
description: |
Basic cheatsheets for regular expression
---
### Character Classes
##
| Pattern | Description |
| --- | --- |
| `.` | Any character, except newline |
| `\w` | Word |
| `\d` | Digit |
| `\s` | Whitespace |
| `\W` | Not word |
| `\d` | Not digit |
| `\S` | Not whitespace |
| `[abc]` | Any of a, b, or c |
{: .-three-column}
### Character classes
| Pattern | Description |
| ------- | ------------------------------ |
| `.` | Any character, except newline |
| `\w` | Word |
| `\d` | Digit |
| `\s` | Whitespace |
| `\W` | Not word |
| `\D` | Not digit |
| `\S` | Not whitespace |
| `[abc]` | Any of a, b, or c |
| `[a-e]` | Characters between `a` and `e` |
| `[1-9]` | Digit between `1` and `9` |
| `[1-9]` | Digit between `1` and `9` |
### Anchors
| Pattern | Description |
| --- | --- |
| `^abc` | Start with `abc` |
| `abc$` | End with `abc` |
| Pattern | Description |
| ------- | ---------------- |
| `^abc` | Start with `abc` |
| `abc$` | End with `abc` |
### Escaped Characters
### Escaped characters
| Pattern | Description |
| --- | --- |
| Pattern | Description |
| ---------- | -------------------------------------- |
| `\. \* \\` | Escape special character used by regex |
| `\t` | Tab |
| `\n` | Newline |
| `\r` | Carriage return |
| `\t` | Tab |
| `\n` | Newline |
| `\r` | Carriage return |
### Groups
| Pattern | Description |
| --- | --- |
| Pattern | Description |
| ------- | ------------- |
| `(abc)` | Capture group |
### Quantifiers
| Pattern | Description |
| --- | --- |
| `a*` | Match 0 or more |
| `a+` | Match 1 or more |
| `a?` | Match 0 or 1 |
| `a{5}` | Match exactly 5 |
| `a{3,}` | Match 3 or more |
| Pattern | Description |
| -------- | --------------------- |
| `a*` | Match 0 or more |
| `a+` | Match 1 or more |
| `a?` | Match 0 or 1 |
| `a{5}` | Match exactly 5 |
| `a{,3}` | Match up to 3 |
| `a{3,}` | Match 3 or more |
| `a{1,3}` | Match between 1 and 3 |

View File

@ -2,6 +2,7 @@
title: RESTful API
updated: 2018-12-25
layout: 2017/sheet
category: API
---
### Status codes

View File

@ -88,7 +88,7 @@ export default {
file: 'bundle.js',
format: 'cjs'
},
plugins [ json() ]
plugins: [ json() ]
}
```

View File

@ -29,6 +29,7 @@ rsync -avz ./src/ /dest
-z, --compress
-n, --dry-run
--partial # allows resuming of aborted syncs
--bwlimit=RATE # limit socket I/O bandwidth
```
### Display options
@ -36,6 +37,7 @@ rsync -avz ./src/ /dest
```bash
-q, --quiet
-v, --verbose
--stats
-h, --human-readable
--progress
-P # same as --partial --progress