Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| import fs from 'fs' | |
| import { Transform } from 'stream' | |
| import JSONStream from 'JSONStream' | |
| // Custom transform stream | |
| const transformer = new Transform({ | |
| objectMode: true, | |
| transform(jsonItem, encoding, callback) { | |
| // your logic goes here... | |
| // const updatedItem = {} |
| if ($source->getImageColorspace() == Imagick::COLORSPACE_CMYK) { | |
| $source->setImageFormat($fileInfo['extension']); | |
| $tmprealpath = $sourceDirectory; | |
| $tmp = $tmprealpath . '/' . md5($fileInfo['filename']) . ".".$fileInfo['extension']; | |
| $cmyk = true; | |
| // then we add an RGB profile | |
| $icc_rgb = file_get_contents(realpath('assets/color profiles/AdobeRGB1998.icc')); | |
| $source->profileImage('icc', $icc_rgb); | |
| $source->transformImageColorspace(Imagick::COLORSPACE_RGB); |
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
Just migrated it from Codepen.io to markdown. Credit goes to David Conner.
| Working with DOM | Working with JS | Working With Functions |
|---|---|---|
| Accessing Dom Elements | Add/Remove Array Item | Add Default Arguments to Function |
| Grab Children/Parent Node(s) | Add/Remove Object Properties | Throttle/Debounce Functions |
| Create DOM Elements | Conditionals |
| # Elasticsearch Cheatsheet - an overview of commonly used Elasticsearch API commands | |
| # cat paths | |
| /_cat/allocation | |
| /_cat/shards | |
| /_cat/shards/{index} | |
| /_cat/master | |
| /_cat/nodes | |
| /_cat/indices | |
| /_cat/indices/{index} |
(still a work-in-progress)
| <?xml version="1.0"?> | |
| <layout> | |
| <default> | |
| <!--Root/Default Layouts--> | |
| <reference name="root"> | |
| <!--Appending Block--> | |
| <block type="page/html_breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> | |
| </reference> | |
| <!--CSS and JS Files--> |
| #!/bin/bash | |
| # Bash script to install latest version of ffmpeg and its dependencies on Ubuntu 12.04 or 14.04 | |
| # Inspired from https://gist.github.com/faleev/3435377 | |
| # Remove any existing packages: | |
| sudo apt-get -y remove ffmpeg x264 libav-tools libvpx-dev libx264-dev | |
| # Get the dependencies (Ubuntu Server or headless users): | |
| sudo apt-get update |
| <?php | |
| /** | |
| * Copyright © 2011 Erin Millard | |
| */ | |
| /** | |
| * Returns the number of available CPU cores | |
| * | |
| * Should work for Linux, Windows, Mac & BSD |