Skip to content

Instantly share code, notes, and snippets.

View shaal's full-sized avatar

Ofer Shaal shaal

View GitHub Profile
@shaal
shaal / cursor.sh
Created July 11, 2024 14:34 — forked from ddwang/cursor.sh
Replace `/mnt/c/Users/<USER_NAME>/AppData/Local/Programs/cursor/resources/app/bin/cursor`
#!/usr/bin/env sh
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
if [ "$VSCODE_WSL_DEBUG_INFO" = true ]; then
set -x
fi
COMMIT="abd2f3db4bdb28f9e95536dfa84d8479f1eb312d"
APP_NAME="code"

Cleanup Instructions

Follow these instructions to clean up this file.

Your Role

You are an expert developer who has been hired to clean up this code.

Functions

@shaal
shaal / highlight-custom-element-in-console.es6.js
Created January 6, 2023 20:05
toggle outline styles on all custom elements (without shadow-dom scan)
// Get all elements
const elements = document.querySelectorAll('*')
// Create an array from elements
const elementArray = Array.from(elements)
// Map to node names
const nodeNames = elementArray.map(element => element.nodeName.toLowerCase())
// Filter by which ones are registered
@shaal
shaal / drupalpod--ddev-debug-test
Created April 9, 2022 23:11
`ddev debug test` in DrupalPod
Running bash [-c /tmp/test_ddev.sh]
OS Information: Linux shaal-drupalpod-v9ck724xx1q 5.16.19-051619-generic #202204081339 SMP PREEMPT Fri Apr 8 14:06:22 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
User information: uid=33333(gitpod) gid=33333(gitpod) groups=33333(gitpod)
DDEV version: ITEM VALUE
DDEV version v1.19.1
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:v1.19.0
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.19.0
docker 20.10.12
OS Information: Linux ws-dd0b0b4e-8614-4775-97ab-f8d3625deb26 5.4.0-1046-gke #48-Ubuntu SMP Thu Jun 17 19:16:06 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
ITEM VALUE
DDEV version v1.18.0-rc1
architecture amd64
db drud/ddev-dbserver-mariadb-10.3:20210729_cspitzlay_mysql_history
dba phpmyadmin:5
ddev-ssh-agent drud/ddev-ssh-agent:v1.17.0
docker 19.03.15
docker-compose 1.29.2
mutagen 0.12.0-beta5
version: '3.6'
#ddev-generated
services:
db:
container_name: ddev-${DDEV_SITENAME}-db
build:
context: './db-build'
dockerfile: '../.dbimageBuild/Dockerfile'
args:
8.d1449966.chunk.js:2 Uncaught (in promise) Error: Connection got disposed.
at Object.dispose (8.d1449966.chunk.js:2)
at 8.d1449966.chunk.js:2
at e.value (8.d1449966.chunk.js:2)
at e.value (8.d1449966.chunk.js:2)
at G (8.d1449966.chunk.js:2)
at e.value (8.d1449966.chunk.js:2)
at e.value (8.d1449966.chunk.js:2)
at n.value (8.d1449966.chunk.js:2)
at n.value (8.d1449966.chunk.js:2)
networks:
default:
external: true
name: ddev_default
services:
db:
build:
args:
BASE_IMAGE: drud/ddev-dbserver-mariadb-10.3:v1.16.0
gid: '33333'
@shaal
shaal / json2yml-script.sh
Created November 12, 2019 21:47
Convert all JSON files to YML in current tree
#!/bin/bash
#
# Convert JSON files to YML in current tree
#
shopt -s globstar
for file in **/*.json; do
yq r "$file" > "${file%.json}.yml";
rm "$file";
done
@shaal
shaal / sassrosenberg.theme
Created March 2, 2018 18:15
Drupal8 preprocess menu - Hide "About" Menu Item (from Main Menu), if current node title is "Who are we?"
/**
* Implements hook_preprocess_menu() for menu.html.twig.
*/
use Drupal\node\Entity\Node;
function sassrosenberg_preprocess_menu(&$variables, $hook)
{
if ($hook == 'menu__main') {