The double ampersand -- or as A list apart called it "lobotomized owl selector" -- is a CSS rule that looks like the following:
* + * {
/* some declarations */
}
You can also use it with a specific selector:
async function validatePassword(password: string): string[] { | |
let errors = [] | |
// 1. Don't regex for things you can trivially express in code | |
// ----------------------------------------------------------- | |
// For example, we could have written this as `/^.{0,7}$/` but that's not | |
// nearly as clear as checking the length of the string. | |
if (password.length < 8) { | |
errors.push("Password must be at least 8 characters long") |
{% macro emailLinks(text, class) %} | |
{# v1 #} | |
{% spaceless %} | |
{% set text = text|replace('/([a-zA-Z0-9_.+-]+)+@([a-zA-Z0-9-]+.[a-zA-Z]+)/', '<a ' ~ (class ? 'class="' ~ class ~ '" ') ~ 'href="mailto:'~ '\\1@\\2' ~'">'~ '\\1@\\2' ~'</a>') %} | |
{{text|raw}} | |
{% endspaceless %} | |
{% endmacro %} |
# Middleman - Inline SVG Helper | |
# ------------------------------------------------------------------------------ | |
# | |
# Installation | |
# ------------ | |
# 1. Save this file at `[project_root]/helpers/image_helpers.rb` | |
# 2. Open the project's Gemfile and add this line: `gem "oga"` | |
# 3. Run `bundle install` from the command line | |
# | |
# Note: Restart your local Middleman server (if it's running) before continuing |
The double ampersand -- or as A list apart called it "lobotomized owl selector" -- is a CSS rule that looks like the following:
* + * {
/* some declarations */
}
You can also use it with a specific selector:
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl https://www.npmjs.org/install.sh | sh |