Skip to content

Instantly share code, notes, and snippets.

View mcnaveen's full-sized avatar
🦄

MC Naveen mcnaveen

🦄
View GitHub Profile
{
/* Common */
"vsicons.dontShowNewVersionMessage": true,
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
/* Explorer */
"explorer.compactFolders": false,
/* Window */
"window.newWindowDimensions": "inherit",

Keybase proof

I hereby claim:

  • I am mcnaveen on github.
  • I am mcnaveen (https://keybase.io/mcnaveen) on keybase.
  • I have a public key ASDzKr0MnqufT5irHvdpGlnh44qxByGTb618ESfeCRqb8wo

To claim this, I am signing this object:

const colorTableBody = document.querySelector('.color-table__body');
if (colorTableBody) {
const rows = colorTableBody.querySelectorAll('tr');
const colorNames = [];
rows.forEach(row => {
const colorNameElement = row.querySelector('.color-table__cell.color-table__cell--name');
if (colorNameElement) {
const colorName = colorNameElement.innerText;
colorNames.push(colorName);
}
@mcnaveen
mcnaveen / check_authorization.php
Created April 3, 2021 15:39 — forked from anonymous/check_authorization.php
PHP Telegram Authorization
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@mcnaveen
mcnaveen / code.js
Created September 30, 2023 17:52
Add Copy Button to Ghost P Tag
<script>
document.addEventListener("DOMContentLoaded", function () {
var paragraphs = document.querySelectorAll(".gh-content p");
paragraphs.forEach(function (paragraph) {
var copyButton = document.createElement("button");
copyButton.className = "copy-btn";
copyButton.setAttribute("data-umami-event", "Copy button");
copyButton.innerHTML = "&#x1F4CB;";
#!/bin/bash
# URL of the Android Studio download page
URL="https://developer.android.com/studio"
# CSS selector to target the element
SELECTOR="#agree-button__studio_linux_bundle_download"
# Use curl to fetch the web page content and pipe it to grep
# -s: Silent mode (suppresses progress meter)
@mcnaveen
mcnaveen / file.md
Created August 18, 2023 05:44
Use MacBook in Camshell Mode (Lid Closed) without power adapter connected

Open the terminal and run the below command

pmset -g | grep hibernatemode

Note down the number in safe place, you'll need this later if you want to disable it

Now, run the below commands one by one.

Image will be uploaded
@mcnaveen
mcnaveen / findProperty.js
Created August 6, 2023 15:55
Notion Helper Function to find property value by name
const findPropertyValue = (results, propertyName) => {
const property = results.find((item: { properties: { Key: { title: { text: { content }; }[]; }; }; }) => item.properties.Key.title[0].text.content === propertyName);
return property ? property.properties.Value.rich_text[0].text.content : null;
};
// then just do
const somevar = findPropertyValue(response.results, "My Phone Number")
// Table should follow this structure
https://imgur.com/a/P2kssZV