Skip to content

Instantly share code, notes, and snippets.

View djrobby's full-sized avatar

Robby Dhillon djrobby

  • Detroit, MI - USA
View GitHub Profile
@djrobby
djrobby / AppleMap.jsx
Created June 15, 2022 17:04 — forked from Scanerrr/AppleMap.jsx
Apple mapkitJS places example
import { useCallback, useState } from "react";
import { useMap } from "./useMap";
import { useSearch } from "./useSearch";
export default function AppleMap() {
const { mapkit, map, mapRef } = useMap();
const search = useSearch();
const [value, setValue] = useState("");
const [adressesList, setAddressesList] = useState(null);
@djrobby
djrobby / onload.js
Created November 12, 2022 17:49 — forked from jsonberry/onload.js
Window vs. Document Loading Events
/**
Taken from: http://stackoverflow.com/questions/588040/window-onload-vs-document-onload
According to Parsing HTML documents - The end,
The browser parses the HTML source and runs deferred scripts.
A DOMContentLoaded is dispatched at the document when all the HTML has been parsed and have run. The event bubbles to the window.
The browser loads resources (like images) that delay the load event.
A load event is dispatched at the window.
Therefore, the order of execution will be
DOMContentLoaded event listeners of window in the capture phase
DOMContentLoaded event listeners of document
@djrobby
djrobby / queryselector.js
Created December 22, 2022 15:37 — forked from shitalm/queryselector.js
querySelectorAll with regex support
/**
* querySelectorAll with regex support.
* TS version: https://gist.github.com/sagirk/3240407ebbc9369356759a806b66fe34.
*
* Note: In the `attributeToSearch` parameter's absence, all attributes on all
* DOM nodes will be searched. This can get quite expensive for large DOM trees.
*
* Usage example:
* `querySelectorAllRegex(/someregex/, 'target-specific-attribute-if-needed');`
*
[
{
"cmd": "linux_terminal",
"act": "Linux Terminal",
"prompt": "I want you to act as a linux terminal. I will type commands and you will reply with what the terminal should show. I want you to only reply with the terminal output inside one unique code block, and nothing else. do not write explanations. do not type commands unless I instruct you to do so. when i need to tell you something in english, i will do so by putting text inside curly brackets {like this}. my first command is pwd",
"tags": [
"awesome-chatgpt-prompts"
],
"enable": true
},