- Project (Drupal) is served on
/var/www/html
in the Vagrant box - Local project files location:
c:\Users\username\Work\projects\my-project\repo\html
- Guest machine IP is 10.0.2.2 (if this doesn't work, run
route -nee
in the VM and look for the gateway address)
import { useContext, useMemo } from 'react'; | |
// eslint-disable-next-line camelcase | |
import { UNSAFE_RouteContext, useParams } from 'react-router-dom'; | |
/** | |
* Temporary workaround to get RAW params from react-router-dom v.6 | |
* Should hanndle most of the simple cases like /:myVar/someVar/:mySecondVar | |
* @returns {Object} The same as useParams from react-router-dom but returns RAW (not URL decoded) paramters | |
*/ | |
export default function useRawParams() { |
name: Deploy to Pantheon | |
on: push | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: shimataro/ssh-key-action@v2 |
$ wget \ | |
--recursive \ | |
--no-clobber \ | |
--page-requisites \ | |
--html-extension \ | |
--convert-links \ | |
--domains website.org \ | |
--no-parent \ | |
www.website.org/tutorials/html/ |
// setting.json | |
{} |
<?php | |
/** | |
Truncate Html string without stripping tags | |
register in Resources/config/services.yml with: | |
services: | |
truncatehtml.twig.extension: | |
class: Radley\TwigExtensionBundle\Extension\TruncateHtmlExtension | |
tags: | |
- { name: twig.extension } |
- https://github.com/docker/for-win/issues/5096
- https://nickjanetakis.com/blog/setting-up-docker-for-windows-and-wsl-to-work-flawlessly
- https://github.com/docker/for-linux/issues/219
I ran into similar issue found a temp fix on another place.
Temp fix:
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 much simpler to think about both the old list and the new one, what they contain, and
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
This doc will guide you through installing Mongo DB using WSL through the Command Line.
Most of the steps are listed out here, but this guide will trim them down and make it more straight forward for our needs. There is also 1 step that is not in the link above as well, which will be noted when we come across it.
- Open a Windows PowerShell and type wsl.