The setup installs the following software:
The setup installs the following software:
- Apache
- MySQL
- PHP
- Node
Make it easy to include SVG strings inline via node-sass.
Escapes SVG (via encodeURIComponent
+ node-sass custom function).
Wraps <svg/>
with appropriate url(data...)
which I can never remember.
Call:
node-sass --source-map=true --functions=./node-sass-functions.js in.scss out.css
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
, elem.offsetTop
, elem.offsetWidth
, elem.offsetHeight
, elem.offsetParent
/* Use this additional style to hide element at start */ | |
.animate | |
{ | |
visibility : hidden; | |
} | |
.animated | |
{ | |
visibility : visible; | |
} |
mkdir ~/app-root/data/tmp | |
mysqldump -h $OPENSHIFT_MYSQL_DB_HOST -P ${OPENSHIFT_MYSQL_DB_PORT:-3306} -u ${OPENSHIFT_MYSQL_DB_USERNAME:-'admin'} --password="$OPENSHIFT_MYSQL_DB_PASSWORD" --all-databases > ~/app-root/data/tmp//all.sql |
//addEventListener polyfill 1.0 / Eirik Backer / MIT Licence | |
(function(win, doc){ | |
if(win.addEventListener)return; //No need to polyfill | |
function docHijack(p){var old = doc[p];doc[p] = function(v){return addListen(old(v))}} | |
function addEvent(on, fn, self){ | |
return (self = this).attachEvent('on' + on, function(e){ | |
var e = e || win.event; | |
e.preventDefault = e.preventDefault || function(){e.returnValue = false} | |
e.stopPropagation = e.stopPropagation || function(){e.cancelBubble = true} |