The following steps are required for a typical web developer stack for php and some front-end development. This is for a developer machine and not for a live environment!
<?php | |
namespace Traits\Tests; | |
/** | |
* Mocks the entity manager | |
* | |
* Provides everything in the memory, so the tests does not depend on doctrine, | |
* which does a lot of stuff (maybe too much). This also allows to avoid to | |
* need and modify the data in the database, even if those are for the tests. |
var waitForEl = function(selector, callback) { | |
if (jQuery(selector).length) { | |
callback(); | |
} else { | |
setTimeout(function() { | |
waitForEl(selector, callback); | |
}, 100); | |
} | |
}; |
module.exports = { | |
get: function (req, res) { | |
res.sendfile(req.path.substr(1)); | |
}, | |
_config: { | |
rest: false, | |
shortcuts: false | |
} | |
}; |
var getPosition = function (options) { | |
return new Promise(function (resolve, reject) { | |
navigator.geolocation.getCurrentPosition(resolve, reject, options); | |
}); | |
} | |
getPosition() | |
.then((position) => { | |
console.log(position); | |
}) |
server { | |
listen 80; | |
listen [::]:80; #Use this to enable IPv6 | |
server_name www.example.com; | |
root /var/www/prestashop17; | |
access_log /var/log/nginx/access.log; | |
error_log /var/log/nginx/error.log; | |
index index.php index.html; |
https://gist.github.com/ljharb/58faf1cfcb4e6808f74aae4ef7944cff
While attempting to explain JavaScript's reduce
method on arrays, conceptually, I came up with the following - hopefully it's helpful; happy to tweak it if anyone has suggestions.
JavaScript Arrays have lots of built in methods on their prototype. Some of them mutate - ie, they change the underlying array in-place. Luckily, most of them do not - they instead return an entirely distinct array. Since arrays are conceptually a contiguous list of items, it helps code clarity and maintainability a lot to be able to operate on them in a "functional" way. (I'll also insist on referring to an array as a "list" - although in some languages, List
is a native data type, in JS and this post, I'm referring to the concept. Everywhere I use the word "list" you can assume I'm talking about a JS Array) This means, to perform a single operation on the list as a whole ("atomically"), and to return a new list - thus making it mu
Make sure that you have installed and tested Connector/J on your system: https://gist.github.com/craigvantonder/98391eb72f0e23525377ddbd89d607af/
Then read through: https://www.elastic.co/guide/en/logstash/current/installing-logstash.html
And proceed to download and install the Public Signing Key:
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
You may need to install the apt-transport-https package on Debian before proceeding:
// This goes in `assets/js/components/datepicker.component.js` | |
// ^^Remove this comment | |
/** | |
* <datepicker> | |
* ----------------------------------------------------------------------------- | |
* A wrapper for the jQuery UI datepicker, which falls back to a date input on mobile. | |
* | |
* @type {Component} | |
* | |
* @event input [emitted when the value is changed privately] |
/** | |
* <stripe-card-element> | |
* ----------------------------------------------------------------------------- | |
* A wrapper for the Stripe Elements "card" component (https://stripe.com/elements) | |
* | |
* Example usage: | |
* ``` | |
* <stripe-card-element stripePublishableKey="…" v-model="formData.cardInfo"></stripe-card-element> | |
* ``` | |
* |