Skip to content

Instantly share code, notes, and snippets.

// Function to set the width and height of the element
function setElementSize(element) {
element.style.width = '47px';
element.style.height = '47px';
}
// Function to check for the element's existence and set its size
function checkForElement() {
const chatWidget = document.querySelector('chat-widget');
if (chatWidget && chatWidget.shadowRoot) {
<html>
<head>
<a href="https://noc.social/@groksrc" rel="me">@[email protected] I ❤️ Mastodon</a>
</head>
<body>
</body>
</html>
@groksrc
groksrc / launch.json
Last active February 16, 2016 16:02
Configure Visual Studio Code to debug Mocha specs
{
"version": "0.2.0",
"configurations": [
{
"name": "Launch",
"type": "node",
"request": "launch",
"program": "${workspaceRoot}/server.js",
"stopOnEntry": false,
"args": [],
@groksrc
groksrc / js_alert_foobar
Last active August 29, 2015 14:23
JavaScript Confusion
<html>
<body>
<script>
(function() {
var foo = new Object();
var bar = new Object();
var map = new Object();
map[foo] = 'foo';
map[bar] = 'bar';