PBF notes for hector
Use const if you aren’t going to reassign the variable value (especially for functions)
72: for (let i = 0; i <trianglesOnVoxels.length; i ++) tInV.push(trianglesOnVoxels[i].length);
| #!/bin/bash | |
| if [ "$1" != "" ]; then | |
| dr=$(dirname $1) | |
| scdr=$(dirname $0) | |
| fn=$(basename $1) | |
| filename="${fn%%.*}" | |
| extension="${fn#*.}" | |
| output="${dr}/${filename}_wm.${extension}" | |
| # wm.png is my watermark. It's a white logo with 50% opacity and a transparent background. | |
| wm="${scdr}/wm.png" |
| import transitions from './transitions.css'; | |
| export default () => ( | |
| <ReactCSSTransitionGroup transitionName={transitions}> | |
| { ... } | |
| </ReactCSSTransitionGroup> | |
| ); |
| var planePositions = []; | |
| var r = 1; | |
| m = 3, // u segments | |
| n = 3, // v segments | |
| quads = []; | |
| function getPlaneIndexes () { | |
| var buffer = []; | |
| var points = [], |
| Regular expression cheat sheet for Varnish | |
| Varnish regular expressions are NOT case sensitive. Varnish uses POSIX | |
| regular expressions, for a complete guide, see: "man 7 regex" | |
| Basic matching: | |
| req.url ~ "searchterm" | |
| True if req.url contains "searchterm" anywhere. | |
| req.url == "searchterm" |
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| @function get-px-from-vw($vw, $contextWidth) { | |
| @return (($contextWidth / 100) * $vw) + px; | |
| } | |
| @function strip-units($number) { | |
| @if type-of($number) == "number" and not unitless($number) { | |
| @return $number / ($number * 0 + 1); |
| class InspirationModule | |
| { | |
| public $template; | |
| public $query; | |
| public $vars; | |
| } | |
| $moduleA = new InspirationModule(); |
If you are using backbone (and backbone.marionette) in a browserify managed project, you will likely run into issues with underscore (at least if you manage your dependencies with npm). Each package, that has underscore as a dependency, will require its own version of underscore (making your bundle file contain multiple versions of underscore). Back in the days, you could shim backbone and underscore like:
browserify({
shim: {
'underscore': {
path: './node_modules/underscore/underscore.js',
exports: '_'
},| var TweenLite = require("TweenLite"); | |
| var proxy = {}; | |
| function getSize(ratio, total) { | |
| return total * ratio; | |
| } | |
| function getProps(el, values) { |
| sudo chown -R $USER ~/.npm | |
| sudo chown -R $USER /usr/local/lib/node_modules |