Cheatsheets

CSS Grid cheatsheet

Container .grid-container { /* Display properties */ display: grid; display: inline-grid; display: subgrid; /* Columns and rows */ grid-template-columns: 1rem 2rem 1rem; /* Measurement units */ grid-template-columns: 25% 50% 25%; /* Percentage units */ grid-template-columns: 1rem auto 1rem 2fr; /* Fill remaining widths with auto or fr units */ grid-template-columns: repeat(12, 1fr); /* Repeat columns without needing to write them */ grid-template-rows: 1rem 10% auto repeat(5, 10px); /*...

Read more...

Bolt Quickstart cheatsheet

Install Bolt # On MacOS brew cask install puppetlabs/puppet/puppet-bolt # On Windows choco install puppet-bolt Bolt is available as a package for most platforms. See installing bolt Create a module with a task mkdir -p ~/.puppetlabs/bolt/modules/mymodule/tasks cp myscript.sh ~/.puppetlabs/bolt/modules/mymodule/tasks/ Tasks can be written in any language your targets can run. See writing tasks for more details. Run Bolt bolt task run mymodule::myscript -n node1.example.com,node2.example.com --private-key ~/.ssh/id_rsa-private See bolt task run --help for more information and command line options.

Read more...

RESTful API cheatsheet

Status codes 200 OKSuccessful get, patch (return a JSON object)201 CreatedSuccessful post (return a JSON object)202 AcceptedSuccessful post, delete, path - async204 No contentSuccessful delete206 Partial contentSuccessful get - async Error status 401 UnauthorizedNot authenticated403 ForbiddenAuthenticated, but no permissions422 Unprocessable entityValidation Errors HTTP/1.1 401 Unauthorized Content-Type: application/json { 'id': 'auth_failed', 'message': "You're not logged in." } Here’s an example of a possible error reply. Versioning GET /api/foo Accept: application/json; version=1 You can pass a version=x to the Accept request header. Info here Authentication curl -is https://$TOKEN@api.service.com/ Methods GET /articles/1read, returns 200PUT /articles/1edit (or path), returns 200DELETE /articles/1delete, returns 200POST /articlescreate,...

Read more...

Jsdoc cheatsheet

Functions /** * This is a function. * * @param {string} n - A string param * @return {string} A good string * * @example * * foo('hello') */ function foo(n) { return n } See: http://usejsdoc.org/index.html Types @param {string=} nOptional@param {string} [n]Optional@param {(string\|number)} nMultiple types@param {*} nAny type@param {...string} nRepeatable arguments@param {string} [n="hi"]Optional with default@param {string[]} nArray of strings@return {Promise<string[]>} nPromise fulfilled by array of strings See: http://usejsdoc.org/tags-type.html Variables /** * @type {number} */ var FOO = 1 /** * @const {number} */ const FOO = 1 Typedef /** ...

Read more...