Skip to content

Instantly share code, notes, and snippets.

View naeluh's full-sized avatar
🌐
Busy

nick hulea naeluh

🌐
Busy
View GitHub Profile
@naeluh
naeluh / useRawParams.js
Created October 27, 2023 19:36 — forked from Kostanos/useRawParams.js
Getting RAW (without URL decode) params from react-router-dom.
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
@naeluh
naeluh / download website assets
Created January 19, 2023 17:40 — forked from christiangenco/download website assets
Use wget to download a website's assets, including images, css, javascript, and html. From http://www.linuxjournal.com/content/downloading-entire-web-site-wget
$ wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
--domains website.org \
--no-parent \
www.website.org/tutorials/html/
@naeluh
naeluh / instructions.md
Created July 13, 2021 22:44 — forked from sveggiani/instructions.md
[Configure XDebug, Visual Studio Code for a Vagrant VM] #debug #vm #vscode

Configure XDebug, Visual Studio Code for a Vagrant VM

1. Assumptions

  • 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)

2. Configuration

@naeluh
naeluh / settings.json
Created April 24, 2020 20:57
settings
// setting.json
{}
@naeluh
naeluh / TruncateHtmlExtension.php
Created March 4, 2020 18:37 — forked from leon/TruncateHtmlExtension.php
Symfony 2 Twig Extension that truncates html and preserves tags
<?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 }
@naeluh
naeluh / gist:d0a653e793d7af647c87962962b1cdb8
Last active January 26, 2020 21:35
Notes for docker WSL 2

Here is a list of commands and pages to get Docker and Lando running on WSL 2

- 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:
@naeluh
naeluh / array_iteration_thoughts.md
Created January 16, 2020 20:24 — forked from ljharb/array_iteration_thoughts.md
Array iteration methods summarized

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.

Intro

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

@naeluh
naeluh / multiple_ssh_setting.md
Created October 3, 2019 18:29 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "[email protected]"

Install Mongo with WSL for Windows.

Home

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.

Install MongoDB Community Edition.

  1. Open a Windows PowerShell and type wsl.