Skip to content

Instantly share code, notes, and snippets.

View Elandlord's full-sized avatar

Eric Landheer Elandlord

View GitHub Profile
@Elandlord
Elandlord / use-keydown.js
Created September 17, 2021 09:37
Vue 3 use-keydown composable (Composition API)
import {onBeforeUnmount} from "vue";
let useKeyDown = (keyCombos) => {
let onKeyDown = (event) => {
let kc = keyCombos.find(kc => kc.key === event.key);
if(kc) {
kc.fn();
}
}

Shortcut console: command + shift + j

Design mode (free modify text on page)

  • Open console > document.designMode = "on"

Command palette (check tools)

  • Open console > command p
  • Screenshot > screenshot
  • Find CSS / JS file > coverage red implies unused, blue implies used code
  • document query selector equivalent > $('h1') (just like jQuery) double $$('h1') get all elements

Docker compose start

docker-compose up

Go into docker container

  1. docker ps // get containers
  2. docker exec -it <container name> /bin/bash // opens bash shell in container
  3. docker exec -it // execute command specified in container
@Elandlord
Elandlord / preload.php
Last active July 2, 2021 15:34
Preloader class for Laravel (by Brent Roose)
<?php
class Preloader
{
private array $ignores = [];
private static int $count = 0;
private array $paths;
private array $fileMap;
public function __construct(string ...$paths)
@Elandlord
Elandlord / sql_select_table_column_names.txt
Created December 20, 2019 09:53
Get the column names of a table with SQL
SELECT column_name
FROM information_schema.columns
WHERE table_name = 'table_name'
AND table_schema = 'database_name'
@Elandlord
Elandlord / ngrok
Last active December 7, 2023 15:57
For starting ngrok with your custom local domain (Free plan)
ngrok http -host-header=[your-custom-local-domain] [port]