Skip to content

Instantly share code, notes, and snippets.

@silvandiepen
Last active January 25, 2019 11:13
Show Gist options
  • Save silvandiepen/2a403fd1e86f1cee228f120096ec0689 to your computer and use it in GitHub Desktop.
Save silvandiepen/2a403fd1e86f1cee228f120096ec0689 to your computer and use it in GitHub Desktop.
Cheatsheet
{
"javascript": ["js-custom-properties"],
"css": ["flexbox","css-grid"],
"misc": ["lowercase","publish-tag"]
}
Title Description
Grid
Some helpers for css grid.
Title Description
Flexbox
What was it again? Horizontal is... well, here ya go

Align horizontal

flex-direction: row;

Align vertical

flex-direction: column;

Align center

justify-content: center;
align-items: center;

Align center horizontal

justify-content: center;

Align center vertical

align-items: center;
Title Description
Custom Properties
Add or read custom properties

Set

element.style.setProperty(propertyName, value, priority);

Get

element.style.getProperty(propertyName);

Remove

element.style.removeProperty(propertyName);
Title Description
To Lowercase
There are so many ways to make a string lowercase, every language has its own function.

SCSS

to-lower-case($string);

JS

toLowerCase(string);

PHP

strtolower(string);
Title Description
Publishing tagged versions
Publishing a version which could be for instance a "release candidate", "next", "beta", etc..To not directly destroy the master version.

In your package:

  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish .tgz --tag next to publish the package under the next tag

In your project:

  • Run npm install --save package@next to install prerelease package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment